Posts

Showing posts from July, 2010

jquery - Clear input value in form -

jquery - Clear input value in form - due ie8 transparancy issue want remove value form field. <input type="button" value="something" /> i tried several variations of $(' input[type="submit"], input[type="inputsubmit"], input[type="button"]').val(''); with no success. know should simple. i'd appreciate help this. thanks are sure? this working fine me way ie7 $('input[type="button"]').val(''); the result button no text. jquery input clear

hide - jquery, how to find the parent div id? -

hide - jquery, how to find the parent div id? - im trying hide parent div contains clicked link: <div class="user" id="request_1"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree1</a></li> </ul> </div> </div> <div class="user" id="request_2"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree3</a></li> </ul> </div> </div> <div class="user" id="request_3"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree4</a></li> </ul> ...

java - Is it clone safe to pass a classes enum to a clone? -

java - Is it clone safe to pass a classes enum to a clone? - i have simple class holds skeleton much larger, bulkier class. skeleton is string id, type enumeration , flags options. i able clone skeleton, don't know if enumeration clone safe (pass value). think not since treated classes (pass reference). safe pass enumeration clone? example clarity: class { string id; enum state; int flags; clone() { ret = new a(); ret.id = id; ret.state = state; // safe here? ret.flags = flags; homecoming ret; } } an enum instance, definition, singleton. there 1 instance of each enum instance, design. obviously, thing can re-create reference. java enums clone pass-by-reference pass-by-value

Security concerns while using MongoDB PHP driver -

Security concerns while using MongoDB PHP driver - i have experiences securing sql injections on mysql, should careful on mongodb using php driver? in of pages info via get/post , searching/inserting system. search via udid / other fields, , can insert string value. user's cookies via javascript. so when get/post, i'm adding each variable htmlentities function? what replace mysql_real_escape_string? should utilize it? so, example, when doing $download = array( 'url' => $_get['url'] ); $downloads->insert($download); is ok? is there way check if string uid? any think else should aware when using mongodb , php? cookies using javascript, , searching in db using cookies. that? so when get/post, i'm adding each variable htmlentities function? no need to. should however, utilize htmlentities when outputting user-generated info browser, prevent xss attacks. what replace mysql_real_escape_string? should utilize...

objective c - get an integer -unit digit in a simple way -

objective c - get an integer -unit digit in a simple way - i not sure english, need unit digit of integer. without complex algorithm api or trick. for illustration : int a= 53; int b=76; this add together because dont "meet quality standards" post! drive me crazy! please , prepare ! took me 10 shoots post this,and other issue also. i need a=3 , b=6 in simple smart way. same other digit. thanks lot . here how divine number parts int unitdigit = % 10; //is 3 int tens= (a - unitdigit)/10; //is 53-3=50 /10 =5 objective-c

c++ - Width of cout - display -

c++ - Width of cout - display - i'm wondering: possible width of line in standard output? not std::cout.width() or std::setw() widths, actual maximum number of characters before os wrap line? edit: inform, i'm using windows xp, though i'd prefer portable manner (everything else portable atm). not using standard c++. cout not necessary bound console, in "width" meaningless. of course of study possible using other libraries, e.g. ncurses . if you're using linux, check getting terminal width in c?; if you're using windows, check getting terminal size in c windows?. c++ command-prompt cout

vectorization - how to vectorise an xor operation in matlab -

vectorization - how to vectorise an xor operation in matlab - i have run next code in profiler in matlab , quite essential me vectorise code sense unnecessary loop. i have 2 matrices g , source_data. every column in g determine rows need pick source_data , xor them together. i creating g , source_data using next piece of code for i=1:10 source_data(i,:)=rand(1,20)<.8; end i=1:15 g(:,i)=rand(10,1)<.9; end i performing xor operation using loop below: z=1; while(i<=15) j=1:10 if(g(j,i)==1) intersum(z+1,:)=xor(intersum(z,:), source_data(j,:)); z=z+1; end end c(i,:)=intersum(z,:); i=i+1; end is there way vectorise code ? time lag acceptable little matrix big matrices code quite in efficient. thanks, bhavya assuming that: i starts @ 1 intersum starts @ zeros here's vectorized form of code produces exact same result original: function c = version_a() source_data = rand(10,20)<.8; g = rand(10,15)<....

javascript - .each loop are not executed completely ... why ? ( code and log available ) -

