Posts

Showing posts from February, 2015

api - Coarse-grained vs fine-grained -

what difference between coarse-grained , fine-grained? i have searched these terms on google, couldn't find mean. from wikipedia (granularity) : granularity extent system broken down small parts, either system or description or observation. extent larger entity subdivided. example, yard broken inches has finer granularity yard broken feet. coarse-grained systems consist of fewer, larger components fine-grained systems; coarse-grained description of system regards large subcomponents while fine-grained description regards smaller components of larger ones composed.

javascript - Make a YUI asyncRequest call which is not async -

i want make yahoo.util.connect.asyncrequest call, not async. open(method, url, async) false passed async. i can't find "syncrequest" in connect class. possible using yui 2? i tried without yui instead: function createrequestobject() { var ro; // mozilla, safari,... if (window.xmlhttprequest) { ro = new xmlhttprequest(); if (ro.overridemimetype) { ro.overridemimetype('text/xml'); // see note below line } // ie } else if (window.activexobject) { try { ro = new activexobject("msxml2.xmlhttp"); } catch (e) { try { ro = new activexobject("microsoft.xmlhttp"); } catch (e) {} } } if (!ro) { alert('giving :( cannot create xmlhttp instance'); return false; } return ro; } function sndreq(param,server,handler) { http = createrequestobject(); http.open...

c# - Getting non-public properties of a type via reflection -

how can non-public properties of type via reflection? yes, can. specify bindingflags.nonpublic in call getproperties() . class program { static void main(string[] args) { var f = new foo(); foreach (var fi in f.gettype().getproperties( bindingflags.nonpublic | bindingflags.instance)) { console.writeline(fi); } } } public class foo { private string prop { get; set; } }

CUDA plugin dlopen -

i've written cuda plugin (dynamic library), , have program written in c uses dlopen() load plugin. using dlsym() functions plugin. application important time of loading plugin program gets new handle dlopen() calling (the library file may modified subsequently). therefore after using of functions plugin invoke dlclose(). invocations dlopen() - dlsym() - dlclose() occur during program execution (in loop). if working on computer nvidia driver 256.35 (cuda 3.0 or 3.1) have memory leak (i use in plugin cudamemgetinfo() calling diagnostics). if working on computer nvidia driver 195.36.15 (cuda 3.0) have error after time of program execution: “nvidia: not open device file /dev/nvidia0 (too many open files).” if don't use dlclose() invocation program working fine, in case can't replace plugin on new one's during program execution. anyone encountered problem? thanks. nobody wrote plugins on cuda? i've found similar example on cuda sdk: matrixmuldynlinkj...

Does Google Chrome have APIs to access its downloads page? -

am able "tap into" google chrome's downloads page through extension/add-on? want write extension needs file names (or paths) of files being downloaded user. possible? apis should looking at? quite tricky search , don't know begin. a bit late think possible chrome.downloads api: http://developer.chrome.com/extensions/downloads.html

c# - Free Barcode API for .NET -

is there decent free api/component printing barcodes in c#? could barcode rendering framework @ codeplex of help?

reporting services - Getting windows account username of the client accessing the ssrs report -

is there way windows account username of client accessing ssrs report. if user accessing reports on server b machine how can user's windows username in ssrs report? i used user!userid , worked fine since running local machine. deployed different server stopped working because valid user!userid not available. pls. suggest. my bad. getting username. seems "code" needed execute on server didnt work. added vb.net code under "report properties -> code" tab. works fine on local machine. right clicked , deployed report server. there step needs performed "code" deployed server or executed. simple vb.net function shown below public shared function getusername(byval input string) string try input = input.replace("<domain>\", "") dim details(2) string details = input.split(".".tochararray()) input = string.concat(details(1), ", ", details(0)) ...

java - nullpointer exception when initializing a class in servlet -

class mstleastcountedit { mstleastcount reff; httpservletrequest request; httpservletresponse response; string msg = ""; string lcdesc=""; int = 0; int noofrows = 0; httpsession session=request.getsession(true); integer ccode=(integer) session.getattribute("companycode"); void updateedit(mstleastcount reff,httpservletrequest request, httpservletresponse response, int k) throws servletexception,ioexception,illegalstateexception { int j = k; this.reff=reff; this.request=request; this.response=response; try{ noofrows = integer.parseint(request.getparameter("noofrows")); string chkboxval=""; for(i=j;i<=noofrows;i++) { if((request.getparameter("chk_select"+i))==null) { chkboxval="notticked"; }//if checked closed else { ...

ASP.NET MVC app displaying weird characters -

i'm developing asp.net mvc app , today, after 1 month, uploaded new version server (discount asp.net). since that, i'm having problems display 1 of pages: http://www.jobbox.com.br/cocoonhealth/profile/gguerini invalid characters shown instead of page. all other pages ok. tried change encoding, line breaks , etc. nothing! tested on computer , server: both places page works great, on discount.asp server, doesn't. don't know do. spent entire day trying figure out happened. http://www.jobbox.com.br/cocoonhealth/ - home page http://www.jobbox.com.br/cocoonhealth/profile/gguerini - problem i double check , there nothing apparently wrong. don't know so. have seen similar before? i appreciate help. g go global.asax.cs file , add code in application_error event: httpapplication app = sender httpapplication; app.response.filter = null;

java - What are the specifications/recommendations for data types in JAX-RPC web services? -

when developing web service using java, axis1 , jax-rpc, constraints, recommendations , specifications must followed when sending complex data types on web service? for example, method: public mycomplexclass webserviceoperation() { return new mycomplexclass; } is there limitation on methods, getters, setters, variables, etc mycomplexclass? i suggest check excellent article http://www.ibm.com/developerworks/webservices/library/ws-tip-jaxwsrpc/ and this http://www.nesc.ac.uk/talks/ahm2006/621.ppt ‎

jquery - Find tags with no classes and add a class -

i need jquery add class form element has no class allready. made function, hasnoclass. is possible in real life? pseudo code: add class "classless" form tag jquery("form").hasnoclass().addclass("gotclass"); alternatively can done "add class 3rd form start tag on page. no clue how either, there may position or count function pseudo code: add class third form tag: jquery("form").postition("3").addclass("gotclass"); wow! 2 questions! need 1 answer on both appreciated sake of knowing , maybe future use. br. anders this should do: $('*:not([class])') you'd able do $('*:not([class])').addclass('gotclass'); or $('*:not([class])').eq(3).addclass('gotclass'); to clarify: selector matches elements, * , not within scope: "any element attribute, [ , ] , class "

html - For a states dropdown, should you list CA provinces by default? -

this isn't programming question, relates web forms, , generation of markup states/provinces. my site default en-us locale , there no canadian version, should list canadian provinces or should have label says "other ( province )" ? i'm realizing there lots of provinces in every other country , kinda unfair list canada's default. in 1 of previous questions user said changes states dropdown based on country, example if user selects "canada" list canadian provinces. as canadian, , 1 of order site (outside us), appreciate when canadian provinces listed. seems common these days , have 13 more items add combo box.

python - threading ignores KeyboardInterrupt exception -

i'm running simple code: import threading, time class reqthread ( threading.thread ): def __init__ (self): threading.thread.__init__(self) def run ( self ): in range(0,10): time.sleep(1) print '.' try: thread=reqthread() thread.start() except (keyboardinterrupt, systemexit): print '\n! received keyboard interrupt, quitting threads.\n' but when run it, prints $ python prova.py ` . . ^c. . . . . . . . exception keyboardinterrupt in <module 'threading' '/usr/lib/python2.6/threading.pyc'> ignored ` in fact python thread ignore ctrl + c keyboard interrupt , doesn't print received keyboard interrupt . why? wrong code? try try: thread=reqthread() thread.daemon=true thread.start() while true: time.sleep(100) except (keyboardinterrupt, systemexit): print '\n! received keyboard interrupt, quitting threads.\n' without call time.sleep , main process jumping out of try...exce...

sql server - Sql query to convert nvarchar to int -

i have query total amount of column using aggregate function. column data type nvarchar(max). how can convert integer? i have tried this: select sum(cast(amount int)), branch tblproducts id = 4 group branch ...but i'm getting: conversion failed when converting nvarchar value '3600.00' data type int. 3600.00 not integer cast via float first sum(cast(cast(amount float) int)) edit: why float? no idea of precision or scale across rows: float lesser evil perhaps empty string cast 0 float, fails on decimal float accepts stuff 5e-02, fails on decimal

c# - Calling NotifyIcon.ShowBalloonTip() from another class -

i'm developing windows form application in c#. have main form called mainwindow , notifyicon object called notifyicon belongs mainwindow class. what best way me use notifyicon other classes? i know that, without instance, can access public static members of class, if set notifyicon public static, stops working on mainwindow. any ideas? if it's same application can use application.openforms to retrieve opened forms. this property returns formcollection , can form instance there. more info here . if it's not same assembly see this .

How can you use php xdebug if you are on NAT behind a firewall? -

Image
i have following use case debugging php application: the developer have private ip address the developer can connect limited number of ports server, 80, 8080, 3128, others being limited outgoing firewall. still if outgoing requests http use proxy not have limitation. the server machine configurable is possible use xdebug in circumstance? how? it possible establish vpn not easy solution prefer simplified one. the solution found use putty forward port 9000 server client (ide). just configure xdebug connect localhost instead of ip address client (ide) running on: xdebug.remote_host = localhost xdebug.remote_port = 9000 xdebug.remote_connect_back = 0 there a nice article called remote debugging php firewall in way describing , xdebug configuration , ssh port forwarding method.

spring mvc - how to display an object on jsp page? -

i m pretty new spring mvc, m trying setup page display user information i have trouble controler , view. controler (getdetail returns user object, has email field) : @requestmapping("/{code}") public string get(@pathvariable long code,modelmap model) throws exception { model.addattribute("user",simpleusermanager.getdetail(code)); return "userdetail"; } in userdetail.jsp : <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <html> <head><title><fmt:message key="title"/></title></head> <body> user detail : ${user.email} ...

why i can't reverse a list of list in python -

i wanted code return list of none (i think it's because list.reverse() reversing list in place): map(lambda row: row.reverse(), figure) i tried one, reversed return iterator : map(reversed, figure) finally did , work me , don't know if it's right solution: def reverse(row): """func reverse list not in place""" row.reverse() return row map(reverse, figure) if has better solution i'm not aware of please let me know kind regards, the mutator methods of python's mutable containers (such .reverse method of lists) invariably return none -- few return 1 useful value, e.g. .pop method returns popped element, key concept retain none of mutators returns mutated container: rather, container mutates in-place , return value of mutator method not container. (this application of cqs principle of design -- not quite fanatical as, say, in eiffel, language devised bertrand meyer, invented cqs, that's be...

html - prevent div's from taking 100% width -

<div style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;"> <div style=" border: 2px solid black; margin: 0 auto; text-align: center; padding: 3px;"> hello<br />hola </div> <div style=" border: 2px solid black; margin: 0 auto; text-align: center; padding: 3px;"> sentence </div> </div> i have problem: borders of inner div's reach on whole width of page, want them frame content inside them. if use: display: inline borders frame each line separately , overlap, doesn't work - can help? p.s style's aren't declared in original document in stylesheet assign width absolutely positioned element? if you're looking shrink-wrapping, float:left or display:inline-block perfect that.

swing - borders in java -

i want set single title border group of textfields how can in java / swing. i have tried below code text fields compressing inside panel // create panel , add components it. jpanel pnl = new jpanel(new flowlayout(flowlayout.left)); pnl.add(new jlabel("name")); pnl.add(new jtextfield()); // add titled border panel, therefore surround // child components placed on panel. pnl.setborder(borderfactory.createtitledborder("it's friday!")); here's example using swing: // create panel , add components it. jpanel pnl = new jpanel(new flowlayout(flowlayout.left)); pnl.add(new jlabel("name")); pnl.add(new jtextfield()); // add titled border panel, therefore surround // child components placed on panel. pnl.setborder(borderfactory.createtitledborder("it's friday!"));

android - Scaling Images in a Linear Layout Evenly -

i have linear layout contains 6 images, span linear layout horizontally. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@layout/roundedcorner"> <imageview android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/someimage"> </imageview> ... the problem is, first 5 images not scale , take pixel width, , 6th images scrunched down, because there not enough space left horizontally. is there way scale images down have uniform look? add android:layout_weight="1" each imageview. if images of equal size, scaled in same way then.

using c# dll in project c++ -

i want use dll made in c#(visual studio 2008) in c++ project(visual studio 2003). how ? please heeelp there more com interop, msdn faq lists lesser known methods: 2.2 how call .net assembly native visual c++? there 4 methods call .net assembly native vc++ code. microsoft all-in-one code framework has working examples demonstrate methods. native vc++ module calls clr hosting apis host clr, load , call .net assembly. (all-in-one code framework sample code: cpphostclr) if .net assembly can exposed com component, native vc++ module can call .net assembly through .net – com interop. (all-in-one code framework sample code: cppcomclient) reverse pinvoke: managed code call native passing delegate native code can call back. (all-in-one code framework sample code: cspinvokedll) if module containing native vc++ code allowed enable clr , native vc++ code can call .net assembly directly through “it works”, or “ijw”, mechanis...

Rails controller testing - Validation errors do not raise a HTTP error response -

i have actioncontroller derived test sends 'post' request controller under test incorrect data. controller tries create new object , save it. model has validation methods triggered on save , generate validation error detecting incorrect data sent test. so far good. now, controller verifies http response status failure using assert_response :failure. however, test fails @ step saying: expected response <:failure>, <200> the @obj.errors correctly populated validation error somehow http response 200. any clues? what controller code do? usual way handle validation errors in rails send 200 ok response (e.g. render :action => 'new' ). response contains form (populated submitted parameters) along validation error messages.

c# - SqlDatareader GetValue returning date value acording to system date format -

hi reading value table using sqldatareader, problem is formatting value acording machine date format settings. for example original date format in source table saved yyyy/mm/dd when use sqldatareader.getvalue in machine has date set mm/dd/yy atutomatically converted format is there anyway retrive date value original date formatting intact? thanks there no "original date formatting", dates kept internally numbers, not strings. within sql query, can choose output formatting with convert(varchar(30), thecolumn, nnn) where "nnn" 1 of common date formats listed here: msdn . personally find page confusing, (more useful) page here: sql server helper . page: convert(varchar(20), getdate(), 100) will return 'jan 1 2005 1:29pm'

xsd - What is wrong with extending an XML Schema type using xs:all? -

<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns="http://tempuri.org/servicedescription.xsd" xmlns:mstns="http://tempuri.org/servicedescription.xsd" xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="http://tempuri.org/servicedescription.xsd" elementformdefault="qualified" id="servicedescription"> <xs:element name="template"> <xs:complextype> <xs:complexcontent> <xs:extension base="servicetype"> <xs:all> <xs:element name="templatecode" type="xs:string"/> </xs:all> </xs:extension> </xs:complexcontent> </xs:complextype> </xs:element> <xs:complextype name="servicetype"> ...

Alternative to triggers in SQL Server -

to eliminate potential problems triggers, of alternatives 1 may use same functionality of reacting event fired on insert action? i have database needs have additional values added on insert. insert controlled compiled code , cannot changed. example: program inserts string , string need supply integer new field points look-up table. if there alternative trigger please let me know pros , cons alternative. main reason triggers not allowed in our db standards. sql server 2008 enterprise how determine integer, based on string being inserted? one alternative might want computed columns in sql server . if matching pretty straightforward 1 (e.g. extract character 10 through 14 string) or that, create computed column automagically - no trigger needed. you can make computed columns persisted (physically stored part of tables) , create indices on these fields! computed columns available sql server 2000 on, persisted columns sql server 2005.

c# - A windows service application controlled by desktop application? -

i created windows service in c# can start , stop, restart. is there anyway of creating simple desktop application control it. example: button start service button stop. please have @ this article . explains how stop/start/restart service in nice manner. all need create new winforms/wpf application, add 3 buttons (style like) , assign methods click events of buttons. easy pie, let me know if need more info.

c - PHP extension for Linux: reality check needed! -

okay, i've written first functional php extension. worked proof-of-concept only. i'm writing 1 boss wants. what i'd know, php-heads out there, whether code makes sense. have got grasp of things emalloc , like, or there stuff there that's going turn around later , try bite hand off? below code 1 of functions. returns base64 of string has been blowfish encrypted. when function called, supplied 2 strings, text encrypt , encode, , key encryption phase. it's not using php's own base64 functions because, @ point, don't know how link them. , it's not using php's own mcrypt functions same reason. instead, links in ssleay bf_ecb_encrypt functions. php_function(blowfish_base64_encode) { char *psdata = null; char *pskey = null; int argc = zend_num_args(); int psdata_len; int pskey_len; char *buffer = null; char *pbuffer = null; char *encoded = null; bf_key context; int = 0; unsigned char block[ 8 ]; ...

iPhone/iPad draw pdf like iBooks? -

does know how use core graphics draw pdf in ibooks. can draw pdf page using core graphics curious how ibooks shows lower quality view of each page loads fast , when stay on page longer renders full quality. makes able open pdf without having make user wait magazine apps see on ipad. ideas help! apple have "zoomingpdfviewer" sample code: http://developer.apple.com/library/ios/#samplecode/zoomingpdfviewer/introduction/intro.html#//apple_ref/doc/uid/dts40010281 i suspect might give ideas :-)

Google sitemap files for Rails projects -

is there easy way create sitemaps file rails projects? dynamic sites (such stack overflow example) there should way dynamically create sitemaps file. way go in ruby and/or rails? what suggest? there gem out there? add route towards bottom of config/routes.rb file (more specific routes should listed above it): map.sitemap '/sitemap.xml', :controller => 'sitemap' create sitemapcontroller (app/controllers/sitemap_controller): class sitemapcontroller < applicationcontroller layout nil def index headers['content-type'] = 'application/xml' last_post = post.last if stale?(:etag => last_post, :last_modified => last_post.updated_at.utc) respond_to |format| format.xml { @posts = post.sitemap } # sitemap named scope end end end end —as can see, blog, using post model. haml view template (app/views/sitemap/index.xml.haml): - base_url = "http://#{request.host_with_port}" !!!...

java - JSkype error sending message -

i'm trying run following code unfortunately facing error problems package jskypeexample; // import jskype packages import net.lamot.java.jskype.general.abstractmessenger; import net.lamot.java.jskype.general.messagelistenerinterface; import net.lamot.java.jskype.windows.messenger; import java.lang.thread; import java.lang.exception; /** * * @author swhite */ public class jskypeexample implements messagelistenerinterface { // create messenger we'll use sending messages private abstractmessenger msgr = null; /** creates new instance of jskypeexample */ public jskypeexample() { msgr = new messenger(); msgr.addlistener(this); msgr.initialize(); try { // number may vary on system depending on amount // of time required initialize msgr. thread.sleep(1000); // send skype api text command msgr.sendmessage("message seanmwhite hello ui student"); msgr.sendmessage("search friends...

java - GWT with type overlay for twitter search results -

i trying adapt gwt tutorial making requests json data on site grab search results twitter ( http://code.google.com/webtoolkit/doc/latest/tutorial/xsite.html ). cannot figure out how adapt overlay type fit twitter results come as: {"results":[ {"text":"@twitterapi http:\/\/tinyurl.com\/ctrefg", "to_user_id":396524, "to_user":"twitterapi", "from_user":"jkoum", "id":1478555574, "from_user_id":1833773, ... ( http://apiwiki.twitter.com/twitter-search-api-method%3a-search ) so results array of objects of sort need read java program. trying write overlay class, couldn't figure out how parse results array bit because i'm not sure type supposed be. package com.google.twentynumbers.client; import com.google.gwt.core.client.javascriptobject; public class twitterresults extends javascriptobject { protected twitterresults() { } public final native string g...

php - merging XFDF with PDF form to create final PDF server-side? -

this have currently: user submits form data , gets "download pdf" link. the link points script generates xfdf file on fly , outputs xfdf file after setting appropriate headers, etc. the xfdf file points password-protected pdf, generic pdf form uses xfdf data fill in fields. what like: user clicks "download pdf" link. xfdf generated on fly (no file written server). pdf , xfdf merged server-side using generic pdf. contents of final pdf output user same xfdf originally. neither xfdf nor final pdf ever saved server. i looking @ pdftk , has few options dealing fdf/xfdf files, of assume a) original xfdf file exists file on server , b) resulting pdf should output file on server. also, pdftk 4 years old. i wondering if: a) there newer equivalent pdftk out there? b) if there way, using newer pdftk-like tool or using pdftk, use dynamic paths data never has exist in file form on server? i learned built-in input/output streams using php:// i'...

Passing the PHP value to a thrid party script in jQuery -

how jquery app validating username? (3rd party script) iam using same third party script form validation mentioned in above question .now have file in third party script known jquery.validationengine-en.js .so have field in html known <input type="text" id ="test1" value ="" class ="ajax[optional,ajaxcode]"> in jquery.validationengine-en.js have defined in way "ajaxcode":{ "file":"get_custcode.php?citycode=", "alerttext":"code taken", "alerttextok":"", "alerttextload":"* checking..." }, so problem how pass citycode (parameter ) dynamic value(php) mandatory @ server side script (php)inorder make sure custcode dowsnot exist in city. iam unable pass city code. here various things have tried passing value "file":"get_custcode.php?citycode="+<? echo $_request[...

schema in sql server 2008 -

what difference between creating ordinary tables using 'dbo' , creating tables using schemas.how schema works & supports tables a schema container db objects - tables, views etc. allows structure large database solution might have. sample, have @ newer adventureworks sample databases - have number of schemata included, "humanresources" , forth. a schema can security boundary, e.g. can give or deny users access schema whole. schema can used keep tables same name apart, e.g. create "user schema" each user of application, , have "settings" table in each of them, holding user's settings, e.g. "bob.settings", "mary.settings" etc. in experience, schemata not used in sql server. it's way organize database objects containers, unless have huge amount of database objects, it's won't use much.

android - Weird MapView problem; PixelConverter Error -

i have application based on mapactivity. application drops itemizedoverlay items on map start move about. has been running no problems until dropped nexus 2.2 phone. i'm running weird problem when zoom in/out fast, or pan fast, mapview go "white" , overlay items shoved upper left hand corner. the error i've seen in log is: e/pixelconverter( 4881): setting singular matrix matrix{[0.0, 0.0, 152.0][0.0, 0.0, 347.0][0.0, 0.0, 1.0]} my map keys working fine. have internet permissions setup on phone too. i'm scratching head on one. issue has been reported. go page below , press star raise attention problem. http://code.google.com/p/android/issues/detail?id=13172

exec - Java Shell wildcard tokenizer -

my java extremely rusty , i'm stuck trying make user interface simplifies execution of shell scripts or batch files depending on whether it's linus or win32 respectively. files have following naming convention. module-verb-object-etc [args-list] mysql-connect-grid mysql-connect-rds mysql-dump-grid mysql-dump-grid-se314 ultimately parse unambiguous terms can: tokenize commands (e.g delimited "-") & shorten them simplified terms soemthing foxpro's command window or cisco's ios (eg "my co gr" executes "mysql-connect-grid" in unix , *.cmd in win32) and in style of ios allow user enter abbreviated commands can type in question mark (?) , give them hint unique remaining (or next) command options (e.g. "my?" returns mysql & "my ?" returns connect, or dump). othr return values "ambiguous" or "unknown" commands not unique or not matched. may seem trivial there many hundreds of...

c++ - Dual purpose code commenting(users & maintainers)...HOW? -

i writing c++ static library , have been commenting doxygen comments in implementation files. have never had care documentation working on needs documented users , trying replace previous bad habit of wanting code , not document better software engineering practices. anyway, realized other day need couple different types of documentation, 1 type users of library(doxygen manual) , comments myself or future maintainer deal more implementation details. one of solutions put doxygen comments file, class, , methods @ bottom of implementation file. there out of way , include normal comments in/around method definitions benefit programmer. know it's more work seems best way me achieve 2 separate types of commenting/documentation. agree or have solutions/principles might helpful. looked around site couldn't find threads dealt this. also, don't want litter interface file comments because feel it's better let interface speak itself. rather manual place user can if...

c# - Redirect the parent page from IFrame -

i using iframe, , iframe want redirect page. please tell me how without javascript, ie, no window.location . response.redirect shows page in iframe, want show page main page. it hazard if can manipulate other frames/window withou using client-side scripts or user-invoked actions. here's list of alternatives: javascript options: window.top.location.href=thelocation; window.parent.location.href=thelocation; window.top.location.replace(thelocation); non-javascript options: <a href="thelocation" target="_top">click here continue</a> <a href="thelocation" target="_parent">click here continue</a>

channel - Is the callback from WCF to ASP.NET possible? -

i have web service hosted in iis in different box , wcf service hosted in windows service, in different box.(n-tier approach). here, web service client wcf service. request upload file comes iis hosted web service, , iis hosted web service in return calls wcf service , actual upload. far good. after upload done wcf service performs callback (i have stored callbacks in dictionary, , have used (instancecontextmode=instancecontextmode.persession, concurrencymode=concurrencymode.multiple)). wcf service sends callback. in trace viewer, looks asp.net received callback, upload page in browser(this end user) freezes good. using chunkingchannel binding larsw. first of all, @ possible implement above senario, john saundars mentioned in link: what "operationcontext.current.getcallbackchannel" do? thanks help. not sure mean "freezes", not update or becomes unresponsive. it may response asp page sent browser before response comes web server wcf service. in ...

Using Third-Party Modules with Python in an Automator Service -

i have installed py-appscript on machine , can used python installation @ /library/frameworks/python.framework/versions/current/bin/python . i trying use installation of py-appscript automator service. this, use run shell script action , set shell usr/bin/python (which choice python, unfortunately). the usr/bin/python not appear have access third-party modules , crashes on line: from appscript import * is there way me give usr/bin/python access third-party modules? or there way tell automator use /library/frameworks/python.framework/versions/current/bin/python instead? i need automator run python directly run shell script action. action calls python scripts external automator (via bin/bash , example) not perform enough useful. okay, able working using hack found @ how execute php shell script automator action on mac os x . inside of run shell script action, used /bin/sh/ shell <<eof ... eof proper python installation. so example, entering /...

asp.net mvc - how to use AsyncController in MVC application using Ninject for DI? -

does know how use asynccontroller in mvc application uses ninject di? asynccontroller works fine when dont use ninject cant make them work together. i added following in sitemodule no go. bind<iasynccontroller>( ).to<asynccontroller>( ).insingletonscope( ); sorry not explaining in details. my controller looks this [handleerror] public class homecontroller : asynccontroller { public void indexasync( ) { asyncmanager.outstandingoperations.increment( ); rssfeed feed = new rssfeed( ); feed.getrssfeedasynccompleted += ( s, e ) => { asyncmanager.parameters[ "items" ] = e.items; asyncmanager.outstandingoperations.decrement( ); }; feed.getrssfeedasync( "http://feeds.abcnews.com/abcnews/topstories" ); } public actionresult indexcompleted( ienumerable<syndicationitem> items ) ...

c++ - Why does this dialog box close immediately after opening? -

my issue trying create opengl/win32 application , unable keep dialog box open. literally flashes if pressed cancel on right when opened. i've looked around google , found few others issue, none of solutions posted have helped me, turn stackoverflow community! initially, wrote code dialog procedure... lresult callback logindlgproc(hwnd hwnddlg, uint msg, wparam wparam, lparam lparam) { showwindow(hwnddlg, sw_show); // these added window show updatewindow(hwnddlg); // if chance small. switch(msg) { case wm_initdialog: return true; case wm_command: switch(wparam) { case idok: enddialog(hwnddlg, 0); return true; } break; } return false; } i wrote actual code display box. void displayloginbox() { logindlghwnd = null; logindlghwnd = (hwnd)dialogbox(getmodulehandle(null), makeintresource(login_dialog), ...

Can I set the default string encoding on Ruby 1.9? -

this might sound minor, it's been driving me nuts. since releasing application production last friday on ruby 1.9, i've been having lots of minor exceptions related character encodings. of variation on: encoding::compatibilityerror: incompatible character encodings: ascii-8bit , utf-8 we have international user base plenty of names contain umlauts, etc. if fix templates use force_encoding in bunch of places, pops in flash message helper. et cetera. at moment looks i've nailed down ones knew about, patching activesupport's string concatenation in 1 place , setting # encoding: utf-8 @ top of every 1 of source files. feeling might have remember every file of every ruby project ever on, forever, avoid string assignment problems, not sit in stomach. read -ku switch seems warn it's backwards compatibility , might go away @ time. so question 1.9-experienced folks: setting #encoding in every 1 of files really necessary? there reasonable way globally? ...

sql server - Selecting SUM of TOP 2 values within a table with multiple GROUP in SQL -

i've been playing sets in sql server 2000 , have following table structure 1 of temp tables (#periods): restctr hoursctr duration rest ---------------------------------------- 1 337 2 0 2 337 46 1 3 337 2 0 4 337 46 1 5 338 1 0 6 338 46 1 7 338 2 0 8 338 46 1 9 338 1 0 10 339 46 1 ... what i'd calculate sum of 2 longest rest periods each hoursctr, preferably using sets , temp tables (rather cursors, or nested subqueries). here's dream query won't work in sql (no matter how many times run it): select hoursctr, sum ( top 2 duration ) longestbreaks #periods rest = 1 group hoursctr the hoursctr can have number of rest periods...

asp.net - Bypassing forms authentication when a query string is passed -

in asp.net, aware of way bypass forms authentication if specific query string parameter passed in? such as: mydomain.com/myprotectedpage.aspx ...i protected forms authentication (and so, redirected login page) mydomain.com/myprotectedpage.aspx?mybypassparameter=me ...i page render normal is @ possible? not "official" way of doing it. you do, have base page instead of system.web.ui.page so: public mustinherit class protectedpage inherits system.web.ui.page private sub page_initcomplete(byval sender object, byval e system.eventargs) handles me.initcomplete if user.identity.isauthenticated = false if string.isnullorempty(request.querystring("mybypassparameter")) formsauthentication.redirecttologinpage() end if end if end sub end class

When is garbage collector used in java? -

as far know gc used when jvm needs more memory, i'm not sure it. so, please, suggest answer question. the garbage collection algorithm of java understand, pretty complex , not straightforward. also, there more algorithm available gc, can chosen @ vm launchtime argument passed jvm. there's faq garbage collection here: http://www.oracle.com/technetwork/java/faq-140837.html oracle has published article "tuning garbage collection 5.0 java[tm] virtual machine" contains deep insights garbage collection, , understand matter better: http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html

How to ensure that a Silverlight OOB app only has a single instance? -

is there way ensure single instance of desktop version of trusted silverlight 4 out of browser app run? or need manually enforce through creation of crude mutex of sort? if must enforce myself, i'd @ creating file in isolated storage lock , deleting on exit. i'd check files existence on launch prevent opening subsequent instance. i'd need way handle app crashing or exiting other way prevents lock file being deleted. instinct have timeout on file , ignore if it's on period of time old. unfortunately, app plays movies it's run several hours under normal circumstances. lock timeout of few hours isn't popular users in situation. there better solutions? check out link: http://www.tozon.info/blog/post/2009/11/01/detecting-duplicate-instances-of-a-running-silverlight-application.aspx perhaps help.

sql - Finding One record from table having unique PK and duplicate FK -

i want 1 record table having unique primary key , duplicate foreign key please see attached image below alt text http://img413.imageshack.us/img413/9940/findduplicate.png thanks select fk, count(*) table1 group fk having count(*) > 1

sql server 2005 - SSIS XML Task with a For Each Loop -

i have transformed xml file see question complete description what want know take xml task , have preformed in each loop. want xml files in specific directory transformed , resulting file moved seperate directory. it's not working. i'm getting following error messaes: error: 0xc002f304 @ xml task, xml task: error occurred following error message: "data @ root level invalid. line 1, position 1.". error: 0xc002928f @ xml task, xml task: property "new source" has no source xml text; xml text either invalid, null or empty string. can perform xml transformation within each loop? the problem xml task expecting variable contain xml data trying transform. in fact variable contained file name , path pointing xml data. my coworker showed me fix. inside xml task select sourcetype = file connection. then set source point file. here trick. @ bottom see connection manager , inside file name pointed xml task to. click on file name (inside of ...

python - How to make os.mkfifo and subprocess.Popen work together? -

i'm trying redirect patch command output using named pipe. tried this: fifo = os.path.join(self.path, 'pipe') os.mkfifo(fifo) op = os.popen('cat '+ fifo) proc = popen(['patch', current_keyframe, '--input='+fpath, '--output='+fifo], stdin=pipe, stdout=pipe) os.unlink(fifo) print op.read() but script stops @ popen() call patch command didn't completed. how can make work properly? you aren't waiting patch command finish before read fifo. replace subprocess.popen() call subprocess.call() , , remove stdin/stdout redirections aren't using. also, use open(fifo) read fifo, not os.popen('cat ' + fifo) . you realize, hope, can avoid fifo entirely? after p = popen(['patch', '--input', fpath], stdout=pipe) , can read patch's output p.stdout.

sqlalchemy - SQL Alchemy + Testing webserver with InnoDB fails -

i trying move db tables on innodb myisam. having timing issues requests , cron jobs running on server leading errors. quite sure transaction support me problem. therefore transitioning innodb. i have suite of tests make calls our webservices rest api , receive xml responses. test suite thorough, , it's written in python , uses sqlalchemy query information database. when change tables in system myisam innodb however, tests start failing. however, tests aren't failing because system isn't working, failing because orm not correctly querying rows database testing on. when step through code see correct results, orm not returning correct results @ all. basic flow is: class unittest(unittest.testcase): def setup(self): # create test object in db gets affected web server testo...

sql - ASP.NET ERROR : Keyword not supported: 'provider' -

my app fails @ line of code: dim objconnection new sqlconnection(application("connstring")) my connection string is: "server=testaitsql;database=sscommerce;uid=planowebapp;pwd=xxxxxxxx;" i googled problem , solution having malformed connection string "provider" being specified when shouldn't have. example conn string: provider=sqloledb.1;integrated security=sspi;database=apinquiry;server=sqlserver i'm not specifying provider think have different problem...??? does test server have exact same configuration file development machine? suspect configuration file on test machine may have different set of values connstring expecting.

How to start developing Windows mobile applications -

i want write application windows 6.1 standard smart phone intercepts incoming sms messages , auto responds if match specific criteria, despite installing countless sdk's unable need. the code want use relies on microsoft.windowsmobile.pocketoutlook.dll assembly, can't seem find assembly. possible use assembly on standard mobile device, or have have windows mobile professional device? so need getting set create windows mobile applications. i using sharpdevelop (because can't afford visual studio). i need microsoft.windowsmobile.pocketoutlook assembly (since have written code should work, uses it). a device emulator nice don't have test on phone. is want possible on windows 6.1 standard device (htc ozone)? any appreciated, since stuck @ point. thanks, i tried compile code , following errors, suspected would. the type or namespace name 'windowsmobile' not exist in namespace 'microsoft' (are missing assembly reference?) i can...

internet explorer - Deciphering HEX RGBA for MS-filters in CSS -

i'm writing styles page i'd use rgba colors on background of list items. i've used css background property along rgba(146,138,118,.4) define transparent background color. now i'm trying cover bases ie support using technique of ms-filter described in this article. (see heading "...and rgba all.") the trouble apparently ms-filter requires use type of hybrid between rgba , hex alpha transparency value translated number between 00 , ff. see this description page microsoft reference. so trouble can't figure out how on earth convert value rgba hex/rgba hybrid method. can point me reference material on this? please don't give me correct value - me no outside of color. need understand how behind it, thanks. translating rgba alpha gradient filter format simple. it's mapping interval [0, 1] interval [0, 255] , represented in hex. conversion, then, multiply 255 , convert hex. example, opacity in rgba(rr, gg, bb, 0.5) ends 7f (or 80 ,...

c# - Function waits for response from other app -

we working on integrating 2 different applications run simultaneously , share data. 1 application provides data, other 1 computes values based off external systems , data , has provide first application. we using library share data between applications: http://grouplab.cpsc.ucalgary.ca/cookbook/index.php/toolkits/networking the library allows create shared dictionary can queried application (as long knows location of shared dictionary). so, should happen program has provide data program b , program b uses data , returns other data program a. my problem how make program wait response b. in more concrete terms, can put object in shared dictionary, other program gets notified of change in dictionary, can compute attribtues , update object in dictionary. program can notified, want program wait till gets response - program a's action should based on returned value. a ugly way see can done have infinite loop inside function, keeps querying dictionary see if object has been ...