Posts

Showing posts from February, 2012

shell - In Unix, how to create a file in a absolute path name -

my variable path1 contains value /home/folder . how can create new file named foo using absolute path name? path1="/home/folder" echo "hello web" > $path1/foo but code give me error. can 1 please tell me how can create file foo in specific location, using path name? in bash should write: path1="/home/folder"; echo "hello web" > $path1/foo or: export path1="/home/folder" echo "hello web" > $path1/foo notation used works in bash script.

vb.net - VB Listbox change value -

how can change value in vb listbox? like doesn't work: listbox.selecteditem = "newvalue" thx help listbox.list(listbox.listindex) = "newvalue"

Unable to start debugging on the Web Server. Visual Studio 2008 -

i running visual studio 2008 sp1 on windows server 2008 r2 enterprise 64-bit . getting following exception when try debug against iis. "unable start debugging on web server. object identifier not represent valid object". iis , visual studio on same box. i've tried enabling windows authentication no luck (my app requires forms authentication , fyi). any thoughts? have binding on web site. iis app web site not virtual directly. thanks! p.s have posting new questions since previous question found not answered , solution provided in question not working well. previous question: unable start debugging on web server. visual studio 2008 when hit problem opened basic settings in iis , checked app pool set web site. set "default" , not (as should have been in case) ".net 2". changing setting fix.

python - Coloring an edge detected image by user input co-ordinates..??What's wrong with this code? -

i need color white part surrounded black edges! from pil import image import sys image=image.open("g:/ghgh.bmp") data=image.load() image_width,image_height=image.size sys.setrecursionlimit(10115) def f(x,y): if(x<image_width , y<image_height , x>0 , y>0): if (data[x,y]==255): image.putpixel((x,y),150) f(x+1,y) f(x-1,y) f(x,y+1) f(x,y-1) f(x+1,y+1) f(x-1,y-1) f(x+1,y-1) f(x-1,y+1) f(100,100) image.show() 255 detect white color, 150 used re-color greyish, , (100,100) starting pixel. it's giving "max recursion depth" @ n=10114 , python crashes on n=10115 (the setrecursionlimit(n) ). what's while loop? never changes coordinates, seems loop forever, doing recursive calls. quick reading sounds should plain if . also: drop parens while , if ; they're not needed in python.

memory leaks - MemoryLeaking - question -

