Posts

Showing posts from July, 2012

iis - How to resolve typename not found in ASP.NET web application -

i developing web application using asp.net 4.0 company intranet. application began web site application , used iis 7.5 'convert application'. moved class module folder named old_app_code , when try run application, can not find typename have referenced in objectdatasource parameter. question "how should resolve problem?". ok try reference code in old_app_code folder, or there way of doing this. code in vb, not makes difference. ide microsoft visual web developer 2010 express. app_code should main folder should have logical code. check this why having ambiguous type error when calling webmethod on asp.net web application?

LiveCycle javascript validation -

i have case: there numeric field, must filled 10 numbered id of user. need have autamatic check of existance of id. formula is: [(p1 * 2) + (p2 * 4) + (p3 * 8) + (p4 * 5) + (p5) * 10) + (p6) * 9) + (p7 * 7) + (p8) * 3) + (p9 * 6)] % 11 = p10 p1 first digit, p2 second etc. i new in javascript, thankfull help. here i've tried: if ((((this.position(1) * 2) + (this.position(2) * 4) + (this.position(3) * 8) + (this.position(4) * 5) + (this.position(5) * 10) + (this.position(6) * 9) + (this.position(7) * 7) + (this.position(8) * 3) + (this.position(9) * 6)) % 11) == this.position(10)) { } else { xfa.host.messagebox("wrong id", "error!", 1, 0); } something work: var s = this.rawvalue; var prod = s.substr(0,1)*2 + s.substr(1,1)*4 + s.substr(2,1)*8 +... if (prod%11 == s.substr(9,1)){ //do whatever } else { //do whatever else } remember substr() function starts @ 0 instead of 1, , second 1 makes sure take 1 character.

SqlLiteDatabaseLockedException in android database helper class -

