Posts

Showing posts from May, 2014

jboss - How to setup apache redirect or custom 401 document on Kerberos SSO login failure -

i have working kerberos sso setup, use apache , jboss mod_jk. apache protecting (by kerberos) auto-login.htm page following configuration: <location /auto-login.htm> authtype kerberos authname "kerberos active directory login" krbmethodnegotiate on krbmethodk5passwd on krbauthrealms krb.somedomain.com krbservicename http/server.somedomain.com@krb.somedomain.com krb5keytab /etc/krb/krb5.keytab krbverifykdc on krbauthoritative on require valid-user #errordocument 401 /login.htm </location> this works 100% , able login kerberos/sso , read remote_user variable in java application. now problem want redirect unprotected login.htm if user unable log in via kerberos/sso. solution had in mind set 401 errordocument, when set uncommenting #errordocument 401 in code above redirects login.htm returning 401 request user credentials inherently part of kerberos/sso authentication process...

Haskell type error using inferred type -

i created data type hold basic user information , loaded ghci. used ghci @ new data types type signature. copied type signature ghci source file , tried reload file. ghci threw error. the code , error below. my question is, why throwing error. used type inferred ghci. user :: int -> string -> string -> string -> string -> user data user = user { userid :: int, login :: string, password :: string, username :: string, email :: string } deriving (show) prelude> :r user [1 of 1] compiling user ( user.hs, interpreted ) user.hs:3:0: invalid type signature failed, modules loaded: none. you may declare type of value (such function), may not declare type of data type or of data constructor using type declaration syntax values. in fact, declaring full type of data type , data constructor when define them, there no need additional type d...

.net - What does '??' mean in C#? -

possible duplicate: what 2 question marks mean in c#? i'm trying understand statment does: "??" mean? som type if if-statment? string cookiekey = "searchdisplaytype" + key ?? ""; it's null coalescing operator. means if first part has value value returned, otherwise returns second part. e.g.: object foo = null; object rar = "hello"; object = foo ?? rar; == "hello"; // true or actual code: ienumerable<customer> customers = getcustomers(); ilist<customer> customerlist = customers ilist<customer> ?? customers.tolist(); what example doing casting customers ilist<customer> . if cast results in null, it'll call linq tolist method on customer ienumerable. the comparable if statement this: ienumerable<customer> customers = getcustomers(); ilist<customer> customerslist = customers ilist<customer>; if (customerslist == null) { customerslist...

linux - Writing output from a socket -

i have 2 machines , b. in machine a, do echo "hello world" > /dev/tcp/{bs_ip}/12345 in machine b, how write script runs in background, listens on port 12345, , prints whatever receives port 12345 stdout? btw both machines running red hat enterprise linux 4. thanks you can using netcat: nc -l -p 123456 if want able handle multiple connections have use loop.

C# .NET - how to determine if directory is writable, with or without UAC? -

i'm working on piece of software needs copy file given directory on filesystem. needs work on both uac-aware oss (vista, 7) xp. around issue of writing directory uac elevation required, app kicks off process manifest states uac required. generates prompt , copy when user confirms. from can see, directory can have 3 different logical permission states - writeable without uac elevation, writeable uac elevation , not writeable. my question this: given directory, how reliably determine whether current user can copy (and potentially overwrite) file directory, , if can, how determine if uac elevation required? on xp, simple checking whether 'allow write' permission granted, on vista / 7, there directories permission isn't granted, action still possible uac. we have method writeaccess on files, can adapt directories (directory.getaccesscontrol , on) /// <summary> checks write access given file. /// </summary> /// <param name=...

java - Spring MVC Mapping problem -

i have thought simple spring mvc app. however, can seem set requestmappings correctly. what's strange logs show url mapped proper controller, yet dispatcher cant seem find @ runtime. suggestions appreciated: log info: mapped url path [/app/index] onto handler [com.noisyair.whatisayis.web.maincontroller@420a52f] jan 11, 2010 2:14:21 pm org.springframework.web.servlet.handler.abstracturlhandlermapping registerhandler info: mapped url path [/app/index.*] onto handler [com.noisyair.whatisayis.web.maincontroller@420a52f] jan 11, 2010 2:14:21 pm org.springframework.web.servlet.handler.abstracturlhandlermapping registerhandler info: mapped url path [/app/index/] onto handler [com.noisyair.whatisayis.web.maincontroller@420a52f] jan 11, 2010 2:14:21 pm org.springframework.web.servlet.handler.abstracturlhandlermapping registerhandler info: mapped url path [/app/tags/{tag}] onto handler [com.noisyair.whatisayis.web.searchbytagcontroller@7b3cb2c6] jan 11, 2010 2:14:21 pm org.spr...

php - News Feed Database Design Efficiency -

