Posts

Showing posts from March, 2011

c# - Using Page.ClientScript.RegisterClientScriptBlock not working -

i trying fire pop shown below, not working. please help public void btnsubmit_click(object o, eventargs e) { if (checkfileexists(convert.tostring(fileinfo))) { page.clientscript.registerclientscriptblock(this.gettype(), "msg", "<script type=\"text/javascript\" language=\"javascript\">function showmsg(){return confirm(\"this image name exists, want replace it?\");}</script>", true); btnsubmit.onclientclick = "return showmsg()"; } if (something else) { // whatever here never pops question above } } and on button have <asp:button class="button" id="btnsubmit" causesvalidation="true" text="submit" runat="server" onclick="btnsubmit_click"></asp:button> the last parameter you're sending registerclientscriptblock true , tells method wrap script in <script> bl...

windows - Getting started with Clojure -

i'm relatively new person programming, i've read first half of sicp until thoroughly ingrained every cell in body, took class implementing basic data structures in java, , made programs in mathematica. far knowledge goes, problem. i'm trying play clojure via netbeans/enclojure and, honest, don't know how beyond constructing functions , manipulating data structures in repl. for example, want use incanter statistics stuff, don't know how install since have never used terminal (i'm using windows vista), , don't know begin. when search google, tutorials seem assume knowledge unix, or assume knowledge of how emacs works, etc. i suppose looking online tutorial covers basics of how set programming environment doesn't assume previous knowledge. thanks, bryan i'm relatively new programming well. suggestion unix or linux easier environments program in. know said don't have experience it, can pick basic commands in afternoon. learnin...

android - problem placing Button/ListView under relative layout in layout XML -

the following layout xml working on. supposed display , edit field , buttons @ top of display listview filling rest. items embedded in relativelayout show up. items below not display. i'm not sure doing wrong in layout xml. <?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" > <relativelayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10px"> <textview android:id="@+id/tidname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="enter name:" /> ...

date - Force Android DateUtils.getRelativeDateTimeString() to ignore the device locale? -

i've found using android.text.format.dateutils relative apis return values "yesterday" or "2 hours ago" nice - app not support every language android does. so, default english, every language don't support, relative string shows in device's setting. for example, like: last attempt: hace 11 minutos. i'd make api call default english languages don't support. however, don't see anywhere set locale api call - i'm hoping i'm missing somewhere. is there way set locale api call, ignoring device setting? according source code of dateutils class uses both resource.getsystem() , locale.getdefault() method formatting date , time. can change default locale using locale.setdefault() method don't think it's possible change return value of resource.getsystem() method. can try change default locale locale.us seems me results worse in case.

sql query - pulling 2 rows -

possible duplicate: sql - query between 2 rows sorry, having hard time modifying previous question. , think might have formed question incorrectly...again new @ this. i'm doing select need grab 2 rows. have value of 13000.00000 (range). need grab both rows 2 , 3 since falls between 10000 (min range) , 15000 (min range) this statement pulls in row 2. select * table1 13000 ?? range; table1 row range return_value 1 0.00000 1.15 2 10000.00000 1.25 3 15000.00000 1.35 4 20000.00000 1.14 thanks! it seems need both of following return row corresponds range greatest value less input range return row corresponds range smallest value more input range. select * table1 range = (select max(range) table1 subt1 subt1.range < 13000) or range = (select min(range) table1 subt1 subt1.range > 13000)

nsstring - self.string not retaining causing memory leaks iphone -

i have few dates , strings declared nonatomic , retained. when set date or change string using self.string isn't being retained. if force [string retain] have no issues, although creates memory leaks. any ideas or how or i'm doing wrong? cheers update: @property (nonatomic, retain)nsdate *time; self.time = [cal datefromcomponents:comps]; self.time doesn't retain. have [time retain]; you either releasing string twice or accessing after has been released. if post code, determine what's going on if that's not enough go by.

backbone.js - Binding a model to a backbone client template -

i have following backbone.js client side template: <script id="calleetemplate" type="text/x-jquery-tmpl"> <tr style="background-color: ${statuscolour}"> <td class="responder">${contactfullname}</td> <td class="status" style="width:200px">${status}</td> <td class="replied">${replied}</td> <td class="wauto">${response}</td> </tr> </script> in order able bind these properties, have following render method of view: app.views.callees = backbone.view.extend({ initialize: function () { }, el: $('#calleesstatuses'), render: function () { var col = _.map(this.collection.models, function (item) { return item.attributes; }); $('#calleesstatuses').html(''); $('#calleetemplate').tmpl(col).appendto(this.el); } }); i have extract attributes using underscore...

php - Get all posts from a user with their category's -

the situation i'm working on blog-system , i'm stuck @ trying posts category's made particular user. the query shows first post in database, no madder how many posts user has. also, generated category-output wrong. database here sql-commands create 3 required tables. post create table post( headline varchar(100), date datetime, content text, author int unsigned, public tinyint, type int, id serial, primary key (id), )engine=innodb default charset=utf8 collate=utf8_unicode_ci; author id of user created post, public determines if post can read or draft , type determines if it's blog-post ( 0 ) or else. category create table kategorie( name varchar(30), short varchar(200), id serial, primary key (name) )engine=innodb default charset=utf8 collate=utf8_unicode_ci; post_kategorie create table post_kategorie( post_id bigint unsigned, kategorie_id bigint unsigned, primary key (post_id, kate...

java - how to cmpare the values of Arraylists -

how can compare values of 2 array lists example : arraylist = new arraylist<string>(); a.add("1"); a.add("2"); a.add("3"); arraylist b = new arraylist<string>(); b.add("3"); b.add("2"); b.add("1"); system.out.println(areequal(a, b)); should print true , because values of in b. thanks in advance if ( a.containsall(b) && (a.size() == b.size() ) ) edit: if contains more elements b, containsall still return true , if want test absolute equality, size comparison necessary. edit #2: assumes , b contains unique entries. if there duplicates, @robin , @matti have referred to, more complicated depending on ops definition of equality.

java - Sqlite Syntax Error -

i error: 06-30 12:26:28.987: error/androidruntime(14818): caused by: android.database.sqlite.sqliteexception: near "when": syntax error: create table htable (id integer primary key, text, message text, when text) really confused host. sat staring @ 15 minutes. when reserved keyword. you'll need change column name or escape it. see: http://www.sqlite.org/lang_keywords.html

How to retrieve a subset of fields using the C# MongoDB driver? -

i've searched world on , can't seem find answer this. how do in c#: // retrieve ssn field documents last_name == 'smith': db.users.find({last_name: 'smith'}, {'ssn': 1}); thanks! note can use (type/refactoring)-safe version: userscollection.findallas<user>() .setfields(fields<user>.include(user => user.firstname, user => user.lastname) .exclude(user => user.ssn) .toarray();

using linux raw socket with vconfig interface -

i want use socket transmit packet untouched tried using raw socket this. static int raw_sock = 0; static struct sockaddr_ll saddr; static struct ifreq ifr; static int ifindex; raw_sock = socket(pf_packet, sock_raw, htons(eth_p_all)); memset(&ifr,0,sizeof(ifr)); memset(&saddr,0,sizeof(saddr)); strcpy(ifr.ifr_name,"eth0"); ioctl(raw_sock,siocgifindex,&ifr); ifindex = ifr.ifr_ifindex; saddr.sll_family = af_packet; saddr.sll_ifindex = ifindex; saddr.sll_protocol = eth_p_all; sendto(raw_sock,pkt.buffer,pkt.pkt_len,0,(struct sockaddr *)&saddr,sizeof(saddr)); everything work correctly want after added vlan interface using vconfig add eth0 4000 the above code not work before. automatically add vlan tag 0x81 0x00 0x00 0x00 packet transmitted out. has solution this. want send packet untouched. thank you. try sending vlan0 , instead of eth0 .

JQuery Validation Plugin Question -

i have seen several other posts similar questions nothing need do. need have 3 checkboxes same name different id's. when checkbox 1 clicked either 2 or 3 (either one) required. if first checkbox not clicked none required. closest example of saw not 100% there: jquery validation rules any appreciated. i found answer. extremely on thinking this. @ least 2 supposed required simple statement needed: { required: true, minlength:2 } which found here: jquery validate plugin minimum of 2 elements single array name and added message: messages: { fieldname: { required:"must select @ least 2 of 3 below options", minlength: jquery.format("must select @ least 2 of 3 below options") }

python - Solution to storing 300MB in memory for Google App Engine -

i using google app engine in python. have 5000 people in database. entire list of 5000 people objects takes 300 mb of memory. i have been trying store in memory using blobcache, module written [here][1]. i running pickle "outofmemory" issues, , looking solution involves storing these 5000 objects database, , retrieving them @ once. my person model looks this. class persondb(db.model): serialized = db.blobproperty() pid = db.stringproperty() each person object has many attributes , methods associated it, decided pickle each person object , store serialized field. pid allows me query person id. person looks this class person(): def __init__(self, sex, mrn, age): self.sex = sex; self.age = age; #exact age self.record_number = mrn; self.locations = []; def makeagegroup(self, agestr): ageg = agestr return int(ageg) def addlocation(self, healthdistrict): self.locations.append(healthdistrict) ...

server side - Using http.request in Node.JS while passing an API key -

i fiddling around node.js try create package postageapp able send emails through our api. to start, using following code test out how node.js can best interface our api, doesn't seem want pass along api key have attached part of headers. var http = require('http'); function onrequest(request, response) { response.end(); } http.createserver(onrequest).listen(8888); console.log("server has started."); var options = { host: 'api.postageapp.com', path: '/v.1.0/get_account_info.json', method: 'post', headers: { "api_key" : "my api key here" } }; var req = http.request(options, function(res) { console.log('status: ' + res.statuscode); res.setencoding('utf8'); res.on('data', function (chunk) { console.log('body: ' + chunk); }); }); req.end(); console.log("request sent!"); i pulled using various examples , not - it's not pretty...

sql server - SQL Design - How to store large amount of URLs -

i'm writing application have sql server backend store (among other things) urls. urls mapped users, , urls may common between different users. in absence of true dba, i'm trying design solution can handle hundreds of thousands of urls efficiently possible. ideas: create table has id, url pro: simple, complete. con: duplicate entries url exist cause table larger needs be. break user , urls separate tables. 1 table containing user id , , url id . table url id , url itself. pro: single url in system, seems more "enterprisey" con: must join 2 tables when trying pull results, , not sure benefit of approach is? expand on 2 idea, except break up. have table domain, path/query string. then, user table have userid, domain id, path id . pro: urls share data if unrelated (meaning, cnn.com/helloworld , nbc.com/helloworld have different domain ids, same path ids.. seems useful when running metrics later? con: seems nightmare performance perspective ...

c# - Get an item from a IGrouping based on the highest date -

in ienumerable<appointment> contains appointments defined as: class appointment { public string name { get; set; } public datetime lastmodified { get; set; } public bool iscancelled { get; set; } } which in practice can like: "jon s" | 25-02-2011 16:14:40 | true "jon s" | 25-04-2011 22:15:44 | false "marc g" | 15-11-2011 16:09:00 | true "marc g" | 21-12-2011 16:11:00 | false "marc g" | 20-12-2011 16:24:00 | true "eric l" | 13-06-2011 19:10:00 | false "reed c" | 13-04-2011 09:10:00 | true "reed c" | 13-06-2011 19:10:00 | false "john g" | 04-01-2011 06:12:00 | true "jon s" | 25-03-2011 12:24:42 | true this collection has downsized collection contains the appointments highest date lastmodified of each distinct name . "jon s" | 25-04-2011 22:15:44 | false "marc g" | 21-12-2011 16:11:00 | false "eric l" | 13-06-2011 19:10:00 | false ...

Download an entire SQL Azure database as single file -

is there facility in azure copy of database? or rather, detach mdf , file? on occasion create database in cloud, it's while, , want take down , archive it. current rutine copies database using sql azure migration wizard local express instance, detach , put in safe place. edit interestingly method of choice throws exception time around. it's far ideal. there way it: "c:\program files (x86)\microsoft sql server\110\dac\bin\sqlpackage.exe" /action:export /sourceservername:"tcp:xxxxx.database.windows.net,1433" /sourcedatabasename:dbname /sourceuser:user /sourcepassword:password /targetfile:c:\backups\backup.bacpac

database - SSIS - Source Error Output (No rows will be sent to error output(s)....) -

Image
i'm newbie in ssis... i'm exporting data dbsource , outputing errors flat file. now, when connect red arrow flat destination i'm receiving warning db source "no rows sent error output(s). configure error or truncation dispositions redirect rows error output(s), or delete data flow transformations or destinations attached error output(s)." does know means? how can rid of that? by default, ssis "fail component" on error or truncation issue. must tell ssis not want fail package, want "redirect row" allow flow continue down red arrow. edit source go error output tab set relevant columns want trigger error row redirect redirect output below. this should remove warning message getting

Git clone failed while unpacking - lack of space - how to recover without a full clone? -

i cloned repo git yesterday , ran out of space on vms hdd. i've since moved repo , have enough space. git clone ran out of space during unpacking downloaded objects. thing is, git thinks it's date, git status lists pages of deleted files. git pull doesn't work thinks it's date. can don't have clone entire repository again? try: git reset --hard head this should update working copy.

How to set the value of a check box dynamically in jsp (values are coming from database) -

sir have jsp file in have display notes there date , description since there can more 1 note(as in scheduler) particular date more 1 notes displayed @ time. want user can modify particular notes in database checking them of check boxes. values of note coming dynamically data base how can set value check box. fetchcontent.java public class cnmsdes extends httpservlet{ public void dopost.......{list list=new arraylist(); response.setcontenttype("text/html"); printwriter out = response.getwriter(); system.out.println("oracle connect example."); connection conn = null; string url = "jdbc:oracle:thin:@localhost:1521:xe"; string driver = "oracle.jdbc.driver.oracledriver"; string username = "system"; string password = "mint"; statement st; try { class.forname(driver).newinstance(); conn = drivermanager.getconnection(ur...

javascript - How can i know which class was selected via jQuery & JS -

i have list links: <li class="link-1"><a href="#">one</a></li> <li class="link-2"><a href="#">two</a></li> <li class="link-3"><a href="#">three</a></li> .. user clicks on link, jquery want display content of link.. somthing like: $(".link-??? a").click(function() { alert($(".link-??? a").html()); }) something this. not going create x function (as number of links), can do? should replace ??? in somtehing else.. you could do: $('li[class^="link"] a').click(... however work if li have 1 class or if link-x class first in list. inside handler can use $(this) refer a element: alert($(this).text()); much better give li elements common class: <li class="link"><a href="#">one</a></li> <li class="link"><a href="#...

configuration - WCF bindingConfiguration Issue -

i'm getting maxstringcount exceeded error, , have read ton on fixing issue (that is, if you're using http bindings). problem me, i'm using nettcpbinding. have no idea put in bindingconfiguration.. here's app.config: <services> <service behaviorconfiguration="exstreamwcf.service1behavior" name="exstreamwcf.service1"> <endpoint address="" binding="nettcpbinding" bindingconfiguration="" contract="exstreamwcf.iservice1"> <identity> <dns value="devexstream-2.anchorgeneral.local" /> <!--<dns value="vmwin2k3sta-tn2" />--> </identity> </endpoint> <endpoint address="mex" binding="mextcpbinding" bindingconfiguration="" contract="imetadataexchange" /> <host> <baseaddresses> <add baseaddress="net.tcp://...

<input type=file>, jwplayer, javascript question -

i display file open box user can select file on computer: <input type="file" id="upload_input"/> but when file user chose in javascript (see code below), believe 'safe' since javascript executes on client side -- file, not full path -- despite fact full path , filename appear in field next 'browse' button input type=file gives you. in other words user selects file located on machine example @ c:/afolder/thefile.rtf. after choosing file full path appears in field next 'browse' button: c:/afolder/thefile.rtf yet when programmatically retrieve value of field, entire path stripped off , have filename: filename = document.getelementbyid('upload_input').value; alert("the selected file name " + filename); why input type=file control bother show user full path if can't programmatically? it's happening on client side after all, it's not full path on server. one other question: use filename ab...

Implement UIPickerview on Mobile Safari via HTML -

is there way create effects similar uipickerview on iphone mobile safari via html/javascript/css? <select id="mypicker" name="mypicker"> <option value="" default selected">pick value</option> <option value="pick1">pick 1</option> <option value="pick1">pick 2</option> </select>

javascript - Facebook Page Array to Select Box -

i grabbing facebook pages user admins , displaying them in select box through facebook js sdk. what's best way take array facebook response.data , iterate goes select ? <div id="fb-root"></div> <script src="http://connect.facebook.net/en_us/all.js"> </script> <script> fb.init({ appid:'119406238144386', cookie:true, status:true, xfbml:true }); fb.api('/me/accounts/', function(response) { alert(response.data); }); </script> <select id="pages"></select> <fb:login-button perms="manage_pages">connect facebook</fb:login-button> facebook returns object in object array, loop through each 1 , add new html object item select list. a full working example without jquery: <!doctype html> <html> <body> <div id="fb-root"></div> <a href="#" onclick="getpage...

ios - What happens to JavaScript execution (settimeout, etc.) when iPhone/Android goes to sleep? -

i have jquery mobile web app targets ios , android devices. component of application background task, periodically checks a.) changes local data , b.) connectivity server. if both true, task pushes changes. i'm using simple settimeout()-based function execute task. each failure or success condition calls settimeout() on background task, ensuring runs on 30 second intervals. update status div timestamp of last task runtime debugging purposes. in desktop browser, works fine; however, on ios or android, after period of time, task stops executing. i'm wondering if related power conservation settings of devices--when ios enters stand-by, terminate javascript execution? appears happen. if so, best way resume? there on-wake event can hook into? if not, other options there don't involve hooking events dependent on user interaction (i don't want bind entire page click event restart background task). looks javascript execution paused on mobilesafari when browse...

function - how to stop and reset slides.jquery.js -

edit 4 july: still struggling issue. i'm sure that's required function stops slideshow based on class 'playing', uncertain how create function. i'm using slides.js on single-page site multiple slideshows. had initialised script within head using following: <script> $(function(){ $(".slides").slides({ play: 3000, fadespeed: 800, effect: 'fade' }); </script> but found multiple slideshows behaving oddly, decided have them play individually , initialised within function (that controls site content) this: activeid = this.id, function playslides() { $('.slides#' + activeid + '-slides').addclass('playing').slides({ play: 3000, fadespeed: 800, effect: 'fade' }); } this working correctly first time each slideshow intialised, on viewing slideshow second time after that, images within slideshow seem disappear , twice pagination numbers appear. i'm sure ...

c++ - Why do you have to link libraries AND set include directories -

hey i'm little confused on why, in msvs++ 2010 have have include directories when headers , cpp files inside static libray or static library project in case. i made static library project cmake, , source file told set same i'm told make include directory... seems have 2 of same cpp , header files.. except ones included statically in sollution... why? because vs++ while abstracting underlying implementation not hide completely. include directories , libraries targeted @ different phase of process, traditionally handled different programs. include directories preprocessor, libraries linker. programs called (or part of?) vc++, interface still shows underlying structure. there systems allows mark needed libraries in source code (and in header) use of pragmas. have several disadvantages: non standard you can't substitute libraries (say debug/instrumented/release, single thread/multi thread, ...)

Cross-Compiling Qt Applications from Windows to Mac OS -

can tell me how build .app extension files through qt creator-sdk , mingw? gcc compiler installed. i have done is qmake -spec macx-xcode project_name.pro it created supporting files create .app extension (when opened in notepad). thank you. i recommend cmake : says on tin: cross-platform make. integrates nicely qt (it's kde uses).

passwordbox - Display password char * in the password column in gridview in edit mode -

i have webform gridview. in 1 columns password. want allow users change password. there few issues. in edit template have mentioned password column textmode password. shows blank when click on edit button. when click on edit mode password column should display password mask characters '*' , if user changes password should updated on database. using sha1 encryption password think can retrive password value db , keep on frontpage won't security issue. finally found solution issue jquery. may useful someone. <asp:templatefield headertext="password"> <edititemtemplate> <asp:textbox id="txtpassword" runat="server" width="98%" textmode="password" maxlength="50" text='<%# bind("userpassword") %>' cssclass="blankpassword"></asp:textbox> <asp:requiredfieldvalidator id=...

.net - How can i post data using Jquery in Asp.net in some correct way? -

i using jquery posting form data in aspx. the way have adopted is, make 1 page having form , aspx page receive values , in page_load run query or other logic. i using $.ajax method of jquery, if there exception or issue occurs, not respond correctly , preloader kept on working. please tell me if there supportive way in .net, can use jquery $.ajax in proper way, or should use webservices or whatever please let me know, or can call code behind c# function jquery $.ajax? atif //the data want post var dataobject = json.stringify(reqobject); /// use need json plugin link posted below //call page method $.ajax({ async: false, type: "post", url: youraspxpage + "/" + code behind function name, contenttype: "application/json;", data: dataobject, datatype: "json", success: ajaxcallsuccess, error: ajaxcallfailure }); function ajaxcallsuccess(respons...

c++ - Qt intercept Application::exec in the application class? -

is there way have function in application class (derived qapplication) called when qcoreapplication::exec() called? don't see signal or event generated prior message loop starting. i have various components created depend on constructor application object. in turn, other components need created after components (as rely on them) -- these primary dialogs in application, has start them. currently post queued signal application constructor, processed once event loop starts. i'm wondering if there clearer way intercept exec ? this old technique in gui applications might work you. use qobject::starttimer(0) reimplement qobject::timerevent() have various components rely on constructed application object . doing so, various components rely on constructed application object created once event loop starts. a little bit of explanation: qobject::starttimer(int ms ) function runs timer in milliseconds fires every ms . if pass "0" argument, fires event loop...

iphone - Saving game score locally on iOS device...is security needed? -

do need store score hash, ie protect being edited/cheated user? newb knowledge, user unable view , manipulate locally stored data, plist files example. can elaborate? [edit] i'm storing scores locally , periodically uploading them game center leaderboards. if device jailbroken i'd have security prevent scores being manipulated user. approach? i this: save in nsdictionary , convert nsdata object. comes cool part: encrypt aes using class: https://web.archive.org/web/20160806074714/http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html this military standard encryption return encrypted nsdata object. save file , read/write whenever necessary. i've had experiences class , user can't it. much better storing in plain sight using nsuserdefaults . give go!

http - Java send post request for login -

i want login application java code. i have found following code example: string requesturl = "http://applicationurl/login.jsp"; string data = "email=temail@mail.com&password=123password&login=login"; public static string sendpostrequest(string data, string requesturl) { string result=""; try { // send request url url = new url(requesturl); urlconnection conn = url.openconnection(); conn.setdooutput(true); outputstreamwriter writer = new outputstreamwriter(conn.getoutputstream()); //write parameters writer.write(data); writer.flush(); // response stringbuffer answer = new stringbuffer(); bufferedreader reader = new bufferedreader(new inputstreamreader(conn.getinputstream())); string line; while ((line = reader.readline()) != null) { answer.append...

.net - Entity Framework, Business Objects, and Foreign Keys -

i new ef , having hard time understanding how presentation layer can use information multiple business objects (each bo represents entity). need dataview display data order details (products ordered) description column products. how binding work have dataview display columns 2 different entities? without using ef, order details business object have call sql server return datatable created using t-sql join between 2 tables. don't know how accomplish same results using ef. if presentation layer must use information multiple objects can either bind navigation properties - example load both order detail , product , navigate product's description through navigation property on detail. other way (common in mvc) creating new specialized view model type. type contain information need show in view , controller transform order details , products list of these custom classes.

firefox - How to launch some links in particular browser using slickrun -

how specify command parameter in slick run launch specific link in chrome or ie or firefox. instead of including website link in "filename" field, type link in "parameters" field. in "filename" field give browser details such "chrome" google chrome, "iexplore" ie.

if statement - Two ifs and one else in C#. What happens? -

for example: if(cond1) if(cond2) docond2(); else docond3(); will else statement considered else of first if or second if ? why? (is there explanation syntactic point of view?) answer same in other c-based programming languages such c , java? note: not homework. can test it, , use curly brackets if don't default behaviour, i'm curious reason. edit guys, apparently there serious mistake in original example. please check again. know, it's embarrassing. sorry. as per msdn in nested if statements, else clause belongs last if not have corresponding else. also c , c++, conditions can evaluated result of 0 false , other number true. in c#, condition must evaluate boolean value true/false edit per edit nested if, inner 1 evaluated when true , still else inner if

javascript - How to move a Div over different frames? -

i have 3 frames in page. have div in 1st frame , want displayed @ center of page 2nd frame there. how do this? can not put code in 2nd frame. use 'position: absolute'. more info http://www.w3schools.com/css/css_positioning.asp also, not use frames - not idea! use div's + ajax.

android - Animation while changing orientation -

is possible set animation when move activity in landscape view activity in portrait view ? it's possible, not trivial. add property <activity> in androidmanifest.xml file: android:configchanges="orientation|keyboard|keyboardhidden" then, override activity's onconfigurationchanged , perform animation there.

search - VBA:program optimization -

so question 2 parts. first seeing whether there quick , simple code can incorporate current sub check how fast sub take run. need precision down seconds, , maybe couple of minutes. the 2nd trying optimize run time of sub. search function allows user specify variables select search , displays results on following worksheet. i've surfed net , i've done following general applications speed program disable screen updating @ beginning of sub avoid copy&paste clipboard as possible however, program still takes ~5 10 seconds run everytime user runs search. decrease time as possible. i realize without looking @ code hard give specific suggestions, looking general suggestions. if still slow after general principles have been implemented post code here. my search program linear search program , stores values array. search function can accomodate 4 search variables though , store each search array , consolidate array @ end final results array. i use...

can we pass entire model to javascript asp.net mvc -

i have problem on javascript call form submit , model gets updated controller ,but not updating in view. thinking update model new model values in javascript . view shows latest model values can done? thanks, michael your question extremely unclear , provided no source code makes things more unclear. various comments may have posted assume trying update model value inside post action without removing model state , when same view rendered again old values displayed. so suppose have view model looks close this: public class myviewmodel { public httppostedfilebase file { get; set; } public string somevalue { get; set; } } and controller: public class homecontroller : controller { public actionresult index() { var model = new myviewmodel { somevalue = "initial value" }; return view(model); } [httppost] public actionresult index(myviewmodel model) { // notice how somevalue ...

javascript - Array push and jQuery doesn't work -

i've piece of code. need create set of input elements , remove them all: function inputreset(){ var td = new array(); $('#aaa').find('input').each(function(){ td.push($(this).parent()); alert(td[0][0].nodename); }); alert(td[0][0]); for(var = 0; < 2; i++){ var value = td[i].children('input').val(); alert(td[0][0].nodename); } try{ td.children('input').remove(); td.text(value); }catch(err){ //alert($('#aaa').html()) } } $('td[text="editable"]').click(function(){ $('td[text="editable"]').unbind('click'); inputreset(); $('td[text="editable"]').each(function(index){ if(index < 2){ var value = $(this).text(); $(this).html('<input type="text" name="i'+index+'...

android - Counting the number of times my location has been changed -

i'm reliantly new android , wanted make simple location app using gps. i've done wanted log amount times updated , displayed new location (this being longitude , latitude). because used visual basic logic tells me can new location variable add 1 new variable , display variable. there android equivalent? see this how use locationapi in android.you can increment variable in onupdate method find how many times location changed

asp.net mvc 3 - Strange Database table must end on a s -

i working vs2010 entity framework 4.1 installed nuget installers use codefirst on existing database. (dutch database) if use in models derived :dbcontext public dbset<klant> klant { get; set; } the error : invalid object name 'dbo.klants' i don't have table "klants" "klant" if change table name ends on "s" no problem, can't change this. it's used other programs well. does else has problem?? what can do???:? cheers check .edmx not have pluralize names set true in properties. i got headaches too.

python - class definition dependence on runtime -

in webapp made 2 different sessionhandler classes inheriting class called sessionhandler now i'd initiate appropriate handler (dependent on cookie value.) background: sessionhandler should base class of controller needs call controller backend method otherwise assign handler object ctrl member is there way set superclass @ runtime? or other way solve that? hope got meant! i not sure entirely understood question, sure need use inheritance? couldn't class need member instead? changing superclass @ runtime not sound design, if @ possible. just sure got you, want have controller inherit 1 of sessionhandlers, select 1 @ runtime? rather make controller have member variable of type sessionhandler.

silverlight - Can a c#.net class be automatically initialized by databinding to one of the properties of the class? -

i following tutorial on http://msdn.microsoft.com/en-us/wp7trainingcourse_usingbingmapslab_topic3#_toc271039355 . source code can found here: http://az12722.vo.msecnd.net/wp7trainingcourse1-4/labs/usingbingmapslab1-1-0/source.zip . select second project called "ex2-handlingpushpins" this tutorial shows how place pins on bing map long-pressing location on map. in tutorial there class pushpincatalog, containing collection of pushpins (items). items bound listbox control this: <popup x:name="pushpinpopup" isopen="false" canvas.top="330" canvas.left="45" opacity="0"> <listbox x:name="listboxpushpincatalog" width="392" height="56" background="{staticresource controlbackgroundbrush}" itemssource="{binding items}" selectionchanged="listboxpushpincatalog_selectioncha...