i've helper class manages database queries throughout application. singleton class , getinstance() method. public static masterdatabase getinstance() { if (_masterdb == null) { _masterdb = new masterdatabase(); } return _masterdb; } though i've taken care 1 instance of class created, sqllitedatabaselockedexception message database locked. thought of implementing double-checked locking technique appears may brake in multicore environments. so, best implementation ensure exception wont repeat in application. note: other transaction methods(insert,delete,..) not synchronised. question2 : making transaction methods synchronised good? if using android-s databasehelper database may opened databasehelper. try this private static databasehelper _mydatabasehelper = null; public static masterdatabase getinstance() { if (_mydatabasehelper == null) { _mydatabasehelper = new mydatabasehelper(); } return _mydatabasehelper...

How to set a background image in rails from css? -

i using rails 3.2 , have set background 1 of page , have tried many ways , nothing went right, looking help. have tried background: url(<%= asset_path 'background.jpg' %>) background: url("public/background.jpg"); background-image:url('/assets/images/background.jpg') and nothing worked. please me. in css: background-image: url(background.jpg); or background-image: url(/assets/background.jpg); in environments/production.rb : # disable rails's static asset server (apache or nginx this) config.serve_static_assets = false # compress javascripts , css config.assets.compress = true # don't fallback assets pipeline if precompiled asset missed config.assets.compile = false # generate digests assets urls config.assets.digest = true

ajax - Tapestry 5 - POST to endpoint on component and get back JSON in one scenario or do redirects in other scenarios -

i adding new requirement legacy tapestry login component show popup if error condition happens on login, without doing page reload. currently login component uses standard tapestry form submission - i.e. login creds posted server on form submission, login processing done, , based on result tapestry appropriate redirect returning either page class, or page object injected @injectpage has had setup done on - standard tapestry stuff really. i need leave current logic - i.e. keep tapestry doing redirects currently, need following extras: the post request must done via ajax the result if meet new error condition must plain json, client knows display popup. the login endpoint must able called other browser-based clients know nothing tapestry , vice-versa tapestry. tapestry redirects should work (if possible - how baked server , client-side framework redirects?) sending down of plain json. i think (1) , (2) pretty straightforward achieve using tapestry zones, struggling see h...

How Can I only open a MS Access Form without Access running in the background? -

i have made form on access used other employees within company, have never used access before , wanting access form feel access , tools in background confuse them, plus don't want them editing data base self. is there way bring form, unless need edit date base. i've done research on google , seems need use: sw_showminnoactive however can not seem find how use or where? and if did find way bring form, how able switch veiw veiw edit in? can please help.

android - Reflect Settings change in View on update -

in android app, use sharedpreferences let user manage settings. after user changes setting, , returning app settings page, want views (fragments) use latest values sharedpreferences. the changes include reloading custom view use color scheme or remove filtering list view. currently when app restarted, required changes applied. convinced there way solve problem, unable figure out. assume supporting android 2.2 , above, newer apis may not used unless present inside support library. not sure question seems me when user changes setting , hits button return fragment not seeing changes? if case because when user goes android reinstates version of fragment on stack (the 1 before changes made). suggestion try moving loading of new shared prefs onresume method fragment. way should loaded when user goes back. try this @override public void onresume(){ super.onresume(); setcontentview(r.layout.currentfrag); } this should reload page correct changes.

asp.net - export crystal report to pdf without temp file programmatically in asp net -

how export crystal report pdf without temp file programmatically in asp net server end user. if remove write access of temp folder , cause error.our admin not giving access it.is option export crystal report pdf end user. please suggest. reportdocument.load(this.mappath("xyz.rpt")); reportdocument.database.tables[0].setdatasource(dsreport.tables[0]); rptviewer.reportsource = salary_reportdocument; rptviewer.visible = true; rptviewer.databind(); reportdocument.exporttohttpresponse(crystaldecisions.shared.exportformattype.portabledocformat, response, true, "xyzreport"); something this { exportoptions crexportoptions ; diskfiledestinationoptions crdiskfiledestinationoptions = new diskfiledestinationoptions(); pdfrtfwordformatoptions crformattypeoptions = new pdfrtfwordformatoptions(); crdiskfiledestinationoptions.diskfilename = "c:\\csharp.net-informations...

c++ - QAbstractItemDelegate, editorEvent, CE_PushButton and item selection -

i'm having problem selection of delegated item represents 2 text lines , ce_pushbutton. want have row selected clicking button too. here paint function code: void columntwolinesdelegate::paint( qpainter *painter, const qstyleoptionviewitem &option, const qmodelindex &index ) const { if (!index.isvalid()) return; if (option.state & qstyle::state_selected) { painter->setpen(qpen(qt::white)); if (option.state & qstyle::state_active) { painter->setbrush(qbrush(qpalette().highlight())); } else { painter->setbrush(qbrush(qpalette().color(qpalette::inactive, qpalette::highlight))); } painter->drawrect(option.rect); } else { painter->setpen(qpen(qt::black)); } qapplication::style()->drawprimitive(qstyle::pe_panelitemviewitem, &option, painter, 0); // ...it draws 2 text lines. painter->restore(); qrect tbuttonrect; ...

jquery - On event doesn't work -

a simple question: when use $(document).on('click', '.btn-del-top', function(e) {}) everyhing work, if use $('.btn-del-top').on('click', function(e) {}) nothing work.is there explanation? it because btn-del-top elements created dynamically or created after $('.btn-del-top').on('click', function(e) {}) code executed. demo1 : in case not working because code not inside dom ready

Maven Dependency-List in Eclipse -

dependency-list i programming code maven in eclipse supposed dependencies of project. therefore included maven-dependency-plugin 2.8 project. plugin provides method mvn dependency:list want use in eclipse. the question is: code need, dependency-list working in project? ps: found class listmojo appears have right function. problem is, don't know how go on. feel free request more information if needed. appreciated, thanks. nils why don't call maven target on command line , parse resulting report? seems easier trying load maven , maven plugin java code directly execute same functionality.

c# - Generic extension method with custom return type -

i trying write extension method 2 entities. first find type of object, inner join table. if it's type join must b. if it's type b join a. got stuck on join condition. public static c getallinfo<t>(this iqueryable<t> objcust) { if (typeof(t) == typeof(b)) { //prepare object based on type var objcastreg = objcust iqueryable<b>; //how write join here ????? var objusermaster=objcastreg.groupjoin(a,um=>um.userid,r=>r.) //build class object 2 retrieved objects. } if (typeof(t) == typeof(a)) { var objcast = objcust iqueryable<a>; } return null; } public class c { public a{ get; set; } public b b{ get; set; } } sounds shouldn't use generics @ all. generics when generic method does not need know type. generic type parameter signals method can work concrete type whatsoever. maybe should have 2 special-cased method both cases here. makes cas...

check if alert is clicked using jquery -

this question has answer here: javascript/jquery: responding user clicking “ok” on alert dialog 3 answers $(document). ready(function() { alert("clicked"); }); how check if alert clicked ok using jquery . know how using prompt or confirmation just put code after alert call: $(document). ready(function() { alert("clicked"); // code here executed after `alert` dialog dismissed }); this works because alert (just confirm or prompt ) blocks js execution. you cannot distinguish though whether ok clicked or dialog closed.

html - Failed to Load Resource, Plugin Handled Load on iOS -

every time try view video file on server error on ios in safari, chrome. i using blob server , apache server not sure problem is. however, when use apache, error have video rendering too. however when render using server not working. know why is? videos work fine on other devices , in browsers works fine if accessed through apache only. the solution problem work around. reason being blob servers aren't streaming servers. ios devices expect videos arrive in small chunks. instance streaming server able this. however, blob server hands video blob not ios device expects. browsers smart enough handle others not. the way solved add video files outside of blob server in folder within project , render through apache server instead of serving via actual blob server using. hope helps.

android - onclick event not getting triggered -

this code, can tell me whats problem? <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/background_bf" android:orientation="vertical" > <scrollview android:layout_width="fill_parent" android:layout_height="0dp" android:layout_margin="10dp" android:layout_weight="1" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/white" android:orientation="vertical" > <textview android:layout_width="fill_parent...

android - Close an Activity after 10 seconds? -

i use call activity main.java intent intent = new intent(this, message_note.class); intent.setflags(intent.flag_activity_new_task); startactivity(intent); message_note.java : public class message_note extends activity { @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.message); } } how can close message_note activity after 10 seconds ?? should use thread ? after 100 ms, activity finish using following code. public class message_note extends activity { @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.message); handler handler = new handler(); handler.postdelayed(new runnable() { public void run() { finish(); } ...

How in c++ create message similar to snprintf and just change value in message? -

how can create message similar snprintf ( can have generic text %d integer , when need show in sprintf connect parameter), avoid concatenation? (i need create result string you need more %d coins , @ moment doing on bad way concatenate , return value 'you need more' + some_stringified_value + 'coins' ) the "canonical" c++ way use stringstream , this: std::string somefunc(int number) { std::stringstream ss; ss << "you need " << number << " more coins"; std::string str = ss.str(); return str; }

polymorphism - Virtual keyword use in C++ -

i understand c++ implements runtime polymorphism thorugh virtual functions , virtual keyword inherited don't see use of virtual keyword in derived class. e.g. in below case if dropped virtual keyword in derived class still ptr->method() call goes derived::method. virtual keyword doing in derived class? #include<iostream> using namespace std; class base { public: virtual void method() { std::cout << std::endl << "base" << std::endl; } }; class derived: public base { public: virtual void method() { std::cout << std::endl << "derived" << std::endl; } }; int main() { base* ptr = new derived(); ptr->method(); return 9; } nothing. remind functions virtual or not.

android - AsyncTask publishProgress dont call onProgressUpdate -

i have similar threads issue, couldn't find solution problem my asynktask should download file dropbox , display progress in notification progressbar. doinbackground download file method publishprogress / onprogressupdate not work correctly. onprogressupdate not getting called. asynctask public class songdownload extends asynctask<string, string, string> { dropboxapi<androidauthsession> ddbapi; context context; dropbox db; sharedpreferences prefs; notificationmanager mnotifymanager; notification notification; string datei; public songdownload(context context, dropbox db) { this.db = db; this.context = context; log.v("mp3dropboxsync", "songdownload"); mnotifymanager = (notificationmanager) context.getsystemservice(context.notification_service); notification notification = new notification(r.drawable.ic_launcher, "neuer dropbox song!", system.currenttimemilli...

wpf - Border IsMouseOver Trigger not working -

Image
i have problem trigger , property ismouseover in following snippet <border name="part_logo" background="{dynamicresource accent}" width="36" height="36" horizontalalignment="right" verticalalignment="top" margin="0,0,76,0"> <border.inputbindings> <mousebinding command="presentation:commands.logoclickcommand" gesture="leftclick" /> </border.inputbindings> <border.style> <style targettype="border"> <style.triggers> <trigger property="ismouseover" value="true"> <setter property="bitmapeffect"> <setter.value> <blurbitmapeffect radius="3" kerneltype="gaussian"/> </setter.value> </setter> ...

java - Trying to persist an entity with @ManyToOne mapping -

i'm trying persist user has mapping @manytoone userstatus but when code below, hibernate throws propertyvalueexception user.setstatus(new userstatus(1)); em.persist(user); // ou session.saveandupdate(user); to work have way: user.setstatus(em.getreference(userstatus.class, 1)); em.persist(user); // ou session.saveandupdate(user); i know first way possible, don't know whether need configure or call method (i've tried saveandupdate session , still same) does have idea? the error message is: not-null property references null or transient value the mapping @manytoone(optional = false) @joincolumn(name = "user_status_id", nullable = false) public userstatus getstatus() { return status; } this error means " you referencing null (not persisted) object " , have choice: remove nullable or set @cascade userstatus per persisted when em.persist(user) @manytoone(optional = false) @joincolumn(name = "user_status_id"...

java.util.ServiceLoader not loading my provider class -

i trying put basic spi-based registry of handlers, lookup handlerregistry. when use serviceloader.load(handler.class) initialize providers, , iterate list lazily load them, not seeing instances of class. keeping simple possible, handlerregistry class is: public class handlerregistry { private static handlerregistry registry; private serviceloader<handler> handlerloader; private handlerregistry() { handlerloader = serviceloader.load(handler.class); } public static synchronized handlerregistry getregistry() { if (registry == null) { registry = new handlerregistry(); registry.init(); } return registry; } private void init() { system.out.println("handlerregistry.init()"); } public handler lookup(string item) { system.out.println("lookup("+item+")"); try { iterator<handler> = handlerloader.iterator(); while (it.hasnext()) { handler handler = it.next(); system...

javascript - Add jquery listener to dynamically created element -

i need add jquery listener dynamically created elements. cannot life of me work. tag_options not dynamic, children are. have tried 3 ways: http://jsfiddle.net/nfe2f/ <div id = "tag_options"> <div class = "tag_option">hover me</div> </div> the js: // never works $('#tag_options').delegate('.tag_option', 'hover', function(event){ alert(); }); // never works $("#tag_options").on("hover", "[class='tag_option']", function(event) { alert(); }); // works if not dynamically created $('#tag_options .tag_option').hover( function(){ alert(); }); there no hover event anymore , delegate being phased out in favor of on . you'd want use mouseenter , mouseleave . believe you're shooting this: $('#tag_options') .on('mouseenter', '.tag_option', function(e){ /* wax on */ }) .on('mouseleave', '...

validation - PHP WideImage check if valid image -

i using wideimage manage images uploaded application. however, no validity checking on documents application assumes gets uploaded valid image document. how can use wideimage check if file image , not word document renamed .jpg example. have checked wideimage docs couldnt find anything.. detective skills lacking maybe thats why... here code use wideimage: $image = \wideimage::loadfromfile($new_file); $splash = $image->resize('600', '600', 'outside'); $splash->savetofile($dir . '/' . $media_id . '.logo.jpg'); the function loadfromfile returns image object , can validate variable $image instance of wideimage_paletteimage or wideimage_truecolorimage class. if that's valid instance, uploaded file should valid image file. http://wideimage.sourceforge.net/wp-content/current/doc/wideimage/wideimage.html#methodloadfromfile

html - iframe does not show in IE8 -

i have hotel reservation system inside iframe not show in ie8. i'm thinking doctype issue? you can view http://bit.ly/15nhlav this doctype website. iframe not have doctype declared. <!doctype html> <!--[if ie 8]> <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]--> <!--[if gt ie 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--< [endif]--> i've found it'll show iframe if inner width of browser ( document.documentelement.clientwidth ) 1095px or larger. lower , gets pushed underneath (this happens other browsers tested with, too). however, in ie8 iframe covered element (i couldn't find which), fixed adding following css style: .iframe-home-res { z-index:10000; } this forces iframe render on top of other elements (unless have z-index greater 10,000, have manually set). you might want @ iframe 's code separately thoug...

c# - How to use a Variable Name which was Obtained at Run-Time -

all, provide on-the-fly mechanism debugging application in different languages using required resource string (in foreign language) display english equivalent @ run-time should user require it. done using public static string getmessage(string messagekey) { cultureinfo culture = thread.currentthread.currentculture; if (!culture.displayname.contains("english")) { string filename = "messagestrings.resx"; string appdir = path.getdirectoryname(application.executablepath); filename = path.combine(appdir, filename); if (file.exists(filename)) { // english error message. using (resxresourcereader resxreader = new resxresourcereader(filename)) { foreach (dictionaryentry e in resxreader) if (e.key.tostring().comparenocase(messagekey) == 0) return e.value.tostring(); } } } return null; } where g...

lua - Attempt to index local 'star1' (a nil value) -- I've researched everywhere and don't get it -

i've been stuck on while , need help. i'm trying have these objects spawn on screen , allow player drag them around want. at moment random objects flow onto screen, when try click on 'star1' error : attempt index local 'star1' (a nil value) how should properly? here code: display.setstatusbar(display.hiddenstatusbar) local physics = require('physics') physics.start() --physics.setgravity(0, 0) _w = display.contentwidth; --returns screen width _h = display.contentheight; --returns screen height local bg = display.newimage('bg1.png') local startable = {} ship = display.newimage("head.png") ship.name = "ship" ship.x = -80 ship.y = 100 physics.addbody(ship, { issensor = true }) ship.bodytype = 'dynamic' shipintro = transition.to(ship,{time=4000, x=200}) ship.width = 40 ship.height = 40 ship.gravityscale = 0 local star1 = display.newimage("acorn") star1....

django - Python 2.6 on MacOSX - ImportError: No module named _collections -

i'm little bit baffled error i'm getting when try runserver or syncdb - server running fine other night when last logged on, have no idea why of sudden it's not working. google gave me following page doesn't address issue. let me know if need more if console information below isn't enough. not efficient django yet, complete beginner really, , i'm not sure why isn't working. pythoness-410:auth gfleche$ python manage.py runserver traceback (most recent call last): file "manage.py", line 8, in <module> django.core.management import execute_from_command_line file "/library/frameworks/python.framework/versions/2.6/lib/python2.6/site-packages/django/core/management/__init__.py", line 1, in <module> import collections file "/library/frameworks/python.framework/versions/2.6/lib/python2.6/collections.py", line 8, in <module> _collections import deque, defaultdict importerror: no module named...

ios - How to accomplish a "90% slide" between two UIViews -

Image
i have particular scenario i'm trying emulate and, being new cocoa touch, i'm not sure of best way accomplish it. pardon lacking tactical knowledge; clear exposition help. what i'd emulate: the app i'm looking @ (in particular) beat . below example of 1 of uiviews - in particular, notice gear icon settings @ bottom. when gear touched or swiped up, 2 primary uiview changes occur: the original uiview slid screen 90% of way (the key point being not slide all way up). a new uiview slid fill newly vacated 90% space. this basic functionality accomplish. implementation idea #1: single uiviewcontroller w/ multiple uiviews at first, considered having single uiviewcontroller manage both "main" , "settings" views. in case, simple thing transition these views in appropriate manner. that said, seems bit cluttered me. depending on how robust 2 sets of functionality are, that's recipe overload single uiviewcontroller. might tell me ...

c# - Return ComboBox as Boolean -

i know not best practice use boolean combobox application returns data yes/no thats required. i'm trying return whether yes or no getting warning 'possible unintended reference' cleaning code appreciated. public bool playdatatoend { { return this.playdatatoend.selectedvalue == "yes"; } set { this.playdatatoend.selectedvalue = true; } } suppose internal combobox named playdatatoendcombo : public bool playdatatoend { { return playdatatoendcombo.selectedvalue.tostring() == "yes"; } set { playdatatoendcombo.selectedvalue = value ? "yes" : "no"; } } i think should use index convention: 0 yes , 1 no : public bool playdatatoend { { return playdatatoendcombo.selectedindex == 0; } set { playdatatoendcombo.selectedindex = value ? 0 : 1; } }

asp.net mvc - Unit Tests - Referencing 3.0.0.0 MVC, version actually 4.0.0.0 -

i've googled, answers haven't been helpful me personally. i testing sendemail using unit tests (nunit) // arrange var mockdbcontext = new mock<dbcontext>(); iservice service = new service(mockdbcontext.object); // act var result = service.sendemail(string.empty,1,1); //assert assert.that(result, is.not.null); assert.that(result, is.instanceof<bool>()); assert.areequal(result, false); public bool sendemail(string emailaddress, int mid, int deadline) { try { dynamic email = new email("circulationemail"); email.to = emailaddress; email.mid = mid; email.deadline = deadline; email.send(); return true; } catch (exception ex) { elmah.errorsignal.fromcurrentcontext().raise(ex); return false; } } sendemail uses postal. i following error when run test. when debug throws error before hitting fir...

Filtering MySQL data by rails session parameter -

i've got rails application, backed mysql. it's using row-level permissions model. i.e. have few columns (permission1, permission2, permission3) on table called projects , need check if user has details of permissions can access in session can see data queried projects table , filter out if don't. i on case case basis, i'm looking generic (i) works other tables might add permissions model later , (ii) if run projects.all somewhere , forget add appropriate clause don't accidentally show data user doesn't have permission view it. previously i've used modified jdbc driver in java webapp, don't know equivalent solution should rails + mysql. just discovered default_scope, should sufficient on per-model basis. that's close enough.

javascript - How to detect a keypress AND a mouseover at the same time -

okay can detect mouseover using .on('mouseover') and can detect keypresses using $(document).keypress(function(e) { console.log(e.which); } but how detect image mouse hovering on when press button? the idea able delete image pressing d while hovering on it. ideas ? you can toggle class or data-attribute shows 1 being hovered $('img').hover(function(){ $(this).toggleclass('active'); // if hovered has class active }); $(document).keypress(function(e) { if(e.which == 100){ $('.active').remove(); // if d pressed remove active image } }); fiddle

php - How do you intentionally cause a SoapFault for testing? -

i implemented soapclient interface handling rate requests federal express rate request web services. last night @ around 1 system returning soap fault conditions code handled it's response checking (it skips on , sends generic message if doesn't find valid rate response) isn't handled specifically. when service down, show more useful message customers such faults when remote services down perhaps cut down calls our tech support. (the generic message says 'try again later', if know it's problem fedex services being down, can 'fedex rate service temporarily unavailable' people know it's not our site, theirs) i've implemented code handle soapfault condition, have problem of 'how test it' fedex rate service down briefly last night. is there way intentionally trigger soap condition, perhaps specific soap fault testing purposes? i suggest using soapui mock service. can indicate response service return. point appliation mock...

bash - sh variable not working if blank -

need eyes one... dns_lookup() { ip_set if [ `ip_ping ${ip_address}` -eq 0 ] host="" dig +short -x ${ip_address} | sed 's/\.$//g' | while read host if [ -z "${host}" ] host="unknown" fi echo "${ip_address},${host}" done fi } i desired results if ip pingable , has dns name. not results if ip pingable not have dns name. ip_set() { ip_address="${a}.${b}.${c}.${d}" } ip_ping() { timeout ${delay} ping -q -c 1 -i 1 -w 1 -w 4 $1 > /dev/null 2>&1 ; echo $? } perhaps need. tell me if need revisions. dns_lookup() { ip_set if [ `ip_ping ${ip_address}` -eq 0 ] host="" dig +short -x ${ip_address} | sed 's/\.$//g' | { hashosts=false while read host ...

html - Vertically align stubborn paragraphs -

i have been trying 'about us' section vertically align paragraph below it. reason, when try resize viewing area or @ smaller screen, , on 2 different lines, , if keep making area smaller 'about us' drop down below , left of entire paragraph. my first question pondering how make 'about us' text stays on 1 line, rather folding in 2 or more lines. second how can make scalable without dropping 'about us' text below paragraph? attached code in jsfiddle. thanks guys!! http://jsfiddle.net/2l9qu/ here troubling html: <div class="maincontentcontainer"> <div class="maincontent1"> <h1> </h1> </div></div> here accompanying css: .maincontentcontainer { width: 85% } .maincontent1 h1 { font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; co...

silverlight : Checkbox checked/unchecked with another checkbox checked/unchecked -

i have few checkbox's (8 of them) 1 of enable/disable other 7 checkbox's. for have written as, isenabled="{binding elementname=controlchkenable, path=ischecked, mode=oneway}" ischecked="{binding elementname=controlchkenable, path=ischecked, mode=oneway}" in every dependent cb's. enable/disable working fine, if master checkbox unchecked, other checkbox's not getting unchecked , getting disabled. any idea went wrong? when checkbox disabled cannot change value. to in mvvm, have change values before disabled main checkbox : c# /// <summary> /// bind ischecked of "controlchkenable" element (twoway) /// , bind isenabled of each of other 7 checkbox's (oneway) /// </summary> public bool controlchkenable { { return _controlchkenable; } set { if (value == _controlchkenable) return; _controlchkenable = value; // before informing checkboxes disabled, // pass values ...

Open a new JavaFX window on a second monitor -

i trying open new window javafx application , set coordinates be inside application doing following: secondstage.setx(application.getprimarystage().getx() + application.getprimarystage().getwidth()/3); secondstage.sety(application.getprimarystage().gety() + application.getprimarystage().getheight()/3); it works fine when primary stage on first monitor. when on second monitor, new application opens right left border of second monitor, not inside app. if x coordinate gets rounded 0 respect second monitor when exceeds primary screen's x bounds. please let me know how can have same functionality/behavior on second monitor on primary 1 using same logic described code.

osx - dnsmasq & multiple addresses -

i'm using dnsmasq local development environment want use multiple tlds, dnsmasq.conf file looks this address=/.dev/127.0.0.1 & apache http-vhosts.conf looks this <virtualhost *:80> usecanonicalname off virtualdocumentroot "/users/<username>/sites/dev/%1" serveralias *.gabri logformat "%v %h %l %u %t \"%r\" %s %b" vcommon errorlog "/users/<username>/sites/dev/vhosts-error_log" </virtualhost> and configuration works, create new folder called 'client' example can access client.dev. now want add tld let's .test how can done? guess in apache it's same replacing dev test, dnsmasq? in dnsmasq.conf add: address=/.test/127.0.0.1 in http-vhosts.conf add: <virtualhost *:80> usecanonicalname off virtualdocumentroot "/users/<username>/sites/test/%1" serveralias *.test </virtualhost> create file "/etc/resolvers/test" content: n...

My current testcases are not working with new selenium 2.34.0 and php (edit added code and log file from selenium) -

i using selenium 2.34.0 + phpunit , cant recognize "code". using $this->url('blqblq') , error cant recognize command url. have same problem? when "revert" 2.33 tests working flawlessly :). phpunit version 3.7.21 , phpunit_selenium latest 1.3.1. thank you. "code" <?php //require_once 'setupfile.php'; class testtestest extends phpunit_extensions_selenium2testcase //extends setupfile { public function setup() { $this->setbrowser('firefox'); $this->setbrowserurl('http://www.stackoverflow.com'); } public function testexample() { $this->url('http://www.stackoverflow.com'); $this->assertequals('example www page', $this->title()); } } ?> my debug log file selenium 2.34.0 located here -> http://fikata.ivo.so/test234.txt edit 2 :) i went responce.php in phpunit_selenium...

Cassandra CQL3 Import CSV -

background: i have created schema called availabledomains (simple strategy, 1 node). in keyspace have created 1 table/ column family called domains columns (id, urn, timestamp, flag). of type text except timestamp type timestamp. i startup cassandra, launch cqlsh -3, use availabledomains, and issue following command pull in csv: copy domains (id, urn, timestamp, flag) 'test.csv' header= true; i error saying: improper copy command question: doing wrong? details: csv- id,url,timestamp,flag 1,google.com,1375891081,1 2,facebook.com,1375891081,1 3,youtube.com,1375891081,1 4,yahoo.com,1375891081,1 5,baidu.com,1375891081,1 6,wikipedia.org,1375891081,1 7,amazon.com,1375891081,1 8,qq.com,1375891081,1 9,live.com,1375891081,1 10,linkedin.com,1375891081,1 location of csv in cassandra/bin (same dir cqlsh located). os: centos 6.4 64bit this fixed me cql 3: copy domains 'test.csv' header = true ; the reason using header = true first line ...

asp.net - How css menu list can be genrated for a repeater with in repeater bounded by database? -

Image
i want menu list this even more beautiful currently have coded bind repeater database , fetch menu it <div id="main" class="shell"> <!-- sidebar --> <div id="sidebar"> <ul class="categories" id="categoryheader"> <li id="categoryitem"> <h4>categories</h4> <ul class="categories" id="categorylist"> <asp:repeater id="repcategories" runat="server" onitemdatabound="itembound"> <headertemplate> <ul> </headertemplate> <itemtemplate> <li> <asp:hyperlink id="hypercategories" runat="server"><%#eval("categoryname")%></asp:hyperlink> ...

c# - semi complex string replace? -

i have text 'random text', 'a\nb\\c\'d\\', 'ok' i want become 'random text', 'a\nb\c''d\', 'ok' the issue escaping. instead of escaping \ escape ' '' . 3rd party program can't change needing change 1 escaping method another. the issue \\' . if string replace become \'' rather \' . \n not newline actual text \n shouldn't modified. tried using regex couldn't think of way if ' replace '' else if \\ replace \ . doing in 2 step creates problem. how replace string properly? if understand question correctly, issue lies in replacing \\ \ , can cause another replacement if occurs right before ' . 1 technique replace intermediary string first you're sure not occur anywhere else, replace after you're done. var str = @"'random text', 'a\nb\\c\'d\\', 'ok'"; str.replace(@"\\", "non_occurri...

for loop - Java ":" operator in a For expression -

i ran across interesting use of ":" operator while writing unit tests else's code. looks this: for(class classinstance : instanceofotherclass){ //do irrelevant stuff } i have never seen ":" operator used without "?", when writing ternary statement. i've done fair amount of googling, , can't seem find sensible answers regarding how should read this... am over-complicating this? has seen before? for future reference, had typed: java 7 loop : into google, second result have helped you. defense, if don't put "7" there, have been more difficult find solution (not because introduced in java 7, in java 5, because if it's supported, putting 7 gives higher probability of finding up-to-date documentation). example of enhanced loop or for-each loop . in short: enhancedforstatement: for ( formalparameter : expression ) statement where expression must iterable or array type. in simpler te...

r - extracting from dataset based on value -

i bit of newbie in r. if have dataset , extract based on value in dataset: data<- read.csv(...) data name date id 1 2 3 4 if filter data based on value in date date = "05/31/2000". how do this? data[data$date == as.date("05/31/2000"),] , assuming data$date date .

c - gcc wont find sqrt even with -lm parameter -

this question has answer here: c math linker problems on ubuntu 11.10 5 answers why getting “undefined reference sqrt” error though include math.h header? 6 answers i using sqrt in .c file , including math.h this. when compiling -lm flag still prompts me "undefined reference `sqrt'" how supposed solved?

How to create reusable AngularJs directives that copy existing directives -

i in process of creating few reusable directives common controls in our application. for example have snip-it of html amount text boxes <div class='amount'> <input type='text' ng-model='dollars'/> </div> from there started create directive: app.directive("amount", function(){ return { restrict: "e", template: "<div class='amount'><input type='text'/></div>", replace: true } }); which renders following <html/> <div class="amount ng-pristine ng-valid" ng-model="dollars"> <input type="text"> </div> now ng-model on <div/> not want, need create scope , attach ngmodel , things happy again. app.directive("amount", function(){ return { restrict: "e", scope:{ ngmodel: "=" }, template: "...

jquery - jqgrid - populate dropdown values for filtering -

Image
i wish populate dropdown filters in jqgrid. as can see want action status populate values come other database table or other json. can 1 pls? i got working using filtertoolbar jqgrid .

ios - Managing multiple ViewConrollers -

i having view next buttons ( example) "new game" , "share friends" , want if user clicks on "new game" running "newgameviewcontroller",and when clicks "share" shareviewcontroller running. 've read docs on developer.apple (tabbar , navbar) didn't find solution newgameviewcontroller *ngvc = [[newgameviewcontroller alloc] initwithnibname:@"somenib" bundle:nil]; [self.navigationcontroller pushviewcontroller:ngvc animated:yes]; same thing in principle other one.

Symfony: one entity class with multiple instances each with its own form all on one page -

Image
use case: a user makes public and/or private notes expertise record. these notes displayed in sidebar of page shows expertise record. notes grouped 2 sets: current user's notes (both public , private) , public notes other users. current user's notes editable , deletable. each delete icon link route. each edit icon javascript toggle display form particular note (the edit form looks add form except it's populated). 1 note should added/edited or deleted per submit action. submission not through ajax. page looks this: problem how can display , process independent form both 'new note' , each of notes in 'my notes' section? if embed collection of notetype forms in expertisetype form, processing correct cannot seem group forms 'add note', 'my notes' , 'public notes' sections. , worse, public notes editable. i've abandoned approach since there not easy way filter notes have forms. if subset notes in controller , create f...