Posts

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

html - Difference between button and input? -

possible duplicate: <button> vs. <input type=“button” />. use? are there major differences between <button type="button" name="thebutton">submit</button> , <input type="submit" value="submit" name="thebutton" /> also, can use <button type="submit" name="thebutton">submit</button> ? here's page describing differences (basically can put html <button></button> and other page describing why people avoid <button></button> (hint: ie6) reference: <button> vs. <input type="button" />. use? also have @ slideshow button .

architecture - WCF service, how to mapp the objects runtime -

i have design wcf service gives outut in standard model(which think better give string/xml).but standard model is/may subjected change format.so every time changed need change code.my service should accomadte same configurable change. how without code change , exernal configurable entities. is there way create , mapp class in runtime. my primary idea keep format internally , xml standard format , mapp class properties , xml nodes using database table. please suggest ....appreciate gurus !!! thanks in advance i don't understand question, perhaps elaborate upon it, perhaps simplified code? however, if need map between xml formats, have considered xsl transform?

alarm - how to automatically invoke my application in android -

i want automatically invoke application @ 12.00 am,this kind of process ,how implement in android,is possible? look @ alarmmanager . here example: intent myintent = new intent(getapplicationcontext(), youractivity.class); pendingintent pendingintent = pendingintent.getactivity(getapplicationcontext(), 1, myintent, pendingintent.flag_update_current); alarmmanager alarmmanager = (alarmmanager)getsystemservice(alarm_service); alarmmanager.set(alarmmanager.rtc_wakeup, time, pendingintent);

javascript - Problem in loading a document in the same page using href="" in Jquery-mobile -