i have function getalldata, wich returning array dictonaries. - (nsarray *)getalldata { nsmutablearray *result = [[nsmutablearray alloc] init]; nsarray *data = [skiresorts sortedarrayusingfunction:comparator context:null]; nsstring *currentletter = @"a"; nsmutablearray *array = [[nsmutablearray alloc] init] ; nsmutabledictionary *dict = [[nsmutabledictionary alloc] init] ; if ([data count] > 0) { (skiresort *resort in data) { if ([resort.name hasprefix:currentletter]) { // same letter before. // add current skiresort temporary array. [array addobject:resort]; } else { // new letter. // add previous header/row data dictionary. [dict setvalue:currentletter forkey:@"header"]; [dict setvalue:array forkey:@"row"]; // add dictio

php - Mustache partials and code reuse -

i'm getting hang of mustache project i've started during weekend. i'm using php implementation. have, couple of inquiries i'm not used system. how handle template inheritance, or reuse? know of partials, how should use them? i'm doing this, ala include: top.mustache: <!doctype html> <html lang='es'> <head> <meta charset=utf-8" /> <link rel="stylesheet" href="/media/style.css" type="text/css" media="screen" /> </head> <body> <header><h1><a href="/">top</a></h1> </header> <section> bottom.mustache: </section> <footer><a href="http://potajecreativo.com/">potaje</a></footer> </body> </html> and view render template: {{>top}} <form action="/album/" method="post"> <p><label for

c++ - Is it safe to push_back 'dynamically allocated object' to vector? -

whenever need add dynamically allocated object vector i've been doing following way: class foo { ... }; vector<foo*> v; v.push_back(new foo); // stuff foo in v // delete foo in v it worked , many others seem same thing. today, learned vector::push_back can throw exception. means code above not exception safe. :-( came solution: class foo { ... }; vector<foo*> v; auto_ptr<foo> p(new foo); v.push_back(p.get()); p.release(); // stuff foo in v // delete foo in v but problem new way verbose, tedious, , see nobody's doing it. (at least not around me...) should go new way? or, can stick old way? or, there better way of doing it? if care exception-safety of operation: v.reserve(v.size()+1); // reserve can throw, doesn't matter v.push_back(new foo); // new can throw, doesn't matter either. the issue of vector having responsibility freeing objects pointed contents separate thing, i'm sure you'll plenty of advice

EF4 Code First Adding a Entity with virtual navigation property null to a 1 to many -

i have following ef4 code first classes: [serializable] public class wochangelogheader { [key] public int wochangelogheaderid { get; set; } public datetime tadded { get; set; } public virtual workorderheader wo { get; set; } public int workorderheaderid { get; set; } [maxlength(50)] public string chng_type { get; set; } [maxlength(50)] public string chng_process { get; set; } public int chng_by { get; set; } public virtual icollection<wochangelog> changelogrecords {get;set;} } [serializable] public class wochangelog { [key] public int wochangelogid { get; set; } public datetime tadded { get; set; } public virtual wochangelogheader changelogheader { get; set; } public int wochangelogheaderid { get; set; } [maxlength(50)] public string chng_field { get; set; } public string old_value { get; set; } public string new_value { get; set; } } and setup addition of new wochangelogheader so:

sharepoint site CSS Settings -

i have sharepoint siteactions on left hand side , links tab on right hand side. 1 in td tag , other 1 on div tag. i cannot understand code. 1 showm me how update same. following code in master page. <sharepoint:siteactions runat="server" accesskey="<%$resources:wss,tb_siteactions_ak%>" id="siteactionsmenumain" prefixhtml="&lt;div&gt;&lt;div&gt;" suffixhtml="&lt;/div&gt;&lt;/div&gt;" menunotvisiblehtml="&amp;nbsp;"><customtemplate> <sharepoint:featuremenutemplate runat="server" featurescope="site" location="microsoft.sharepoint.standardmenu" groupid="siteactions" useshortid="true" > <sharepoint:menuitemtemplate runat="server" id="menuitem_create" text="<%$resources:wss,viewlsts_pagetitle_create%>" description="<%$resources:wss,sitea

jquery - JQGrid - Multiselect -

multiselect in jqgrid allows either multiple selection or single selections , shift functionality isn't i'd expect shift select do. don't need comboboxes multiselect. what other solution use multiselect? [oct 2011] updated use 4.0 api, corrected shift-selection bugs, simplified selection loop. tested in 4.2.0. if me, needed proper multiselect in jqgrid - ctrl selects single row @ time, select selects multiple rows , neither clear selection , selects 1 row - you've found it. first things first : set multiselect: true in grid definition (i didn't set other multiselect options) next: in gridcomplete: function () {} set grid.jqgrid('hidecol', 'cb'); - hides checkboxes if don't want them. finally : main part beforeselectrow: function (rowid, e) { if (!e.ctrlkey && !e.shiftkey) { $("#grid").jqgrid('resetselection'); } else if (e.shiftkey) { var initialrowselect = $(&q

OpenCV VS 2010 C++ CMake -

i couldn't find answer simple question. have been having problems getting opencv work on computer either dev c++ or vs 2010. my question not specifics instead cmake contributes process. i have worked way through lot of c++ programs, learning language. however, wrote them , compiled them, no fuss, directly on dev c++ using standard includes, etc.. now wehn come try use first 3rd party set of libraries, there huge process of downloading executable, using cmake, compiling 1 of ides. me, there no wonder thing goes wrong. many steps , purpose? ok, naive , simple programming. here questions: why there executable if have 3 steps afterwards? sort of understand if writers have no idea compiler using; why not simple set of source codes , done it? however, if there specific file vs 2010, why not have set way work on computer?, same way downloads vs 2010 in same format , installs itself? finally, if sort of installer needed create directory structure (which still don't un

c# - How can I restrict an assembly's security permissions, but not those of its callees? -

i'm allowing users of application run snippets of c# able directly manipulate objects in assemblies without me having write big scripting interface layer explicitly expose everything. this code injected dynamically compiled assembly, can control assembly itself, need stop code accessing private methods using reflection. i tried calling securitypermissionobject.deny() before running code, blocks methods on objects using reflection (which do) when called user's code. is there way restrict permissions on suspicious assembly without affecting public methods calls on trusted assemblies? try create new appdomain. , use sandbox. within sandbox can load assembly in. here example. of course because have 2 appdomains complicates communictiaon bit. might consider webservice through pipe or other communication mechanisms. here article of how 2 appdomains can communicate.

ruby - How do I run a Test::Unit suite to completion with a tally of tests/failures? -

i've inherited large suite of test::unit tests, , 1 of first tasks have suite run completion rather exit after first test failure. i'm rescuing assertionfailederror , ensuring output string, seems wrong. what's better way? seems configuration option. some more background helpful. can't understand behavior you're seeing. i'm using both core test/unit lib comes ruby 1.8, several versions of gem ruby 1.9. normal behavior both of these run entire loaded suite completion , summarize results. running script says require 'test/unit' add on-exit hook run test::unit::autorunner test::unit::collector::objectspace collector (i.e. runs every instance of test::unit::testcase loaded in global object space). it's easy write own custom test runner manually loads test classes , packs them test::unit::testsuite , , capture results. but every version of test/unit i've used, i've seen entire suite finish , report both failures , erro

jquery - When using chrome/chromium, brackets in url's hash is shown as %5Bwhatever%5D. Using firefox [whatever]. There is any way to fix it? -

i's using jquery 1.4.3 , bbq plugin handle history , hash. when update hash string "listing=restaurants&search[province]=1&search[main_food]=2" url bar shows "listing=restaurants&search%5bprovince%5d=1&search%5bmain_food%5d=2" ugly. there way show nice, firefox does? thanks the characters [ , ] must not appear literally in fragment of uri . here’s corresponding abnf uri (rfc 3986) : fragment = *( pchar / "/" / "?" ) pchar = unreserved / pct-encoded / sub-delims / ":" / "@" unreserved = alpha / digit / "-" / "." / "_" / "~" pct-encoded = "%" hexdig hexdig sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" any character not listed must encoded using perce

Ruby on Rails: rails generate migration is not giving me a new migration, but giving me an app called generate -

i typed terminal: rails generate migration createaddress and instead of creating new migration file, created entirety of naked rails app. what wrong here? the generate script ruby script, should call ruby . also, want call script top level of app, so: $ ruby script/generate migration createaddress the reason have issue because executing rails creates naked rails app in current directory first argument name. in case, that's "generate".

jquery - set field values in a wufoo form in an iframe -

i need set value/values of form select field in iframe using jquery. how can done? if know jquery once have access iframe - thread should help: how access content of iframe jquery? caveat: going problem cross-domain, may out of luck jquery/javascript: accessing contents of iframe http://forum.jquery.com/topic/jquery-iframe-cross-domain

Dictionary won't persist with NHibernate 3.0 -

i have following entity: public class alert { public virtual int id { get; set; } public virtual string name { get; set; } public virtual idictionary<cxchannel, string> messages { get; set; } } public enum cxchannel { message, email } and following mapping: <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="entities.alert, entities" table="alert"> <id name="id" type="int" unsaved-value="0" access="property"> <generator class="identity"/> </id> <property name="name" column="name"/> <map name="messages" table="alert_message" cascade="all"> <key column="alert_id"/> <index column="channel" type="entities.cxchannel, entities"/> <element column="message" type="system.string&qu

java - GWT StackPanel limitation? -

is there component stackpanel or decoratedstackpanel has ability of showing more 1 panel in stack @ time? id have option of expanding or collapsing number of panels want. ok, since got no answer, has worked me. google doesn't make real easy extend existing panels add or modify functionality, did downloaded source, copied stackpanel.java , decoratorpanel.java , decoratedstackpanel.java package in gwt project. the main change needed change behavior of showstack(int index) in stackpanel.java class public void showstack(int index) { if ((index >= getwidgetcount()) || (index < 0) || (index == visiblestack)) { return; } if (visiblestack >= 0) { setstackvisible(visiblestack, false); } visiblestack = index; setstackvisible(visiblestack, true); } to this: public void showstack(int index) { if ((index >= getwidgetcount()) || index < 0) { return; } visiblestack = index; setstackvisible

Workaround for Grid.SharedSizeGroup in Silverlight -

there no grid.sharedsizegroup in silverlight 4. workaround issue? for example: have datatemplate listbox.itemtemplate consisting of grid 2 columns , i'd have same width both columns , first column needs have auto width. vote feature here: http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions/suggestions/1454947-sharedsizegroup and here: http://connectppe.microsoft.com/visualstudio/feedback/details/518461/sharedsizegroup-should-be-available-in-silverlight

django - send image back to http response without saving the image -

i want create preview image before actual form upload. have preview button user first @ photo before submitting it. once use clicks preview button, best way in django respond image without saving image? thank you! pass file-like such stringio httpresponse constructor contains image data.

SQL Server: Ordering by date in the future when year is not known -

i have information table: due date day , month (eg. 16/11 16th november) of events repeat every year. i need create view, sorted how far in future. (eg. if 16 nov 2010, 31/12 means 31 dec 2010 , comes before 1/1 means 1 jan 2011) let's assume event table has these 3 columns |------------------------| | event | |------------------------| | id | dueday | duemonth | |------------------------| thanks in advance! any event in table dues day/month ahead of current day/month occur *this*year. event due day/month behind current day/month occur next year. event due next year further event due year. now being said, ask not possible because ask ...a view, sorted by... concept not exists. views not sorted . queries sorted. can create view projects proper event date , query view must use order by events sorted event date: create table events ( id int identity(1,1) not null, dueday int not null, duemonth int not null); go insert events (dueda

asp classic - Running bash script from IIS6 -

running iis6 on windows 2003. i'm trying set simple asp page runs bash script: dim wshshell set wshshell = createobject("wscript.shell") dim command command = "c:\inetpub\wwwroot\bin\bash.exe /cygdrive/c/inetpub/wwwroot/test.sh" wshshell.run(command) set wshshell = nothing i've configured iis6 use account iusr_servername identity default application pool, , confirmed script executes when run command line using runas /usr:iusr_servername [command] if set command notepad.exe, iis6 launches (with no window, of course, can see in task manager, , user name set iusr_servername). is there i'm overlooking need configure? i've got similar script running on windows 7 / iis7, , wasn't difficult running. resolved: switched lightweight mongoose web server (using tcl cgi script instead of asp). our purposes -- running simple demo -- works fine, , less painful , running.

object - Need Help Starting With Objective-C Basics -

i beginning learn objective-c , looking place start. every book pick starts off know object , instance of object is. there anywhere online or in book basics of objects , classes , other knowledge need read books have? here of terms need know books assuming know: object-oriented terms class, instance, message, method, instance variable, inheritance, superclass/subclass, , protocol any appreciated. not slow learner, of information have found on language far seems start off know information , terms above. need pointed in right direction. have knowledge of other programming languages, looking add library. apple's the objective-c programming language great introduction of these concepts appear in objective-c , cocoa. rather assuming background in other oo languages, introduces objective-c cohesive whole.

sql server - Prism Modules and databases -

i'm busy learning prism 4 , in , outs of everything, i've yet see tutorial/walk through on want accomplish. hoping here has or has worked on similar project. my application basic crud application i've broken down in separate areas of concern , hence modules. however, want modules share 1 common local sql express database. database start off limited number of tables start , each module check database tables needs , if not there, create them. how can go accomplishing this? i've thought adding in tables seems break principal of modularity in mind. perhaps thinking wrong, point of loosely coupled modules if database aware , coupled given module db creation? looking insight. you seem asking 2 questions. first is: how can use prism ensure module specific schema exists in database, , if not, create it. second question is: how can best structure data layer such decoupled in modular application. to answer first question how module schema check, this:

cocoa - Changes to NSTextView not reaching screen -

i have nstextview backed text system put myself, along lines of "assembling text system hand" section in text system overview in cocoa documentation. displays contents of nstextstorage on screen. but when type it, nothing seems happen—the text on screen doesn't change. if select text, shape of selection suggests text has changed. if copy , paste text textedit, can see edits. , if type enough, can throw exception: nsrunstorage, _nsblocknumberforindex(): index (5897) beyond array bounds (5881) golly, looks kind of thing spend better part of day debugging. what's going on here? make sure connected nstextstorage nslayoutmanager this: [textstorage addlayoutmanager:layoutmanager]; instead of this: [layoutmanager settextstorage:textstorage]; //bad the documentation on -[nslayoutmanager settextstorage:] says should never called directly, overridden. apparently reason. saved hours , hours of fruitless work!

java - Seam with JSF v. Seam with GWT -

would able compare , contrast 2 solutions? don't know seam or jsf, though familiar way gwt works , theory of it. primary concerns: scalability / performance cross-browser compatibility learning curve productivity wysiwyg ui building capacity code as possible in java (i can touch js/html/css if possible, preferably not) concerning server-side implementation of app have take following point account (pro/con subjective, should decide) when using gwt instead of jsf. as mention @z00bs, using gwt you'll have desktop app. won't use/need page-navigation or page-action feature of seam. all requests gwt server short-running. means, of components of scopetype.event or scopetype.stateless , don't need/use conversation scope. using gwt instead of jsf reduces load on server because hold of state in client. you cannot use jsf/seam-lifecycle gwt. instance, lose model validation part in lifecycle. model validation triggered using entity manager or manuall

a question about this python script! -

if __name__=="__main__": fname= raw_input("please enter file:") mtrue=1 salaries='' salarieslist={} employeesdept='' employeesdeptlist={} try: f1=open(fname) except: mtrue=0 print 'the %s not exist!'%fname if mtrue==1: ss=[] x in f1.readlines(): if 'salaries' in x: salaries=x.strip() elif 'employees' in x: employeesdept=x.strip() f1.close() if salaries , employeesdept: salaries=salaries.split('-')[1].strip().split(' ') d in salaries: s=d.strip().split(':') salarieslist[s[0]]=s[1] employeesdept=employeesdept.split('-')[1].strip().split(' ') d in employeesdept: s=d.strip().split(':') employeesdeptlist[s[0]]=s[1]

Passing Javascript Variable to Objective-C -

i've seen how pass objective-c variable javascript right here, passing objective c variable javascript in ios , how pass variable javascript objective-c when i'm using this: [webview stringbyevaluatingjavascriptfromstring:@"var elems = document.body.getelementsbytagname(\"u\");" "passthisvartoobjc = elems.length;" well, call stringly typed . because return type of stringbyevaluatingjavascriptfromstring: nsstring * , either need stick using string or coercing value other ( read:more usable ) type. but anyway, stringbyevaluatingjavascriptfromstring: return value of javascript variable without problem. the way accomplished through use of anonymous function (which in case self-executing): nsstring *numofelements = [webview stringbyevaluatingjavascriptfromstring:@"(function() {var elems = document.body.getelementsbytagname(\"u\"); return elems.length;})();"]; //do normal stuff numofelements cast int or cool

jQuery eq to display fade in block -

what i'm trying fade in block on css display none here got: css: .white_content { display: none; position: relative;; width: 5%; height: 5%; padding: 24px; border: 16px solid orange; background-color: some; z-index:1; } jquery $(function(){ $("#act1").click(function() { $('li:eq(0)').fadein(400); }); $("#act2").click(function() { $('li:eq(1)').fadein(400); }); }); an html: <div id="act1">first click</div> <div id="act2">second click</div> <ul> <li><div id="tos" class="white_content"> text... </div></li> <li><div id="tos" class="white_content"> other text </div></li> </ul> if change on jquery li:eq(0) #tos work fine can't work li:eq(0) since i'm trying do. there sev

tsql - How can I do a dynamic pivot in SQL Server 2000 -

i want write sql statement uses pivot in sql server 2000. pivot keyword not available in sql server 2000 found examples use case statement requires know column names beforehand won't. how do pivot dynamically generates column names data has available it? we create sql commands case statements our application , fire them @ database (any database, not sql server). first determine number of pivot columns , names using 1 query, results generate next query. first query determine columns looks like: select distinct myfield mytable then use values in result construct sql command case statement generated each value. we wanted databasebase agnostic solution processing outside database i'm sure same in stored procedure withing sql server itself.

google app engine - How do I access EntityManager from within Grails service (JPA + GAE) -

i'm having trouble accessing entitymanager within grails service: my setup follows... basic grails application appengine , gorm-jpa plugins default settings pretty everything. haven't touched resources.groovy, persistence.xml etc. some things good... i able access entitymanager within controllers adding "def entitymanager". but... i have service i'm trying access entitymanager from, however, "java.lang.illegalstateexception: entitymanager closed!" exception. is plugin closing entitymanager somewhere? need change scope of entitymanager somehow? there xml file need update ensure proper injection? class googlecalendarservice implements initializingbean { void afterpropertiesset() { } def entitymanager public oauthtoken getaccesstoken(user u) { //can't access entitymanager here entitymanager.newquery(...) //throws illegalstateexception } } one weird note: reason, if re-save service while je

NHibernate and ASP.NET Binding to a IList of <Products>? -

i have started use nhibernate , quite happy until needed bind asp.net controls. having major issues binding gridview collection of products (ilist). in end forced right small routine convert ilist datatable. once in datatable worked flawlessy. now has come time bind standard dropdownbox 1 field of collection (ilist) of products appears having issues again. so has brought me conclusion must doing wrong? i can't believe isn't possible bind asp.net controls collection (ilist) of class (in case products) returned nhibernate. i appreciate feedback has on situation... @ loss thank you the problem not can't bind, because can. issues come when you're binding @ wrong time . nhibernate supports laziness. if query lazy, , properties on returned objects lazy, values won't pulled database until items , properties referenced. if bind these controls in ui, values won't extracted until page gets rendered. at point there chance have closed database con

Sinatra & Rails 3 routes issue -

i have setup sinatra v1.1.0 inside rails (v3.0.1) app. can't invoke routes more 1 level deep, meaning works - http://localhost/customer/3 , but 1 not work - http://localhost/customer/3/edit , "routing error" here's sinatra object class customerapp < sinatra::base # works "/customer/:id" "hello customer" end # not work "/customer/:id/edit" "hello customer" end end this have in rails routes.rb file - match '/customer/(:string)' => customerapp i guessing need magic in routes file? problem? in routes file, can specify mapping way: mount customerapp, :at => '/customer' now, inside sinatra application, can specify routes without /customer part. dont't forget require sinatra application somewhere (you can directly in route file)

objective c - convert bottom left orgin position to top left origin position (and the reverse) -

i wondering right way convert bottom left orgin position top left origin position (and oposite operation) under mac os x taking account: - multi screen configurations - these screens can arranged in possible configurations. thanks in advance help, regards, see how convert cocoa co-ords top left == origin bottom left == origin good answers there...

.net - Which is more efficient a method returning a Func<bool> or returning bool? -

i refactoring linq queries , trying determine efficient refactor. the original line query similar to: static void main() { var list = new list<string> { "a", "bb", "ccc" }; var shortlist = list.any(name => name.length == 1); } i can refactor out string length check method follows: static void main() { var list = new list<string> { "a", "bb", "ccc" }; var shortlist = list.any(name => isshort(name)); } private static bool isshort(string name) { return name.length == 1; } or, can refactor out complete func method: static void main() { var list = new list<string> { "a", "bb", "ccc" }; var shortlist = list.any(isshortfunc()); } private static func<string, bool> isshortfunc() { return name => name.length == 1; } the question is, more efficient @ run time? actually can better using me

qt4 - Resize image to fit window in Qt -

i using qt construct application. mainwindow consists of image of map resized fit window. means when window gets smaller image gets smaller , vice versa. when user selects point on image want remove feature. new qt , haven't been able figure out. using qgraphicsview this. qgraphicsview::fitinview

c# - Word wrap text to fit an rectangle of certain ratio (not size) -

anyone know of algorithm can break text @ word boundaries fit rectangle of approximate ratio - e.g. 60:40 (width:height)? note not width (e.g. 80 chars or 600px etc) , arbitrary height rules out every word-wrapping algorithms can find. bonus points javascript more algorithm implementation. this it: int lineheight := getheightoftextline() int lines := 0 { lines += 1 int width = lines * lineheight * ratio string wrappedtext := break(input, width) } while(getnumberoflines(wrappedtext) != lines) starting 1 line test each height (multiples of lineheight) if have rectangle given ration can hold text. if breaking text @ calculated width leads string more lines allowed (for run) continue, otherwise have solution.

asp.net - jQuery animation not working on page with update panel -

i've had around see if has been answered, , there many similiar questions here none match problem i'm having, here goes. i have jquery animation runs on pages. works fine on pages except .net update panel. items animated not part of update panel @ all, have nothing it. when click on button triggers animation in question, doesn't anything. gets called alright (a quick alert("clicked!"); proved that) doesn't anything. looks though it's trying, failing, there no javascript errors reported. from other similiar questions , answers here, people have suggested using jquery's .live() , pagerequestmanager.getinstance().add_endrequest() none of these valid here, items outside of update panel. (i've given them try, in case!) has else come across issue before? appreciated! a quick edit...it appears clicking button causes animation causing update panel reload, not sure why they're set conditional , have triggers associated them. ok

My application crashed when I retrieve second time from sqlite database in my running iPhone application -

- (void) hydratedetailviewdata { strong text//if detail view hydrated not database. if(isdetailviewhydrated) return; if(detailstmt == nil) { const char *sql = "select name,rdate,image movie_data id = ?"; if(sqlite3_prepare_v2(database, sql, -1, &detailstmt, null) != sqlite_ok) nsassert1(0, @"error while creating detail view statement. '%s'", sqlite3_errmsg(database)); } sqlite3_bind_int(detailstmt, 1, informationid); if(sqlite_done != sqlite3_step(detailstmt)) { nsstring *str = [nsstring stringwithutf8string:(char *)sqlite3_column_text(detailstmt, 0)]; self.informationname = str; //get date in temporary variable. nsdate *date1; date1 = [nsdate datewithtimeintervalsince1970:sqlite3_column_double(detailstmt, 1)]; //nsinteger dateininteger = sqlite3_column_int(detailstmt, 2); //self.setdate= dateininteger; //assign date. date value cop

retrieve checked option after result is displayed in multi select jquery -

the check box selection @ drop down list not retained after result being populated. sample code $("#ddlcheck").multiselect({ header: "select options below" }); var array_of_checked_values = $("select").multiselect("getchecked").map(function () { return this.value; }); i want show checked option after search result if (_all != null && _all != "" && _all != undefined && _all == "all") { $("select").multiselect("widget").find("input:checkbox:eq(0)").trigger("click"); }

Javascript history.go -

i need give user 1 alert after saving item.so using open script display alert.but when moving out page , , coming through history.go(-1) ,again getting alert.how make sure alert comes if saving item? if use history,go(-1) going page saved record, saving record again. it might work history.go(-2) if came page shows result, might not update saved record because page cached. go on page shows result, instead of trying find in history.

java - Is it considered a best practice to synchronize redundant column properties with associations in JPA 1.0 @IdClass implementations? -

consider following table: create table participations ( roster_id integer not null, round_id integer not null, ordinal_nbr smallint not null , was_withdrawn boolean not null, primary key (roster_id, round_id, ordinal_nbr), constraint participations_rosters_fk foreign key (roster_id) references rosters (id), constraint participations_groups_fk foreign key (round_id, ordinal_nbr) references groups (round_id , ordinal_nbr) ) here jpa 1.0 @idclass entity class: @entity @table(name = "participations") @idclass(value = participationid.class) public class participation implements serializable { @id @column(name = "roster_id", insertable = false, updatable = false) private integer rosterid; @id @column(name = "round_id", insertable = false, updatable = false) private integer roundid; @id @column(name = "ordinal_nbr", insertable = false, updatable = false) private integer ordinalnbr; @colu

flatten - AutoMapper: Does the Recognize.Prefixes work also in flattening? -

here's problem have. our simplified source graph looks like: public class model { public string name { get; set; } public foo foo { get; set; } } public class foo { public bar bar { get; set; } } public class bar { public string name { get; set; } } the destination flat type is: public class viewmodel { public string name { get; set; } public string fooname { get; set; } } everything working when define custom mapping rules: cfg.createmap<model, viewmodel>() .formember(vm => vm.fooname, opts => opts.mapfrom(m => m.foo.bar.name)); but there possibility without specifying custom mapping, maybe kind of recognizeprefixes method or so. (e.g. recognizeprefixes("bar") should work when source property barname . in our case there bar.name ). have lot of properties want map , lot of .formember lines mapping definition huge , ugly.

c++ - print 999 line in output screen -

this code print need see line scroll #include "iostream" #include "conio.h" using namespace std; void main() { (int k=1 ;k<1000;k++) cout<<k<<"\n"; getch(); } i write in windows 7 when compile , see result 300 line see 701-999 butt need see line 1-999 if on linux: g++ filename.cpp -o filename.out ./filename.out | less i don't use windows, can't if there equivalent.

asp.net mvc - MVC; How do you avoid ID name collisions when using tabs? -

there lot commend mvc, 1 problem keep getting id name collisions. first noticed when generating grid using foreach loop. of found solution use editor templates. have same problem tabs. used reference find out how use tabs; http://blog.roonga.com.au/search?updated-max=2010-06-14t19:27:00%2b10:00&max-results=1 the problem tabs using date field date picker. in example above, id name collisions avoided referencing generated unique id of container element. datepicker, id of container irrelevant, id of date field matters. happens if create second tab same first, when update second tab, date on first updated. below view, , partial view displays date. when click "add absence 1 day button, create tab screen; <%@ page title="" language="c#" masterpagefile="~/views/shared/adminaccounts.master" inherits="system.web.mvc.viewpage<shp.webui.models.absenceviewmodel>" %> <asp:content id="content1" contentplaceholderid=&

javascript - Generating file with ajax and allow user to download it? -

i have similar problem this: allowing users download files - asp.net , in case generating xlsx file ajax, , on ajax-called aspx page using: response.clear(); response.contenttype = "application/octet-stream"; string filename = user.identity.name + "_report.xlsx"; response.addheader("content-disposition", "attachment; filename=\"" + filename + "\""); response.writefile(appdomain.currentdomain.basedirectory + "reports\\" + filename); response.end(); when file generated, control returned ajax calling page , there wan't show save file dialog based on ajax response , allow user download generated file. don't want save file on disk ajax called page , redirect ajax calling page file, because of popup blocker in ie. using jquery ajax calls: $.ajax({ type:"post", url: "ajaxreport.aspx", data:datastring, success: function(data) { //don't want

Saving a UNIX timestamp in MySQL as type DOUBLE? -

my function call takes input, , throws database. usually, it's integers, today, need throw in unix timestamp. this overflew float type, works type double. is there should worried saving 10-digit integer in type double? the total precision of double precision value approximately 16 decimal digits, should not worry, if store milliseconds or microseconds.

java - XML Signature Generation using IBM SDK 6.0 -

i'm having interesting problem trying sign saml2 assertion using ibm's jre 6.0. if run code under sun jdk, signs assertions correctly , signature verifies. if run exact same code under ibm jre, assertion created correctly, signature won't verify. again, same code, indeed, it's running jetty, it's exact same jetty config , war file well. have 2 instances of jetty running on different ports different jres pointing same jetty home. signatures generated under sun jre validate, generated under ibm jre not. i'm frankly stumped , running out of things try, suggestions helpful. a few years late, i'm going answer myself. problem mix of dom1 (non-namespace aware) , dom2+ (namespace aware) calls. shifting namespace aware dom2+ calls, problem went away.