greetings all, i've seen similar questions asked before no conclusive or tested answers. i'm designing news feed system using php/mysql similar facebooks. seeing table grow quite large -- inefficiency result in significant bottleneck. example notifications: (items in bold linked objects) user_a , user_b commented on user_c's new album . user_a added new vehicle [his/her] garage. initially, implemented using excessive columns obj1:type1 | obj2:type2 | etc.. it works fear it's not scalable enough, i'm looking object serialization. so, example new database set so: news_id | user_id | news_desc | timestamp 2643 904 {user904} , {user890} commented on sometimestamp {user222}'s new {album724}. anything inside {'s represents data serialized using json. is smart (efficient / scalable) way move forward? will difficult separate serialized data rest of str...

php email send to multiple address not working -

hi friends why not working ? while doing print_r , $emails ( to) not showing emails. it's fine when send 1 person. $mails = array('abc@gmail.com','123@email.com'); $emails = implode(",",$mails); $from= 'abc@imail.com); $subject = 'hello'; $body = 'test'; send_email($from,$emails,$body,$subject); try changing to $mails = array('abc@gmail.com','123@email.com'); foreach($mails $k=>$m){ $mails =trim($mails[$k]); } $emails = trim(implode(", ",$mails)); $from= 'abc@imail.com'; $subject = 'hello'; $body = 'test'; send_email($from,$emails,$body,$subject);

struts2 - Populating dropdownlist based on other dropdwonlist in struts 2 -

i have 2 drop-down lists populated db. want populate second drop-down dynamically based on selected item in first drop-down. can me? in advance. struts 2 has double select tag can this: http://struts.apache.org/2.1.6/docs/doubleselect.html

javascript - Removing duplicates in a comma-separated list with a regex? -

i'm trying figure out how filter out duplicates in string regular expression, string comma separated. i'd in javascript, i'm getting caught how use back-references. for example: 1,1,1,2,2,3,3,3,3,4,4,4,5 becomes: 1,2,3,4,5 or: a,b,b,said,said, t, u, ugly, ugly becomes a,b,said,t,u,ugly why use regex when can in javascript code? here sample code (messy though): var input = 'a,b,b,said,said, t, u, ugly, ugly'; var splitted = input.split(','); var collector = {}; (i = 0; < splitted.length; i++) { key = splitted[i].replace(/^\s*/, "").replace(/\s*$/, ""); collector[key] = true; } var out = []; (var key in collector) { out.push(key); } var output = out.join(','); // output 'a,b,said,t,u,ugly' p/s: 1 regex in for-loop trim tokens, not make them unique

android - Using Parcel to clone an object? -

i have class has implemented parcelable. can following create new instance of class?: foo foo = new foo("a", "b", "c"); parcel parcel = parcel.obtain(); foo.writetoparcel(parcel, 0); foo foo2 = foo.creator.createfromparcel(parcel); i'd foo2 clone of foo. ---------------------- update ------------------------------- the above not work (all foo members null in new instance). i'm passing foos between activities fine, parcelable interface implemented ok. using below works: foo foo1 = new foo("a", "b", "c"); parcel p1 = parcel.obtain(); parcel p2 = parcel.obtain(); byte[] bytes = null; p1.writevalue(foo1); bytes = p1.marshall(); p2.unmarshall(bytes, 0, bytes.length); p2.setdataposition(0); foo foo2 = (foo)p2.readvalue(foo.class.getclassloader()); p1.recycle(); p2.recycle(); // foo2 same foo1. found following q: how use parcel in android? this working ok, can go code, not sure if there's shorter wa...

agile - Should a Product Owner look after more than one product? -

in scrum or agile team advisable product owner involved in more 1 product? have product owner enterprise system , "sub" product owners components of system? i.e. in retailer have po enterprise system drives "sub" po's retail, supply chain , manufacturing? be interested in how others deal scrum teams in enterprise environment many stakeholders in functional silos. in scrum or agile team advisable product owner involved in more 1 product? first of have understand won't have objective answer in scrum. have inspect , adapt. in scrum guide (written inventors of scrum) mentioned po should not handle more 2 products mention po succeed (s)he has take full responsibility of product, , organisation has respect pos decision.the po "pig" of product backlog, 1 or 2 or more products, if po , stakeholders can handle try it, , inspect , adapt. , there various factors how complex products are, , how speacialised product owner in them , how bandwidt...

asp.net mvc - Unit testing all controllers from a single test -