javascript - .each loop are not executed completely ... why ? ( code and log available ) - var idd; $.each(data, function (i, items) { //1st each $.each(items, function (j, item) { // 2nd each console.log("field:" + j + " value:" + item); if (j=="sha_id"){ idd=item; } }); console.log("items"); console.log("id:" + idd); db.transaction(function (tx) { console.log("being inserted"); console.log("id inserting:" + idd); //then database insertion query this sample upper part script basically 1st .each run 2 round , 2nd .each run 2 round each 1st .each so in console log expect see field .... value field ..... value items id : 2 beingness inserted id inserting : 2 field .... value field ..... value items id : 3 beingness inserted id inserting : 3 but getting field .... value field ..... value items id : 2 field .... value fie...

c# using const with DllImport -

c# using const with DllImport - i have code illustration sdk, dll written in c , calls following: int getattribute(const rawdevcontrol *control, rawdevattribute *attribute) i'm using [dllimport(@"dev.dll", setlasterror = true)] internal static extern int getattribute(const rcontrol *control, rattribute *attribute); but of course of study can not utilize const type when defining reference function. how can create work c#? since c# doesn't have concept of const references, don't need worry it. on dll side, code still think have const pointer. thus, import changes this: [dllimport(@"dev.dll", setlasterror = true)] internal static extern int getattribute(rcontrol control, rattribute attribute); this, of course, assumes both rcontrol , rattribute have been defined in c#. if structs, follow examples on msdn defining structs utilize p/invoke. if classes, that's different set of problems. in case, best if classes com-base...

Linq to Nhibernate strange behaviour -

Linq to Nhibernate strange behaviour - i have table fill query, have references entities. i have client: public class client { public virtual int id { get; set; } public virtual icollection<address> addresses { get; protected set; } public virtual address currentaddress { get; set; } } address public class address { public virtual int id { get; set; } public virtual string address1 { get; set; } public virtual string city { get; set; } public virtual string zipcode { get; set; } } and db diagram: i want users addresses linq nhibernate: clientrepository.where(x => x.id == clientid).selectmany(c => c.addresses ).where(x => x.address1.contains("comp")).tolist(); but got query: select top (20 /* @p0 */) id31_, address2_31_, address3_31_, city31_, zipcode31_ (select address2_.id id31_...

java - SealedObject in https communication -

java - SealedObject in https communication - i know if it's recommended create sealedobject create client-server communication preserve privacy. client-server communication done via https. maybe it's protected https communication, , double encryption create server works more needed. thank you. well both same, encript , decript data. maybe if https encryption not strong, have no way alter , info extremly sensitive might utilize sealedobject farther encrypt, other that, strong (like 256 bits) https encryption should ok. java security javax.crypto

ios - Segue configured but not fired -

ios - Segue configured but not fired - i have next setup of storyboard nc --> tvc --> vc --> tvc --> vc problem face first segue tableviewcontroller viewcontroller work , sec not. both configured force segues ( actual transitions configured way ) both tables filled in dynamically. first 1 works , sec not. issue ? segues has named set , table cells has ids, event on selecting table cell firing in both cases, prepare segue not firing in sec case. thanks in advance probably going need see code. without seeing it, create sure: make sure have segue wired view you have specified , using right segue identifier make sure calling [self performseguewithidentifier:@"segueidentifier" sender:nil]; in didselectrowatindexpath method. ios ios5 uitableview storyboard segue

python - ZeroMQ PUB socket buffers all my out going data when it is connecting -

python - ZeroMQ PUB socket buffers all my out going data when it is connecting - i noticed zeromq pub socket buffers outgoing info if connecting, example import zmq import time context = zmq.context() # create pub socket pub = context.socket (zmq.pub) pub.connect("tcp://127.0.0.1:5566") # force message before connected # should dropped in range(5): pub.send('a message should not dropped') time.sleep(1) # create sub socket sub = context.socket (zmq.sub) sub.bind("tcp://127.0.0.1:5566") sub.setsockopt(zmq.subscribe, "") time.sleep(1) # message should see in sub pub.send('hi') while true: print sub.recv() the sub binds after messages, should dropped, because pub should drop messages if no 1 connected it. instead of dropping messages, buffers messages. a message should not dropped message should not dropped message should not dropped message should not dropped message should not dropped hi as can see, "a m...

javascript - Handling RadioButtonList SelectedIndexChanged event in ajaxToolkit ModalPopupExtender without postback -

javascript - Handling RadioButtonList SelectedIndexChanged event in ajaxToolkit ModalPopupExtender without postback - in form using ajaxtoolkit modalpopupextender. popupcontrolid has been set panel has radiobuttonlist , dropdownlist.the panel pops this: <asp:panel id="popupwindowpanel" runat="server" visible="false" borderstyle="solid"> <table cellpadding="2" cellspacing="0" width="100%" border="0" class="datatbl"> <tr> <td class="left"> <asp:radiobuttonlist id="rdbtnlstsortoptions" runat="server"> <asp:listitem text="no change." selected="true" value="none"></asp:listitem> <asp:listitem t...

Custom Context Menu in WPF native WIndow -

Custom Context Menu in WPF native WIndow - i add together custom context menu items native wpf window title bar. should accomplish without editing style of window. is there way? regards, jawahar wpf window

android - Animation causes AsyncTask HttpClient task to be super slow -

android - Animation causes AsyncTask HttpClient task to be super slow - i have network task defined within of asynctask takes approximately 2-3 seconds complete. when add together animation code below: <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromdegrees="0" android:todegrees="360" android:pivotx="50%" android:pivoty="50%" android:repeatcount="infinite" android:duration="60" android:interpolator="@android:anim/linear_interpolator" /> and in activity execute follows: progressimageview = (imageview) getwindow().findviewbyid( r.id.progressimageview); progressanimation = animationutils.loadanimation(this, r.anim.progress); progressimageview.startanimation(progressanimation); the network phone call takes approximately 12-13 seconds complete. do...

php - How to explode URL parameter list string into paired [key] => [value] Array? -

php - How to explode URL parameter list string into paired [key] => [value] Array? - possible duplicate: parse query string array how can explode string such as: a=1&b=2&c=3 so becomes: array { [a] => 1 [b] => 2 [c] => 3 } using regular explode() function delimited on & separate parameters not in [key] => [value] pairs. thanks. use php's parse_str function. $str = 'a=1&b=2&c=3'; $exploded = array(); parse_str($str, $exploded); $exploded['a']; // 1 i wonder string from? if it's part of url after question mark (the query string of url), can access via superglobal $_get array: # in script requested http://example.com/script.php?a=1&b=2&c=3 $_get['a']; // 1 var_dump($_get); // array(3) { ['a'] => string(1) '1', ['b'] => string(1) '2', ['c'] => string(1) '3' ) php url parameters explode

iphone - Responding to MPMoviePlayerController notifications during background media playback -

iphone - Responding to MPMoviePlayerController notifications during background media playback - i have app streams video net , plays using mpmovieplayercontroller object playback on device or via airplay. the app supports background operation , has 'audio' alternative listed within required uibackgroundmodes key in plist file. when playing on airplay, app can pushed background , video continues play properly. far, good. according apple documentation: including sound key tells scheme frameworks should go on playing , create necessary callbacks app @ appropriate intervals. if app not include key, sound beingness played app stops when app moves background. however, these callbacks not beingness made. the app uses 2 types of callback: associated notifications mpmovieplayercontroller , avplayer send during playback timer based callbacks monitor playback position , performance stats monitoring purposes. looking @ apple's notes, expect rece...

c# - Get Dynamic Members and SetValue from Interop Object -

c# - Get Dynamic Members and SetValue from Interop Object - i have interop object comes system.__comobject , want set values using variable name: setvalue(fieldname) = fieldvalue; i need inspect dynamic members see what’s available. members (the ones ending in ref) have sub-members need drill-down them well. in debug, dynamic members come follows. (sorry,i can't post images) http://www.mezzodev.com/qintegrator/download/debug1.png http://www.mezzodev.com/qintegrator/download/debug2.png using impromptu interface able gather dynamic members with: var membernames = impromptu.getmembernames(customeradd, dynamiconly:true); then can set using variable fellow member name with: string optfield = "phone"; string optvalue = "818-555-1212"; impromptu.invokeget(customeradd, optfield).setvalue(optvalue); a big "thank you!" developer of impromptu interface answering me. c# reflection reflection.emit system.reflection

ruby on rails - Devise, OmniAuth & Facebook - How to let user edit password? -

ruby on rails - Devise, OmniAuth & Facebook - How to let user edit password? - i'm hoping else has solution issue. allow our users register using facebook (by liking app), , @ same time come in our database users on our site. upon successful registration seems devise/omniauth creating random password(?). how can allow users edit profile, (and should) default in devise requires come in current password? i had exact same issue hope solution helpful. based off details in question assuming next omniauth guide in devise wiki: https://github.com/plataformatec/devise/wiki/omniauth:-overview in next method: def self.find_for_facebook_oauth(access_token, signed_in_resource=nil) info = access_token.extra.raw_info if user = user.where(:email => data.email).first user else # create user stub password. user.create!(:email => data.email, :password => devise.friendly_token[0,20]) end end i changed logic in else block because creating ...

oracle - Sql update Query -

oracle - Sql update Query - i got question i'm not sure can complete. follows: 'using single query update 4 smallest client id male.' i'm using oracle. uncompleted code below: create table customer_09 ( custid varchar(5)primary key not null, firstname varchar(20), lastname varchar(20), dob date, address1 varchar(40), address2 varchar(40), phone varchar(7) ); update customer_09 set gender = 'male' custid = (select min(custid) customer_09) if has right code, share me please. thank you when using rownum limit result, cannot done within same "level" order done (because rownumbers assigned before order done). so right solution this: update customer_09 set gender = 'male' custid in (select custid ( select custid, rownum rn customer_09 ord...

try to understand mysql concepts: session v.s. connection -

try to understand mysql concepts: session v.s. connection - i'm bit confused mysql concepts: session vs connection. when talking connecting mysql. utilize connection terminology, connection pool , etc. however let's go mysql online doc: http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html. talks session variables. they quite similar. how distinguish them? thanks in advance. a session result of successful connection . mysql client requires connection settings found connection , after connection has been established acquires connection id (thread id) , context called session. mysql session connection terminology

linux - Implementing background processing -

linux - Implementing background processing - update: there obvious debugging step forget. happens if seek command ps & in regular old bash shell? reply see same behavior. example: [ahoffer@uw1-320-21 ~/program1]$ ps & [1] 30166 [ahoffer@uw1-320-21 ~/program1]$ pid tty time cmd 26423 pts/0 00:00:00 bash 30166 pts/0 00:00:00 ps <no prompt!> if press enter, command shell reports exit status , console displays exit status , prompt: [ahoffer@uw1-320-21 ~/program1]$ ps& [1] 30166 [ahoffer@uw1-320-21 ~/program1]$ pid tty time cmd 26423 pts/0 00:00:00 bash 30166 pts/0 00:00:00 ps [1] done ps [ahoffer@uw1-320-21 ~/program1]$ ps: using putty access linux machine via ssh on port 22. original question: working on homework assignment. task implement part of command shell interpreter on linux using functions fork(), exec(). have unusual bug occurs when code executes command background process. fo...

how to perform coordinates affine transformation using python? -

how to perform coordinates affine transformation using python? - i perform transformation illustration info set. there 4 known points coordinates x, y, z in 1 coordinate[primary_system] scheme , next 4 known points coordinates x, y, h belong coordinate system[secondary_system]. points correspond; illustration primary_system1 point , secondary_system1 point same point have it's coordinates in 2 different coordinate systems. have here 4 pairs of adjustment points , want transform point coordinates primary scheme secondary scheme according adjustment. primary_system1 = (3531820.440, 1174966.736, 5162268.086) primary_system2 = (3531746.800, 1175275.159, 5162241.325) primary_system3 = (3532510.182, 1174373.785, 5161954.920) primary_system4 = (3532495.968, 1175507.195, 5161685.049) secondary_system1 = (6089665.610, 3591595.470, 148.810) secondary_system2 = (6089633.900, 3591912.090, 143.120) secondary_system3 = (6089088.170, 3590826.470, 166.350) secondary_system4 = (6088...

mysql - Geting the first line in the textarea from database -

mysql - Geting the first line in the textarea from database - i trying retrieve value of html textarea in jsp page mysql database.the problem having can first line in textarea(when i'm saving address in databse, it's retrieving first line only). happening text box also, info has space in database, it's getting first line of data. in advance. html code: <div class="container2"> <table> <tr> <td align="right">tpo name</td> <td><input type="text" readonly name="tponame" value=<%=rs.getstring("tponame")%>></td> </tr> <tr> <td align="right">name of college</td> <td><input type="text" readonly name="college_name" value=<%=rs.getstring("college_name")%>></td> </tr> <tr> <td align="right">contact number</td> <td><input type="text...

python - No Pyramid Debug Toolbar on a real (VPS) server with development.ini -

python - No Pyramid Debug Toolbar on a real (VPS) server with development.ini - i'm deploying project vps server , want test pyramid debug toolbar running. site works fine, toolbar not appear @ all? debugtoolbar.hosts relevant setting should caring about. default displays toolbar requests localhost. http://docs.pylonsproject.org/projects/pyramid_debugtoolbar/en/latest/#settings python pyramid

scala - Binary search on an indexed collection (a sorted, indexed sequence) -

scala - Binary search on an indexed collection (a sorted, indexed sequence) - i have indexed collection (it must indexed) of type a : var coll: indexedseq[a] i wish maintain coll sorted according ordering[a] adding/removing items to/from it. obvious mechanism like: def binarysearch[a : ordering](a: indexedseq[a], elem: a): int def add(a: a) { val idx = binarysearch(coll, a) coll = (coll take idx) :+ +: (coll drop idx) } but there neither binarysearch in standard library (odd, seeing there scala.util.sorting.quicksort ) , there no datatype can find both indexed , sorted (i guess inefficient structure). i think slice on treeset reasonably efficient (and can utilize one-element range), you're right--it's unusual there no indexed sorted info structure. , it's efficient enough; sorted tree can used way if number of children tracked. think it's oversight it's missing. you can utilize set repeated elements if wrap them tag allows ...

ios - Naive Git setup, Is it possible to untrack files which are listed on my .gitignore? -

ios - Naive Git setup, Is it possible to untrack files which are listed on my .gitignore? - i have made naive error while setting project. 3 developers working on 1 remote repository. while setting git never thought xcode produce non-development files , force them our remote repo. 1 time learnt after crash , fire made .gitignore file. .gitignore looks this, please allow me know if should edit too. (file credit goes : this question's reply given abizem) # mac os x *.ds_store # xcode *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 *.xcuserstate project.xcworkspace/ xcuserdata/ but question there possibilities can untrack of listed files our source control? or can list tracked files path , later know painful way remove 1 1 with, git rm --cached 'file path' something i've done few times in these situations, move of files in repository somewhere else on filesystem (except .gitignore), run: git add together --all git commit -m "remov...

How to improve performance or simplify .NET code with linq -

How to improve performance or simplify .NET code with linq - apart database operation, how can simplify or improve code linq ? example to search in string string search = "search in list"; ienumerable<string> results = mylist.where(s => s == search); i utilize linq statements in loops. simple illustration instead of: for (int = 0; < array.length; i++) { if (array[i] > 10) { ... } } i might this: foreach(var value in array.where(item => item > 10)) { ... } i find myself needing first occurrence of value in list: var first = orders.firstordefault(order => order.items.count > 1); performance linq .net-4.0

ruby on rails - How do I proxy AJAX requests with Rack Middleware? -

ruby on rails - How do I proxy AJAX requests with Rack Middleware? - i'm developing rails application uses api backend ajax requests written sinatra. the api runs separately rails: rails: localhost:3000 api: localhost:9393 in production, we'll proxying requests api nginx. the problem don't have nginx in development mode, we're using thin. need sort of rack middleware can add together in development mode proxy requests me. can give me illustration of how this? perhaps rack::proxy: http://coderack.org/users/cwninja/middlewares/18-rackproxy use rack::proxy |req| if req.path =~ %r{identify api request regex here} uri.parse("http://localhost:9393/#{req.fullpath}") end end ruby-on-rails ajax ruby-on-rails-3 sinatra reverse-proxy

.net - When should I store config data in the database and not my web.config? -

.net - When should I store config data in the database and not my web.config? - normally, store application configuration info in web/app.config , associated xml configuration files. thinking maybe wasn't best way of handling all config data. are there suggestions when might more practical utilize 1 or other? i not have clear-cut rule, "rule of thumb" store locally configuration specific computer on programme runs, , store shared configuration info in database. we developed little library storing , editing/versioning our configuration in database. designed shared configuration store separate areas each application, , ability reuse config entries in multiple applications. store high-level configuration entries, such rules, query definitions, etc. in database. the location-specific configuration, such locations of plugin assemblies, connection string db-based configuration library, logging settings, etc. go "regular" web/app.config files. ...

xcode - IOS: delegate of many scrollViews -

xcode - IOS: delegate of many scrollViews - i have code: - (void)scrollviewdidscroll:(uiscrollview *)scrollview { [nsobject cancelpreviousperformrequestswithtarget:self]; [self performselector:@selector(scrollviewdidendscrollinganimation:) withobject:nil afterdelay:0.01]; } - (void) scrollviewdidendscrollinganimation:(uiscrollview *)scrollview{ [nsobject cancelpreviousperformrequestswithtarget:self]; if (scrollview == scrollv){ nslog(@"scroll di scrollv"); } } i don't understand why don't print in console "scroll di scrollv", set delegate scrollv, don't work did want this?: [self performselector:@selector(scrollviewdidendscrollinganimation:) withobject:scrollview afterdelay:0.01]; you weren't passing scrollview object if (scrollview == scrollv) never nail unless scrollv nil , i'm guessing isn't. ios xcode delegates uiscrollview

session - Why cookies dont expire after closing browser? -

session - Why cookies dont expire after closing browser? - in books , tutorials related web-programming written cookies expires when user close browser. cant understand why after closing browser(opera) can see list of cookies in "parameters" window. , how sites (for illustration facebook) identifier users after closing browser (session cookies must expire according books , tutorials)? cookies of 2 different types: session cookies, held in memory, , expire 1 time browser exits persistent cookies, have time-to-live, persisted on disk, , sent browser until time-to-live has elapsed. read http://en.wikipedia.org/wiki/http_cookie session cookies

c++ - How placement new can be done on stack -

c++ - How placement new can be done on stack - consider next codes: char mem[sizeof(char)]; void* p = mem; f = new(p) char; since memory variable mem should on stack so, why doesn't piece of memory collected automatically in end. the memory collected automatically. but destructor won't called automatically. when utilize placement new , should pair manual destructor call. char doesn't matter of course, since destructor trivial. c++ new-operator placement

dataviewwebpart - How to query a list by name using the SharePoint DataView Web Part? -

dataviewwebpart - How to query a list by name using the SharePoint DataView Web Part? - i have multiple dataview web parts getting items list in sharepoint 2010. web parts in subweb , info list in root web. can web part work fine specifying id of list: <dsp:dsquery select="/list[@id='guid goes here']" resultcontent="both" resultroot="rows" resultrow="row" columnmapping="attribute"> however! cannot utilize method of selecting list id because using export-spweb/import-spweb , moving subwebs different location (this command re-assigns ids... after export/import web parts break). want select list more definite... below (which not work): <dsp:dsquery select="/list[@name='list name goes here']" resultcontent="both" resultroot="rows" resultrow="row" columnmapping="attribute"> to summarize, need dataview web parts utilize dsquery goes list nam...

javascript - Fading in element with the same id -

javascript - Fading in element with the same id - i having troubles code. it's supposed this: start function clicking on element class "portfolioimage". fade out elements class "image". fade in element class "image" , id of "portfolioimage" (lets id of portfolioimage 3, fade in elements has class image , id 3). fade out element id "portfolioholder" , fade in element class "details". parenting: #portfolioholder (visible @ start of function) .portfolioimage #details (invisible @ start of function) .image my code: $(function(){ $("div.portfolioimage").click(function(){ var id = $(this).id; window.print($(this).id); $("div#portfolioholder").fadeout('slow', function() { // animation complete. }); $("div#details").fadein('slow', function() { // animation complete. }); $("div.image").each.fadeout(...

ejb 3.1 - Eclipselink library java.lang.ClassNotFoundException -

ejb 3.1 - Eclipselink library java.lang.ClassNotFoundException - i'm trying resolve problem classnotfoundexception 3 days, , can't find solution, i'm asking help, problem happens when seek utilize every method except find or findall on ejb entity beans. for illustration when seek utilize method remove(): ctx = new initialcontext(); remote = (categoriesremote) ctx.lookup("categoriesfacade/remote"); remote.remove(category); i not nice looking exception: exception in thread "thread-7" java.lang.runtimeexception: java.lang.classnotfoundexception: org.eclipse.persistence.indirection.indirectlist @ org.jboss.aop.joinpoint.methodinvocation.getarguments(methodinvocation.java:318) @ org.jboss.ejb3.stateless.statelesscontainer.dynamicinvoke(statelesscontainer.java:386) @ org.jboss.ejb3.session.invokablecontextclassproxyhack._dynamicinvoke(invokablecontextclassproxyhack.java:53) @ org.jboss.aop.dispatcher.invoke(dispatcher.j...

JQuery and Inline & External CSS -

JQuery and Inline & External CSS - i know next jquery remove attribute image tag $('img').removeattr('height'); in <img src="images/abc.jpg" alt="image 1" height="30px" width="30px" /> but how can same if img tag in in next format? <img src="images/abc.jpg" alt="image 1" style="height:30px; width:30px;" /> also how same if css in in external file <img src="images/abc.jpg" alt="image 1" class="imgclass1" /> if $('img').css('height', ''); jquery remove height style element removes property element if has been straight applied, whether in html style attribute jquery css

android - Smartphone accelerometer gestures algorightms -

android - Smartphone accelerometer gestures algorightms - i developing simple mobile app iphone , android platform , looking algorithms allow me trigger events (functions) when observe gesture using internal accelerometer. work phonegap utilizes html5 , javascript reads 3 coordinates (x,y , z) accelerometer on pre-set interval (e.g. every 0.04 sec.). i wrote simple function detects shaking motion , works quite fine primitive (it detects shaking, not direction) - , want observe other gestures such as: - tilt (to left/right) - shake up/down - shake left/right - circular motion - turn upside downwards - etc.... does have algorithms (or @ to the lowest degree mathematical formulas/functions) can calculate (detect) kind of gestures based on input values have (x,y,z , time interval each call)? i looking code in programming language (i rewrite javascript myself. in advance! dynamic time warping (dtw) job, recommend using fast dynamic time warping (fast dtw). mobile scena...

Can I use views_bulk_operations with the Drupal 7 core toolbar module? -

Can I use views_bulk_operations with the Drupal 7 core toolbar module? - i'm building drupal site right i'd prefer utilize views_bulk_operations administer standard content overview (admin/content) , user overview pages (admin/people). problem want utilize toolbar module (or it) give site admins ability browse pages generated views_bulk_operations (admin/content2 , admin/people2). doesn't seem possible right now. toolbar module automatically adds pre-defined links based on users permissions, , there doesn't appear way create changes links. any ideas? or, perhaps, alternatives core toolbar module? thanks! (i asked same question here, thought i'd have improve chance here on stackoverflow.) i figured out can utilize quickbar module accomplish want. drupal drupal-7 drupal-views

javascript - How to get the current Facebook page ID for canvas iframe app? -

javascript - How to get the current Facebook page ID for canvas iframe app? - i've got rails app that's running in iframe in canvas app page. what need current page id pass iframe. basically trying have iframe show x based on page app setup on. as described in page tab tutorial: when user selects page tab, receive signed_request parameter 1 additional parameter, page. parameter contains json object id (the page id of current page), admin (if user admin of page), , liked (if user has liked page). canvas page, not receive user info accessible app in signed_request until user authorizes app. javascript ruby-on-rails facebook

asp.net mvc 3 - MVC3 Windows input type="file" size limit -

asp.net mvc 3 - MVC3 Windows input type="file" size limit - i have mvc3 c#.net web app. in html view, using standard windows file input <input style="border:thin solid #ccc;width:270px; background-color: #ffffff;" type="file" name="name" id="name"/> it's working fine except big files. can upload 2mb file bit not 4mb file. there max file size input type or can set maxsize somehow? try changing maxrequestlength in web.config. <system.web> <httpruntime maxrequestlength="4096" /> </system.web> the value in kilobytes. 4096 default value, file might larger maybe seek higher number. asp.net-mvc-3 file-upload input

django - Is this a good python design? -

django - Is this a good python design? - i'm using django , wrote decorator take away of repetitive code found ajax views , want know sentiment (too basic, bad design, seek instead, ok, etc). def ajax_only(func): def _ajax_only(request,*args,**kwargs): if not request.is_ajax(): homecoming httpresponse('<p>ajax not supported.</p>') else: homecoming func(request,*args,**kwargs) homecoming _ajax_only yes, looks typical , effective utilize of decorator. python django decorator

serialization - Serialize and jquery object -

serialization - Serialize and jquery object - i tried utilize jquery object serialize of values in form. tried using div id surrounded fields needed this: var test = $("#div_tab1").serialize() , empty var test = $("#form1").serialize() worked. shouldn't first illustration work? i using version 1.6.4 "shouldn't first illustration work?" no, need phone call on form, or on set of input elements. jquery serialization

php - How to make Phproxy work over https -

php - How to make Phproxy work over https - i'm using phproxy , want allow https sites work. possible? phproxy php application bypassing blocked sites redirecting traffic through hosted website. works in non secure websites can't open https sites. php https proxy

actionscript 3 - adding a object to another object in as3 -

actionscript 3 - adding a object to another object in as3 - ok have character on screen , when moves photographic camera follows(thanks manifest222 on youtube) have wall player cant go through. have boxes adding stage want box adds onto object hers code. package { import flash.display.sprite; import flash.display.movieclip; import flash.events.event; import flash.events.mouseevent; import flash.text.textfield; import flash.display.stage; public class main extends movieclip { // player public var characterendmc:movieclip = new charendmc(); public var arrayofbarrier:array = new array(); //box private var boxamount:number=0; private var boxlimit:number=20; private var _root:object; //$txt public var money:int=0; public var gold:int=0; public var my_scrollbar:makescrollbar; //$$ public var testnumber:number=1; //enemy1 private var e01amount:number=0; private var e01limit:number=2; pu...

php - Sphinx returns inconsistent result set depending on sorting -

php - Sphinx returns inconsistent result set depending on sorting - i'm trying implement multilingual indexes web application i'm developing. @ moment, records exist in few languages, english, malay & standard arabic (but not separated different columns). english language stemmer enabled. only 2 indexes built, stemmed , non-stemmed indexes. i'm having problem stemmed index, result set returned not consistent, depending on sort column. these 2 queries (from stemmed index), each returns different number of total results, although difference between them sort order. select * test1stemmed match('@institution universiti') grouping art_id order art_title_ord asc; select * test1stemmed match('@institution universiti') grouping art_id order art_title_ord desc; however, if same queries run on non-stemmed index, numbers of results equal. i'm having same problem sphinx php api: $sp = new sphinxclient(); $sp->setserver('localhost...

javascript - jquery $(this).attr(…) returns undefined -

javascript - jquery $(this).attr(…) returns undefined - i'm trying title of option element, keeps returning undefined. happens $(this).attr("name") …and $(this).attr("value") , curiously $(this).val() works (as expected). yet, i'm able set value $(this).attr("value", "baz") . fiddle: http://jsfiddle.net/jshado1/jgajc/1/ this points <select> element. selected option, use: this.options[this.selectedindex] full code (you can safely disclose $opt 's jquery wrapper, , utilize $opt.title , $opt.name , these safe across browsers): $('select').change(function() { var $opt = $(this.options[this.selectedindex]), t = $opt.attr("title"), n = $opt.attr("name"), v = this.value; $("#name").text("name: "+n); $("#title").text("title: "+n); $("#value").text("value: "+v); }); another metho...

java - Handling TransactionTimeout Exception in EJB -

java - Handling TransactionTimeout Exception in EJB - i have ejb method called methoda() calling ejb method called methodb() starts new container managed transaction. in methodb, forcing transaction timeout rightly caught caughtb , not propagated methoda. surprised methoda receives exception. missing soemthing here? methoda() { seek { methodb(); system.out.println("print me!"); } catch(exception e) { system.out.println("shouldn't here"); } } @transactiontimeout(5) //5 sec timeout methodb() { seek { thread.sleep(6000); } catch(throwable t) { system.out.println("eating exception.."); } } the first method should have never caught exception (ejbtransactiontimeoutexception) because methodb have eaten it. seeing output of "shouldn't here" instead of "print me!". makes me wonder if container throws yet exception of ejbtransactiontimeoutexception after methodb completed although has thrown timeout...

javascript - display input field on new line ( based on radio select ) -

javascript - display input field on new line ( based on radio select ) - ok found great code on stack. have adapted slightly. but in essence have radio box group, in form. , onclick of 1 of these radio buttons, input field displayed. i need show input field on new line ( preferably new label ) struggling. the code is: html <div class="s_row_2 clearfix"> <label><strong>price</strong></label> <div class="s_full"> <label class="s_radio"><input type="radio" checked="checked" name="r" id="r1" onchange="disabletxt()"/> free</label> <label class="s_radio"><input type="radio" name="r" id="r2" onchange="disabletxt()"/> swap / trade</label> <label class="s_radio"><input type="radio" name=...

c# - Connecting with remote mysql database, getting the error "Unable to connect to any of the specified MySQL hosts" -

c# - Connecting with remote mysql database, getting the error "Unable to connect to any of the specified MySQL hosts" - i making application connects remote mysql database cpanel account. created database on cpanel business relationship , defined username , password it. using mysqlconnector. far have written next code: using mysql.data.mysqlclient; mysqlconnection c = new mysqlconnection("server = 64.191.12.54; database = alyataco_test4application; user id = xxxxxxxx; password = xxxxxxxx"); c.open(); but got error : mysql.data.mysqlclient.mysqlexception: unable connect of specified mysql hosts. i saw connect remote mysql database visual c# didn`t help too your connection string seems wrong. try: mysqlconnection c = new mysqlconnection("server=64.191.12.54; database=alyataco_test4application; uid=xxxxxxxx; pwd=xxxxxxxx"); see http://www.connectionstrings.com/mysql more connection string exemples. c# mys...

javascript - Object has no method, error in script w/jQuery -

javascript - Object has no method, error in script w/jQuery - i have function student(){ var that=this; that.savechanges=function(){ //..... } function init(){ that.savechanges1(); } init(); } <script type="text/javascript"> $(document).ready(function () { var student=new student(); }); </script> with jquery-1.4.4.min.js, not save changes, because made error, rest of application work. jquery-1.7.1.min.js error object # has no method 'savechanges1' , rest of application not work. or that.savechanges1 not function [break on error] (77 out of range 4) what should work jquery-1.4.4.min.js? i think should seek not create errors in javascript... it's blows up, @ to the lowest degree warns doesn't work! perhaps should seek running javascript or selenium tests , perhaps jslint check create sure don't break of javascript functionality! javascript jquery

sql server - How to merge rows of SQL data on column-based logic? -

sql server - How to merge rows of SQL data on column-based logic? - i'm writing margin study on our general ledger , i've got basics working, need merge rows based on specific logic , don't know how... my info looks this: value1 value2 location date category debitamount creditamount 2029 390 deed 2012-07-29 costs - widgets , gadgets 0.000 3.385 3029 390 deed 2012-07-24 sales - widgets , gadgets 1.170 0.000 and study needs display 2 columns so: plant date category debitamount creditamount deed 2012-07-29 widgets , gadgets 1.170 3.385 the logic bring together them contained in value1 , value 2 column. lastly 3 digits of value 1 , 3 digits of value 2 same, rows should combined. also, 1st digit of value 1 been 2 sales , 3 costs (not sure if matters) ie 2029-390 money coming in widgets , gadget...

How to Automate or Move (Silverlight) xap file to 14 hive ClientBin -

How to Automate or Move (Silverlight) xap file to 14 hive ClientBin - i using silverlight project in sharepoint 2010.i have requirement of using wsp builder project building soultion , have configured layout construction depends on 14 hive. in dev machine have configured post build event command in project properties tab xcopy sample.xap "c:\program files\common files\microsoft shared\web server extensions\14\template\layouts\clientbin\" /y so whenever build silverlight project automatically sample.xap file moved 14 hive client bin when build wsp project using wsp builder clientbin folder not available in it. when right click clientbin folder in visual studio solution sample.xap file nowadays within wsp not there ? so provide solution automate or move xap file 14 hive clientbin folder @ time of deploying wsp in testing server ? just phone call context menu sharepoint project in visual studio. add together -> sharepoint mapped folder... in next window...

Should I store an image in MongoDB or in local File System (by Node.js) -

Should I store an image in MongoDB or in local File System (by Node.js) - i utilize node.js project. should store image in local file system, or should store in mongodb? which way more scalable? the scalable solution utilize shared storage service such amazon's s3 (or craft own). this allows scale horizontally lot easier when decide add together machines application layer, won't have worry migration nightmares. the basic thought behind maintain storage layer decoupled application layer. using thought create node.js process on separate machine accepts file uploads writes them disk. node.js mongodb filesystems scalability

.net - Hit testing with new UIElements -

.net - Hit testing with new UIElements - i creating wpf-usercontrol needs check new uielements not overlap existing uielements. code below works fine when baserectangle added canvas before phone call button1_click, if rectangle added in button1_click method hittest not work. <window x:class="wpfcollisiontest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <canvas height="246" horizontalalignment="left" margin="12,12,0,0" name="canvas1" verticalalignment="top" width="479"></canvas> <button content="button" height="35" horizontalalignment="left" margin="12,264,0,0" name="button1" verticalalignment="top...

If Statement within for loop - Matlab -

If Statement within for loop - Matlab - him working on modelling wind turbine using turbine specific parameters 3 manufacturers code site_speed = xlsread('test.xlsx','sheet1'); % wind speed info recorded on site air_density = xlsread('test.xlsx','sheet2'); % air density info recorded on site turbine_parameters = xlsread('windparameters.xlsx'); % wind turbine unit database ref_wind_speed = turbine_parameters(:,1); % wind speed wind turbine unit database file turbine_parameters ref_output = turbine_parameters(:,2:4); % powerfulness output wind turbine unit database file turbine_parameters density_correct = (air_density./air_density_ref); k = 1 : size(ref_output, 2) power_out(:,:,k) = density_correct.* interp1( ref_wind_speed, ref_output(:,k), site_speed, 'nearest'); % xlswrite('this_file2.xlsx', power_out(:,:,1), 'sheet1'); % xlswrite('this_file2.xlsx', power_out(:,:,2), 'sheet2'); % xl...

highlight - Android autofocus -

highlight - Android autofocus - i new android , created android application consisting of many images , few buttons suppose john, want whenever person clicks on john, images names including john highlighted. thanks in advance. for exmple of jhon: just follow steps: 1) setonitemclicklistener on images from find selected image throgh function getresources() can fetch name that. 2)after fetchting name fire 1 query "selected name " should display result name "jhon" 3)display name image per requirement. or 4)if want display same can let me know if have query it. android highlight android-imageview

c# - How to access value of usercontrol in asp.net -

c# - How to access value of usercontrol in asp.net - i have web application assigns time duration students in day. kind of scheduler. so have user command timeperiod , command loaded dynamically on web page. but number of user command on page varies have user code dynamically creates list of user control. for illustration purpose have set i value 2, varies looks this: for(int i=0;i<2;i++) { timeperiod ib = (timeperiod)loadcontrol("timeperiod.ascx"); //ib.rightarrowimgurl = "~/images/wcm-circle-arrow-button.png"; span_templist.controls.add(ib); } when user done making changes time days. i.e. in user command on page. the page has button takes changes database. but problem arises here how access values of these text boxes values page has been rendered html. this user command code:--- <%@ command language="c#" autoeventwireup="true" codebehind="timeperiod.ascx.cs" inherits="classma...

delphi - Control IDs in Java/SWT application -

delphi - Control IDs in Java/SWT application - i have third-party application , need read values of controls utilize them in own application developed in delphi. other application runs on windows , written in java using swt framework. unfortunately (control) ids of controls need read values different everytime start third-party application. seems java/swt framework generates new windows/control ids each time ui of application created. there other identifier use? you can utilize windows properties id persistent. the name of property swt_object_index: nprop := getprop(handle, 'swt_object_index'); the homecoming value of getprop() id of window. handle handle control. however, need go through kid windows find command id looking for. please note ids alter if application updated. java delphi swt