i have list view. in which, every list item document(.pdf, .xls , .doc etc.). after clicking list item, need open document in same page. used anchor tag without target="_blank". not working. using target attribute, works fine , opens in new tab. need in same tab. here code used. $('div').live('pageshow',function(event, ui){ var parent = document.getelementbyid('listview'); var listitem = document.createelement('li'); listitem.setattribute('id','listitem'); listitem.innerhtml = "<a href='testdoc.doc' >my word document</a>"; parent.appendchild(listitem); var listitem = document.createelement('li'); listitem.setattribute('id','listitem'); listitem.innerhtml = "<a href='contacts.pdf' >my pdf document</a>"; parent.appendchild(listitem); ...

c++ - How to exchange data between classes? -

i'm learning c++ , moving project c c++. in process, stumbled on problem: how save/update variables in use in several classes? in c used global variables, not c++. so, let's assume have 4 classes: class main_window { //... void load_data_menu_selected(); } class data { //... double *data; } class load_data { //... double *get_filename_and_load(); } class calculate { //... int do_calculation() } so, main_window class application's main window interacts user input etc. want do: create instance of class data in main_window use load_data loading data file , store in data use calculation class doing read data in data class the question is: should create classes, make data class members available other classes. should use inheritance? start observing possible relations between instances of 2 classes. let a instance of class , b instance of class b. if a uses b , class can have member instance of class b ( b ), pointer...

Vim and snipMate (plugin) - adding new snippet won't work -

i trying create new snippet snipmate plugin. i work files called (i.e.) myfile.endfile all .endfile files should have same "snippet" .html files. did cp html.snippet endfile.snippet in ~/.vim/snippets directory. snipmate working present snippets, not new created one. suggestions problem? (btw: after creating new .snippet file, ran :helptags ~/.vim/doc command in vim instance.) it because snipmate works filetype , vim option set when opening file of particular type. for exemple, if opening, "index.html" filetype automatically set html . to see how works, : :e $vimruntime/filetype.vim as preliminary test, can : 1. open test.endfile 2. type :set ft=endfile or :set filetype=endfile 3. check if defined snippets work to automatically add following in .vimrc : au bufnewfile,bufread *.endfile set filetype=endfile it means every time read or create new file ending in endfile the filetype option set endfile. (the filetype arbit...

javascript - jquery: event for when ajax loaded content is all loaded (including images) -

i'm loading in html via ajax, need event catch on when new images loaded... becuase it's in div , not whole page, can't use $(window).load(.... i've tried following doesn't work: $('.banners_col img:last').load(function(){..... you need target results of ajax call before inserting them in dom. so need use callback method provided jquery reason. $('#load').click(function(){ // inside handler calls ajax //you ajax call here $.get('the_url_to_fetch',function(data){ // create in-memory dom element, , insert ajax results var $live = $('<div>').html(data); // apply load method images in ajax results $('img',$live).load(function(){ // each image loaded }); // add ajax results in dom $('selector_where_to_put_the_response').html($live.children()); }); }); example @ http://www.jsfiddle.net/gaby/sj7y2/ if the...

Run a AJAX query which uses PHP code that limits queries/sec on client side? -

i have php code, uses web service query data. however, web service limits queries per second based on server (i m not sure exact mechanism, seems ip address) i m using ajax query data php file on server, there way can let client search data faking requesting data rather servers? the issue getting rateexceeded error message server, 2 clients requesting same page, rather obvious since webservice seeing 1 server, server. so, can somehow, make happen when these clients query data, service rather thinking request being originated via these clients, rather server. you can't fake it, if query webservice directly via ajax, should seeing clients' ip addresses. note if you're doing kind of processing on data ws returns, you'd have perform in javascript, on client side. if request server ws contains confidential data (e.g. kind of access key) clients must not see, approach useless.

WEBKIT: The following environment variables were not found: 1>$(PRODUCTION) -

i had problem in building webkit. pasting same here. 1>------ rebuild started: project: winlauncher, configuration: debug win32 ------ 1>deleting intermediate , output files project 'winlauncher', configuration 'debug|win32' 1>performing pre-build event... 1>/usr/bin/bash **1>project : error prj0002 : error result 1 returned 'c:\windows\system32\cmd.exe'. 1>project : warning prj0018 : following environment variables not found: 1>$(production)** 1>build log saved @ "file://d:\webkit_build\dolfin\shp\shpbrowser\dolfin\engine\webkit\webkitbuild\obj\winlauncher\debug\buildlog.htm" 1>winlauncher - 1 error(s), 0 warning(s) ========== rebuild all: 0 succeeded, 1 failed, 0 skipped ========== please me solve issue. thank you! it not important. had similar problems , solved don't remember how can check following resource, may help: http://siphon9.net/loune/2009/07/compiling-webkitcairo-on-windows-with-visual-c-e...

android - How to show a "are u sure YES OR NOT" dialog when user press a button? -

first of all, have tell have searched here , on google , can't find easy way (im newbie on this), need please i have button, removes friend remote database: removebutton.setonclicklistener(new onclicklistener() { public void onclick(view v) { con.deletepermission(settings.getstring("login",""),bundle.getstring("email")); finish(); toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show(); } }); i want show simple "are sure? yes or not" dialog 2 buttons (yes , not) , when user press yes, have called code: con.deletepermission(settings.getstring("login",""),bundle.getstring("email")); finish(); toast.maketext(getapplicationcontext(), getstring(r.string.friendsuccessfullyremoved), toast.length_long).show(); exist's easy way i...

asp.net - How do I reference the databound control from an ObjectDataSource event? -

take example detailsview control objectdatasource datasource. normally in detailsview.itemupdated event grab reference details view casting sender : detailsview dv = (detailsview)sender; in situations becomes necessary handle event inside objectdatasource.itemupdated event. in case sender of type objectdatasource . want able write clean code isnt hardcoded like label label1 = detailsview1.findcontrol("label1"); i looked on documentation , did searches couldnt find how write code following: protected void objectdatasource1_inserted(object sender, objectdatasourcestatuseventargs e) { objectdatasource ods = (objectdatasource)sender; detailsview dv = (detailsview)ods.something_here; } does know should putting in something_here in snippet above? that's happen because "oninserted" event suppose event examine values of return value or output parameters, or determine whether exception thrown after insert operation has completed. re...

javascript - returning with && -

what mean return value &&? else if (document.defaultview && document.defaultview.getcomputedstyle) { // uses traditional ' text-align' style of rule writing, // instead of textalign name = name.replace(/([a-z]) /g, " -$1" ); name = name.tolowercase(); // style object , value of property (if exists) var s = document.defaultview.getcomputedstyle(elem, " ") ; return s && s.getpropertyvalue(name) ; return && b means "return if falsy, return b if truthy". it equivalent to if (a) return b; else return a;

SEO Optimalization performance , which method ? (ASP.NET Routing) -

i'm trying figure out type of seo use site. i'm using asp.net routing (webforms) sql 2005 database. i want show urls like: http://www.domain.com/article-category/article-title-of-current-page this means need query category , article it's title (well, systemtitle column). systemtitles columns indexed varchar(255) column. does have done similar way , if so, did u notice performance decrease using method? can opt-in /2-article-category/243-article-title-of-current-page , query id hoping avoid urls clean. i've read things topic before , performance impact little when columns indexed while others make huge impact. it's not important if site grows should not suffer it. any tips/advice welcome. thank time. kind regards, mark i dont think somthing worry about, query on "where title = 'abc'" wont hugley differant query on 'where id = x' however, i'd advise not using may hinder performance. check out. sql select s...

svn - Eclipse incoming synchronization view shows incoming new files as folders -

i hope okay ask strange behaviour/bugs in eclipse here. when use eclipse synchronize view subclipse, used see incoming files other developers nicely blue arrows pointing left. double click perfect open compare editor , review changes. for time now, whenever colleague adds new file shows incoming new folder in synchronize view! if update it, need restart eclipse have folder disappear sync view (or sync different folder , sync root again). double click open compare editor broken (it's nice see new file, though left side of compare editor empty, not matter me) does know why happens? tried kinds of preference settings , not find on google. think use granny made or whatever call it, can't find sane version number anywhere. thanks!

.net 3.5 - double.IsNan is not defined? (upgrade from 1.9.7.8 -> 2.0) -

trying out vs 2010, still want target .net 3.5. have c# projects set with: <propertygroup> <langversion>3</langversion> </propertygroup> and seems working fine. f# acting funny though.. can't use double.isnan method. let foo = double.isnan(bar) field, constructor, or member 'isnan' not defined. similarly, string.format broke too: the field, constructor, or member 'format' not defined. i must missing here. explicitly stated "open system" , capitalized double (double). not sure why fine before..

box2d - What is the most performant 2D graphics engine for use with Android? -

i have managed make hello world jbox2d application, , works (i have bouncing balls). however, read comment on forum post , claims jbox2d produces lot of garbage, , causes animation poor. true? if yes, other 2d engines available me? use physics engine 2d game, if it's simple one. update: just tried running jbox2d bouncing balls demo on phone, , performance terrible. looks libgdx way go physics, since think comes native version of box2d works on android. andengine , game engine , not physics engine, may use in conjunction libgdx give myself head start. update 2: i've had quick play libgdx , andengine. i've found they're both android game engines, andengine has less steep learing curve @ cost of being more limiting. if want build serious game, want use libgdx allow more (but harder use). jbox2d port native version called box2d. native version didn't need worry garbage collection written language used manual memory management (c++ think). the...

javascript - Validating an input field if a certain radio button is checked -

i have form multiple question each asking radio button selection of pass, fail or n/a. want achieve if user selects fail of questions , try submit turn on validation 3 text fields. the user must complete 3 text input fields if select fail on question , can't submit unless so. also have validation on questions ensure user selects radio button each field solution must able work now. example of form is <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>form</title> <script> function valbutton(thisform) { // question 1 myoption = -1; (i=thisform.questionone_one.length-1; > -1; i--) { if (thisform.questionone[i].checked) { myoption = i; = -1; } } if (m...

design - why android is built on a VM (Dalvik) -

i curious know made google choose develop android's framework on java vm. in process of writing code android 6 months now, observed running code on vm in resource limited platform slow. there lot of overhead involved. know java portable etc etc, not possible @ use native languages , both performance , features offered vm ? performance oriented applications 1 still ends writing native code , wrap jni, so why did google choose particular stack : arm based core (understandable, arm best mobile devices) linux (open source) java vm (my question) edit : know java - jvm run's on par c++ applications on server, not on android. respect android not case - matter of experience, c++ code wrapped jni runs far faster java code (note have checked exact same code static block in java) agree answer on other platform. the dalvik vm uses own bytecode, not java bytecode. it's designed fast (relatively speaking). think "vm" part of title bit of red herring, pe...

EXTJS OnClick Tab Event -

is there way attach onclick event tab switch in extjs? i make grid this: var simple = new ext.formpanel({ labelwidth: '100%', border:false, width: '100%', style: { height: '291px' }, items: { xtype: 'tabpanel', activetab: 0, //labelwidth: 75, // label settings here cascade unless overridden items:[{ url:'save-form.php', title: 'tab 1', ... thanks! i added in listener after tabs defined this: //define tabs, , after ] tab panel json: listeners: { 'tabchange': function(tabpanel, tab) { alert("tab changed"); } } this alerts when tab changed, sufficient purposes. i'm not sure though how find out tab current tab. hope helps in future.