i created action filter want apply of controllers (including new ones introduced later on). i figure useful unit test 1 cycles through each controller , verifies if criteria met, action filter impact result. is wise create unit test hits multiple controllers? can share code similar test has proven useful? edit: realized testing action filter might problematic. still, if have thoughts share on mass testing of controllers... it not recommended test more 1 thing @ time in tests. you should avoid logic in tests (switch, if, else, foreach, for, while) test less readable , possibly introduces hidden bugs. many simple, readable, , therefore maintainable tests testing 1 thing each far preferable 1 test lot of complexity. response edit testing filters can achieved separating filter attribute. here example: loadmembershiptypelistfilter class has 'seams' needed use test fakes. logic in filter is tested. public class loadmembershiptypelistfilter : iaction...

serialization - Sync only parts of a c++ vector using Boost.MPI -

i have std::vector (let's call "data_vector") want synchronize parts of across processors. i.e., want send values arbitrary indexes in vector other processors. i can boost's send() functions if want send whole vector, need send small portion of it. right have separate vector (let's call "idx_vector") containing indexes of data_vector want send, can change format if necessary. what's best way this? don't want iterate through , sync each index separately. copy values 1 contiguous vector , sync that, rebuild it, wonder if boost has better way. boost.serialization idx_vector containing pointers data_vector locations work? how that? serialization should work, since under hood mpi implementation sending array of bytes. mpi method of doing define mpi datatype picks out indices want send, in case mpi_type_indexed right option.

Make CruiseControl.NET MSBuild Task Work The Same As VS 2008 Build -

this similar these 2 questions: why msbuild fail command line vs2008 succeeds? how cmd line build command vs solution? when build visual studio 2008, build succeeds. if build command line using msbuild comes .net framework 3.5 install, fails. if use visual studio 2008 command prompt gets installed vs2008 succeeds. answers (which partially understood) first 2 questions linked seem reason why fails command line. question specific cruisecontrol.net. how can apply answers cruisecontrol.net msbuild task successful after future changes long builds correctly in vs 2008? thanks in advance help! the first step project build correctly using msbuild command line. me matter of installing missing dependencies on ci server list. 1) needed download , install power toys compact framework 3.5 enable building .net compact framwork 3.5 project. alternatively have installed visual studio 2008 professional edition. 2) missing sql server compact 3.5. after downloading , installing w...

html - What are best practices to make layout scalable? -

what technical difference between fluid vs liquid vs elastic vs flexible css layouts? are these same or different technically? is fluid layout better both mobiles , computer user? i think there 2 properties make fluid layout "em" , "%". and use "em" font in fixed width layouts. other things need make site flexible? part should flexible , better fixed? or should make whole thing flexible? i suggest read articles subject. smashing magazine has great post it, see which 1 right you . have definitions these layouts , believe accurate: fixed: a fixed website layout has wrapper fixed width, , components inside have either percentage widths or fixed widths. important thing container (wrapper) element set not move. no matter screen resolution visitor has, or see same width other visitors. fluid: in fluid website layout, referred liquid layout, majority of components inside have percentage widths, , ...

Resolving Problems with jQuery and Unordered List Loading -

i'm building simplistic unordered list tree in xhtml multiple levels deep. way works click parent node, , uses jquery .load() api make ajax call server see if node has children. if does, inserts nodes inside. when click parent link again, .remove() remove children. everything works fine in safari, chrome, , firefox. in ie6, ie7, ie8, , opera, it's breaking. in ie's, code works when expanding parents show children. when click parents hide children again .remove(), it's going children , doing remove of children, rather itself. in opera, code expands moves margins on expanded. then, on remove, exhibits same problem ies. what causing strangeness? sample posted here: http://volomike.com/downloads/sample1.tar.gz ok, volomike! looked @ code there few problems: first, when use load , doesn't replace selected node, replaces contents . so, calling load on li returning same li in ajax result. subsequently, getting this: <li id="node-7...

php - Refactoring of model for testing purpose -

i want refactor model can write unit test it. have dependencies. can point me in right direction how can remove these dependencies? class customer { public function save(array $data, $id = null) { // create or update if (empty($id)) { $customer = new \entities\customer(); } else { $customer = $this->findbyid((int) $id); } $birthday = new datetime(); list($day, $month, $year) = explode("/", $data['birthday']); $birthday->setdate($year, $month, $day); $customer->setfirstname($data['firstname']); $customer->setlastname($data['lastname']); $customer->setcompany($data['company']); $languagemodel = new application_model_language(); $customer->setlanguage($languagemodel->findbyid($data['language'])); $resellershopmodel = new application_model_resellershop(); $customer->s...

multithreading - How can you visually represent which threads lock on which objects in Java while debugging? -

using following textbook thread wait/notify example, there tool (eclipse plugin?) tracks which thread locks on which object while stepping through , debugging? tool visually displays connections in way ideal if possible. public class threada { public static void main(string[] args) { threadb b = new threadb(); b.start(); synchronized (b) { try { system.out.println("waiting b complete..."); b.wait(); } catch (interruptedexception e) { } system.out.println("total is: " + b.total); } } } class threadb extends thread { int total; public void run() { synchronized (this) { (int = 0; < 100; i++) { system.out.println(i); total += i; } notify(); } } } eclipse support already. there symbol in stack of debug window synchronized is. if ena...

oop - Is there any difference between UML Use Case "extends" and inherance? -

or "extends" use case inheriting another? --update just clarification, i've read books , made lot of diagrams. can't see difference between extends on uml , on inherance. bill said, uml extends indicates optional behavior, in inherance either new behavior can or not use. so, what's difference? this similar inheritance. see detailed description of concept here. enjoy!

PHP - How to send emails to address on MYSQL? -

how can send emails emails on database? e.g. here format of mysql. mysql -- table = users --- column = email. need send emails of email on column "email". simple ready use php script sending mail mysql data <?php mysql_connect("localhost", "mysql_user", "mysql_password") or die("could not connect: " . mysql_error()); mysql_select_db("mydb"); $result = mysql_query("select email mytable"); while ($row = mysql_fetch_array($result, mysql_num)) { sendmail($row[0]); } mysql_free_result($result); function sendmail($to){ $subject = 'the subject'; $message = 'hello'; $headers = 'from: webmaster@example.com' . "\r\n" . 'reply-to: webmaster@example.com' . "\r\n" . 'x-mailer: php/' . phpversion(); mail($to, $subject, $message, $headers); } ?>

networking - How to detect network breakage using java program? -

is there way detect network breakage or weaker network, using java? you can intermittently test http connection known host such google , detect connectionexceptions urlconnection con = new url("http://www.google.com/").openconnection(); con.setusecaches(false); con.setallowuserinteraction(false); while(true) { try { con.connect(); con.getcontenttype(); // make sure connection works // sleep interval } catch(ioexception e) { // handle , break } }

java - Clean Working directory of Tomcat in Eclipse -

Image
when work in on servlet application in eclipse, have choose clean working directory in server tab of eclipse changes visible in browser. there way make sure have build servlet , changes visible? doubleclick tomcat entry in servers view, go publishing section , select automatically publish when resources change . it way won't happen that "immediately". might take around 3 seconds, should see activity in server logs. although slow starter, glassfish publishes in subsecond. may consider instead fast development.

php - website hostname and docroot -

is there way in php hostname , document root server? i'd without storing them variables in php code. reluctant use $_server because have heard not reliable , subject attack. how can done on virtual host? reliable , safe method exist? $_server['document_root'] reliable $_server['server_name'] isn’t (see chris shiflett’s server_name versus http_host ). if apache’s usecanonicalname enabled canonical name shown.

localization - Problem with toolbar in Excel 2003 -

i have simple excel addin build in visual studio 2008 excel 2003, creates toolbar buttons. when debug it, system format set "english (united states)" works great, without problems. however, addin going used system format set "french (france)" too, , when try debug addin under configuration, toolbar (which created addin) not being shown. while i'm debugging can see methods create toolbar executed , code returns fine, yet can't see in excel, , if switch format english works again. does know reason? i had similar problem add-in built excel 2000. although tool bar show, nothing on toolbar. able correct issue downloading office multilanguage pack 2003. here link it, assuming not have installed may worth shot. http://office.microsoft.com/en-us/ork2003/ha011402201033.aspx

java - Default values of instance variables and local variables -

i read java provides default values class properties not local variables. correct? if reason behind this? when doing good, why not way? thanks, roger standard local variables stored on stack , aren't created until initialized. if local variable isn't used, doesn't go on stack. member variables, however, allocated in heap, , thusly have default placeholder (null reference or default primitive).

javascript :OnMouseout event being called when i move the cursor over an element without going OUT of the element -

i have image in page , in "onmouseover" event of image call javascript function show tooltip , in "onmouseout" of image, call method hide tooltip.now found when place cursor on image,its calling method show tooltip div.and if move mouse within image,its calling onmouseout event(even if not out of image).how can stop . want onmouseout called when cursor out of image ? thoughts ? in advance here how call it <img src="images/customer.png" onmouseout="hidecustomerinfo()" onmouseover="showcustomerinfo(485)" /> and in javascript function showcustomerinfo(id) { var currentcustomer = $("#hdncustomerid").val(); if (currentcustomer != id) { // stop making ajax call everytime when mouse move on same image $.get('../lib/handlers/userhandler.aspx?mode=custinfo&cid=' + id, function (data) { strhtml = data; }); tooltip.show(strhtml); // method in jquery pluggin $(...

visual studio - how to implement copy protection for installing my .net application -

i have gone through several samples in web.i understood protect software giving password each application.i not asking abstract concept because had developed 1 concept mine.my question can implement codes ? i read various options in visual studio such setup project,clickonce.in setup project can't add executables or script password protect before installing application. i want user give password during installation installation process proceeds , finished succesfully how can achieve in visual studio ? to honest, way know able in visual studio (your actual question) write own application installer. password coded installer, easy hack. recommend either technology or addin. why not copy protect application , off shelve plug in security? in area wouldn't re-invent wheel - it's not worth effort (and therefore cost)

C# Lists: How to copy elements from one list to another, but only certain properties -

so have list of objects number of properties. among these properties name , id . let's call object extendedobject. i've declared new list of different objects have only properties name , id . let's call object basicobject. what i'd convert or copy (for lack of better words) list of extendedobject objects list of basicobject objects. know c# lists have lot of interesting methods can useful, wondered if there easy way effect of: basicobjectlist = extendedobjectlist.somelistmethod<basicobject>(some condition here); but realize may end looking nothing that. realize loop through list of extendedobjects, create new basicobject each extendedobject's name , id, , push onto list of basicobjects. hoping little more elegant that. does have ideas? much. it depends on how you'd construct basicobject extendedobject , use convertall method: list<basicobject> basicobjectlist = extendedobjectlist.convertall(x => new basicobject ...

vb.net - .NET debugging an existing project -

background / disclaimer first of all, please feel free skip entirely if can understand questions below. i'm still fresh new .net, elder monkey on bad old asp in regular vb. i got company legacy .net vb files , have couple of huge projects, on 50mb of files , 1gb whole project , debugging them haven't been easy. i've read through w3schools tutorial , did many google researchs point in can't make work. , unlike in similar question don't think simple issue. i don't know if projects mvc or regular web application, told use " other project types > visual studio solution > blank solution " , " add existing web site " that. no further instructions or orientation, see have dlls , makes me believe not mvc. anyway, whichever or many other ways i've tried add files visual studio, never use debug 1 of them. 1 works fine enough, can @ least see running locally alike webserver. other gives me many random errors , warnings "co...

iPhone built-in controller to display a collection of images in cool 3D landscape view -

for reason, can't seem locate documentation above support within foundation. talking view used applications show collection of images in cool 3d view can flip through set, ipod application view of albums. you're looking cover flow. believe unpublished api. open flow viable replacement.

Multiple concurrent WCF calls from single client to Service -

i have service calls service on machine , number of concurrent connections can 2. have tried changing throttling on wcf service behaviour no effect. have read because of http limit of 2 concurrent connections client machine server. how overcome this? os on both machines server 2003. config: <servicebehaviors> <behavior name="myservicetypebehaviors"> <servicemetadata httpgetenabled="true" /> <servicethrottling maxconcurrentcalls="100" maxconcurrentinstances="100" maxconcurrentsessions="100"/> </behavior> </servicebehaviors> <system.net> <connectionmanagement> <add address="*" maxconnection="100" /> </connectionmanagement> you have overcome client code (from service calls other service). use code in initialization of service application increase connections: system.net.servicepointmanager.defaultconnectionlimit ...

amazon ec2 - ASP.NET on cloud server -

my website running quite , serving lacks of pages on daily basis. want add 1 more web server share load on server @ heavy traffic times. instead, can go amazon elastic compute cloud (ec2) or other cloud service alternative solution. in cloud server environment, need install multiple instances traffic increases or single instance can scale based on traffic? i suggest windows azure you're right in have multiple instances scale meet traffic. azure platform design application roles (chunks of functionality), make sense create multiples of, page displays store contents should highly scalable, whereas login portion may not. windows azure runs services microsoft xbox live , bpos offerings, plus there great tools develop azure cloud. can read more cloud development @ msdn .

c++ - How do I build a game in C with actors programmed in Lua? -

i want build strategy game using c , lua. c++ option. i create environment player can move around. in same environment, other actors (programmed in lua) should able move around. lua code should control how move. it sounds simple enough, wonder design approach project. as simple example can imagine matrix playing field. how write code player , several other (scripted) actors can move through simultaneously? the lua code of actors should able information playing field. example: actor programmed follow fixed path, looking around along way. if actor detects other player, change behavior follow other player. i imagine problem has been solved many times, can't seem find simple example. any links other designs , original ideas appreciated. the question broad let me suggest best way start break problem/question smaller pieces. you mentioned trying create strategy game use matrix playing field , contain movable actors. have decide: what kind of data structure s...

c# - LINQ InvalidCastException error -

i'm getting "invalidcastexception" (occurred in system.data.linq.dll) in function: public user getuserbykey(guid key) { return userstable.firstordefault(m => m.userkey == key); } which called here: membershipuser mu = membership.createuser(user.username, user.password, user.email, null, null, true, guid.newguid(), out status); user new_user = _usersrepository.getuserbykey((guid)mu.provideruserkey); mu.provideruserkey guid object encapsulated in general object type should fine :/ thanks help! since mentioned it's nvarchar(100) in comment earlier try this: guid key = new guid(mu.provideruserkey.tostring()); // object string user new_user = _usersrepository.getuserbykey(key); also, sql server has uniqueidentifier data type represent guid you may consider using .

Chrome command line remote control on Linux? -

can control running google chrome instance command line? i'm hoping there's -remote flag allow me send in javascript or somesuch. in particular, reload topmost document on foremost window. take @ http://code.google.com/p/chromedevtools/ . might can use debugging protocol job. there ruby client . there chromix .

ssl - How to set SSLContext options in Ruby -

i need create sslsocket in ruby 1.8+ talk encrypted service. want set ssl options on sslcontext object (it calls ssl_ctx_set_options in underlying openssl library). not seeing obvious way this. this using openssl::ssl::sslcontext interface. as point of reference, analogous calling set_options() in python's pyopenssl library. example: ctx = openssl::ssl::sslcontext.new ctx.set_params(:options => openssl::ssl::op_ephemeral_rsa | openssl::ssl::op_no_sslv2) # or ctx.options = openssl::ssl::op_ephemeral_rsa | openssl::ssl::op_no_sslv2

How implement a Master Detail in a Web Form using Entity Framework -

i'm starting work entity framework , know how implement master detail web form permit user insert details in datagrid before saving database using entity framework 4. thanks in advance. jean carlos take @ these tutorials, hope helps: using gridview , entitydatasource master/detail using selectable master gridview details detailview

design - Help with header image displaying twice -

http://neighborrow.com/viewprofilecss.php?profileid=771# remove 1 of <div id="title"/>

c - What can I do to track this bug down? -

i have bug char pointer turning out null . i've been on gdb program, watching read/write @ memory address, , stepping through instructions, far bug stumps me. i've ran valgrind , thing coming read @ crash (strcmp). else can track down? you can try watchpoint . watch expression , when value of expression changes, gdb stop execution. you can watch variable: watch charptr this break every time charptr changes. if wanted know when changes non-null null (or vice versa), can use: watch charptr == 0

dojo DataGrid event.cellNode.cellIndex is not returning correct value -

i hava created editable subgrid ( grid in grid ) using dojo datagrid. fetching , populating data in 2nd , 3rd cells server based on value in 1st cell. event.cellnode.cellindex giving me correct value in firefox. in ie giving junk number. please me fix issue. thanks, shailaja var cellname=event.cell.name; fixed issue identify column.

c# - How to generate method stubs automatically in VS 2008 or using Coderush Express? -

recently implemented interface had 130 members should implement (c#, think thats irrelevant). how can generate stubs automatically, in vs 2008 edit:if not possible in vs 2008, i've installed coderush express, can 1 guide me on how cr express ? left click on interface, select "implement interface." public class whatever : ixmlserializable you need click near "i" has little underline. also, other tools such resharper , devexpress too. are using vs.net professional?

Extract a parameter from URL using a regex in PHP -

i have number of links like: <a href="http://url.com/?foo=bar&p=20" title="foo">foo</a> <a href="http://url2.com/?foo=bar&p=30" title="foo">foo</a> i'm trying extract parameter p each href found. in case have end result array array (20, 30) . what regex this? thanks. don’t try parse html regular expressions; use html parser php’s dom library or php simple html dom parser instead. parse url parse_url , query string parse_str . here’s example: $html = str_get_html('…'); $p = array(); foreach ($html->find('a[href]') $a) { parse_str(parse_url($a->getattribute('href'), php_url_query), $args); if (isset($args['p'])) $p[] = $args['p']; }

Placing an image in the titlebar of a firefox sidebar extension -

is possible put background image, and/or modify close button (x) in sidebar's titlebar? i know can set text value of changing sidebartitle="" there way put image in there? basically i'd put logo there instead of inside sidebar real-estate limited. i'd able without modifying profile css can deploy changes extension. any ideas? i ended finding element within sidebar-box id of "sidebar-header" , setting variable named "sbhead". i able sbhead.style.display="none"; finally in overlay.xul added hbox tag new header , set height 25 pixels same tabs. inside hbox added content wanted, include close button calls togglesidebar() functionality of header same. i hope helpful someone!

javascript - How to load in an external CSS file dynamically? -

i'm trying create dynamic page using external .css pages page color changed. below code. when click href , not getting output. can please tell what's problem in code? <script language="javascript"> function loadjscssfile(filename, filetype) { if (filetype=="css") { var fileref=document.createelement("link") fileref.setattribute("rel", "stylesheet") fileref.setattribute("type", "text/css") fileref.setattribute("href", filename) } if (typeof fileref!="undefined") document.getelementsbytagname("head")[0].appendchild(fileref) } loadjscssfile("mystyle.css", "css") </script> <a href="javascript:loadjscssfile('oldstyle.css','css')">load "oldstyle.css"</a> i have modified code below. still i'm facing problem in getting output. no result. ...

google app engine - Saving big string in php using quercus -

i'm using quercus appengine. tried saving long php string (> 1000 characters) appengine won't allow me string can hold 500 characters. tried using appengine's text datatype. lets me save, however, when retrieve data php, returns me resource() type instead of string. let me explain code: <?php $a = new text("this long string contains more 1000 characters"); $b = "this long string contains more 1000 characters"; $e = new entity('article'); $e->setproperty('content', $a); // works fine // $e->setproperty('content', $b); // complain strlen($b) > 500 $db = datastoreservicefactory::getdatastoreservice(); $id = keyfactory::keytostring($db->put($e)); // works ok, returns id of entity saved ?> now all's fine , dandy, when retrieve content of $e, return me resource() type data. <?php $q = new query('article'); $ps = $db->prepare($q); foreach($ps->asiterable() $i) { echo gettype($i-...

android - Problem with "has leaked window" on dialog -

i writing android app give user option call different alternative number based on number tried call. have broadcastreceiver gets number being called, checks if there alternatives , show dialog starts new activity can not on own. ok except activity closed before dialog appears, window leaked exception can not see how can make works, waiting result of dialog (uncomment loop in numberdialog class) results in no exception no dialog. the sources are: package com.frisco.hello; import java.io.ioexception; import java.util.arraylist; import java.util.list; import android.app.alertdialog; import android.content.broadcastreceiver; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.database.sqlexception; import android.net.uri; import android.util.log; import android.widget.toast; import com.frisco.hello.util.databasehelper; public class caller extends broadcastreceiver { private static final string tag = "he...

c# - Server Error in '/' Application (ASP.NET) -

i setup member ship roles , registration on website visual web developer using tutorial on msdn. works locally, when uploaded server, following page: "server error in '/' application. -------------------------------------------------------------------------------- configuration error description: error occurred during processing of configuration file required service request. please review specific error details below , modify configuration file appropriately. parser error message: connection name 'localsqlserver' not found in applications configuration or connection string empty. source error: [no relevant source lines] source file: machine.config line: 160 -------------------------------------------------------------------------------- version information: microsoft .net framework version:2.0.50727.4200; asp.net version:2.0.50727.4016 " does know why i'm seeing , how may go fixinf this? appreciated. thank you bael. edit: i...

php - & Value not appearing with AJAX call -

i working on submitting values database through ajax. uses jquery ajax object.my ajax code looks this: enter code here var genre = form.new_album_genre.value; form.new_album_genre.value=""; $.ajax({ type: "post", data: "genre="+genre+"&app="+app, url: 'apps/pvelectronicpresskitadmin/ajax_add_album_genre.php', success: function(data) { $('#'+divid).html(data); } }); in short, gets value form , submits data through post. fails if genre r&b. & symbol not sumbitting , r is. how submit values through ajax including &, + , = ? you need encodeuricomponent deal characters have special meaning in uris. (or pass object containing key/value pairs jquery instead of query string string have now)

image - Silverlight 4.0 - contrast and brightness management -

i building image editor silverlight 4.0 , need insight or possibly snippet of code or library implement contrast/brightness management. i appreciate if share how can achieved. thanks! contrast how "wide" swath of pixel brightness values present, out of total range of values possible. brightness "offset" of swath minimum possible level. to increase contrast, subtract (smallest present value - smallest possible value) pixel values put swath @ 0. multiply values (max possible value / max value present ) scale "swath" range of possible values. to adjust brightness, add or subtract absolute value each pixel. you want luminance or value channel in hsl or hsv colorspace. i found code here. http://www.dfanning.com/ip_tips/contrast.html

SMTP Email from ASP.NET -

This summary is not available. Please click here to view the post.

ruby on rails - Car make model dropdown web service -

i once found slick looking car make/model dropdown menu web service advertised form helpers ruby on rails, have subsequently been unable find again googling it.... know service talking about? edmunds provides data free through api. have sign-up api key. see documentation here: http://developer.edmunds.com/api-documentation/vehicle/ sign-up key here: http://developer.edmunds.com/index.html one example of making call (many more examples given on site): https://api.edmunds.com/api/vehicle/v2/makes?fmt=json&api_key={your api key} i looking kind of information motorcycles. can tell api not provide motorcycle data, seems have cars - make, model, year, trim, style, maintenance schedules. with json or xml data, have roll own drop down menus. edmunds provide premade widgets, pretty specific (e.g. return true market value), there chance won't have need. http://developer.edmunds.com/widgets_and_apps/index.html

actionscript 3 - In AS3 while using NetStream for video playback how do I seek when I use appendBytes -

i trying use netstream play bytearray. please see this talking about. i able play video. need able see particular second. not able this. if go through bytearray know can metadata , keyframes required , offset ( in bytes) each keyframe at. there no way seek particular offset. supports seek in seconds , doesn't seem work on bytearray. how go ? i got worked: // onmetadata function timestamp , corresponding fileposition.. function onmetadata(infoobject: object): void { (var propname: string in infoobject) { if (propname == "keyframes") { var kfobject: object = infoobject[propname]; var timearr: array = kfobject["times"]; var bytearr: array = kfobject["filepositions"]; (var i: int = 0;i < timearr.length;i++) { var tagpos: int = bytearr[i]; //read tag size; var timestamp: number = timearr[i]; //read timestamp; tags.push({ ...

java - What's the omission/error out here? -

there should error/omission in next code can't see because i've never used threads. can please find i'm missing? import java.awt.borderlayout; import java.awt.button; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.util.timer; import java.util.timertask; import javax.swing.jdialog; import javax.swing.jlabel; public class javaswingtest extends jdialog { private jlabel m_countlabel; private timer m_timer = new timer(); private class incrementcounttask extends timertask { @override public void run() { m_countlabel.settext(long.tostring(system.currenttimemillis() / 1000)); } } private javaswingtest() { createui(); m_timer.schedule(new incrementcounttask(), 1000, 1000); } private void createui() { button button1 = new button("action1"); button1.addactionlistener(new actionlistener() { @override public...

C : Convert signed to unsigned -

actually i've (probably) "simple" problem. don't know how cast signed integer unsigned integer. my code : signed int entry = 0; printf("decimal number : "); scanf("%d", &entry); unsigned int uentry= (unsigned int) entry; printf("unsigned : %d\n", uentry); if send unsigned value console (see last code line), signed integer. can me? thanks lot! kind regards, pro printf("unsigned : %u\n", uentry); // ^^ you must use %u specifier tell printf runtime uentry unsigned int . if use %d printf function expect int , reinterpret input signed value.

web applications - BlackBerry web app - 100% width not filling screen -

i'm working on mobile web app , i've noticed on both test phones, blackberry 9700 bold (os 5.0) , blackberry tour 9630 (os 4.7) not render width properly. i have simple table i've declared width 100%, table doesn't expand , take 100% of screen. there gutter / white border of 10px or right of screen. if hard code width 480px, takes entire screen, don't want hard code width values since may different depending on blackberry user using. i'm using meta tag: <meta name="handheldfriendly" content="true" /> , experimented setting viewport meta tag little success. any ideas? realize set width dynamically using javascript, i'd rather not. also, if save rendered page html , upload html server, when browse page blackberry width 100%! weird considering it's same code. perhaps wrong when page dynamically created , width gets messed up. anyone else experience this? i solved project. added min-width:470px divs not f...

c++ - Looking for a metafunction from bool to bool_type -

basically, looking library solution this: #include <boost/type_traits.hpp> template<bool> struct bool_to_bool_type; template<> struct bool_to_bool_type<false> { typedef boost::false_type type; }; template<> struct bool_to_bool_type<true> { typedef boost::true_type type; }; is there such metafunction? boost already provides boost::mpl::bool_<> : boost.typetraits uses integral_constant : boost_static_assert(( is_same< integral_constant<bool, false>, is_class<int>::type >::value ));

actionmailer - How do you use an instance variable with mailer in Ruby on Rails? -

i created instance variable (@user) in model of mailer , want access in view? it's giving me an error (@user = nil). what's best way pass variable view (the email body)? thanks, chirag if want access instance variable in mailer template in mailer model add @body[:user] = user_object the above create instance variable @user can accessed in view. should able access user object in mailer view doing @user the docs here have examples of alternative ways if using multiple formats (text/html).

wcf - Custom Domain Service Fails but Authentication Works (Silverlight Biz App Template) -

i'm hosting silverlight business application template derived application on iis server. i'm using built-in forms authentication working perfectly. unfortunately, i've added additional service has peculiar behavior. if remote server , use site works expected. if connect site pc, authentication still works custom domain service failing following error: ie throws error message: system.servicemodel.domainservices.client.domainoperationexception: load operation failed query 'get___'. exception of type 'system.servicemodel.domainservices.client.domainoperationexception' thrown. i tried debugging process , little more information: system.servicemodel.domainservices.client.domainoperationexception: load operation failed query 'get___'. remote server returned error:notfound. ---> system.servicemodel.communicationexception: ... my clientaccesspolicy , crossdomain policies in both wwwroot , root of website , followi...