Posts

Showing posts from April, 2015

sql - Sort varchar column starting with the first letter instead of the first character? -

using linq or sql, how have following strings, sorted as: "banana" apple coconut sort as: apple "banana" coconut updated based on comment ilist<string> sorted = context.terms.tolist() .orderby(t => regex.replace(t.term, @"\w*","")).tolist();

python - Iterating through a scipy.sparse vector (or matrix) -

i'm wondering best way iterate nonzero entries of sparse matrices scipy.sparse. example, if following: from scipy.sparse import lil_matrix x = lil_matrix( (20,1) ) x[13,0] = 1 x[15,0] = 2 c = 0 in x: print c, c = c+1 the output is 0 1 2 3 4 5 6 7 8 9 10 11 12 13 (0, 0) 1.0 14 15 (0, 0) 2.0 16 17 18 19 so appears iterator touching every element, not nonzero entries. i've had @ api http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.lil_matrix.html and searched around bit, can't seem find solution works. edit: bbtrb's method (using coo_matrix ) faster original suggestion, using nonzero . sven marnach's suggestion use itertools.izip improves speed. current fastest using_tocoo_izip : import scipy.sparse import random import itertools def using_nonzero(x): rows,cols = x.nonzero() row,col in zip(rows,cols): ((row,col), x[row,col]) def using_coo(x): cx = scipy.sparse.coo_matrix(x)

javascript bookmark icon -

i have site offers useful bookmark link contains javascript opposed link web page. eg url:"javascript:(function(){.....})();" icon appears in bookmarks bar default blank paper image. is there way of forcing have icon of choice, eg favicon.ico of site, when drags link bookmarks bar? (eg when bookmark standatd url such url:"www.mysite.com") many time! jj those bookmarkes called bookmarklets, fyi :) and no, there no way set icon them. because browser automatically looks favicon on link bookmark pointing to. way finds favicon either accessing page , looking @ meta data in html, or alternatively going domain/favicon.ico as can see, there no way browser perform steps on bunch of javascript code.

android - Problem with a button -

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" > <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingbottom="20px" > <button android:id="@+id/expandbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" + " android:focusable="false" android:focusableintouchmode="false" android:clickable="false" />

FileMaker 11 JDBC - How to SELECT the current system date? -

in oracle, can select sysdate dual current system date/time. how can same accessing filemaker database via jdbc driver? note: "don't use filemaker" unfortunately not option. create unstored calc field calls ( currenthosttimestamp ) , include field 1 of selected fields. (make sure configure field's options filemaker not store calculation results - unless want date/time of when field added...)

sql server - How to write Batch SQL query in procedure -

if want write procedure below, there other way that, avoid using concatenate sql statement, afraid, if input long, exceed limit of max varchar, code have big problem. thanks create procedure update_all_status @ids varchar(max) = null, @status int = null begin if @ids null begin return end declare @sql varchar(max) set @sql = 'update mytable set status = ' + @status + ' id in (' + @ids + ')' execute @sql end instead of dynamic sql (which vulnerable sql injection attacks ) , passing in varchar(max), consider using table valued parameters : -- creates tvp type - needed once! create type integertabletype table ( identities int ); go create procedure update_all_status @ids integertabletype readonly, @status int = null begin update mytable set status = @status id in (select identities @ids) end this msdn article shows how call these .net code.

Multiple Java Applications accessing one HSQLDB causes app to hang -

this semi-related previous question . previous question states, have desktop app calls off different main method kick off particular process. both desktop app , separate main method access same hsqldb database. prior getting far, desktop app had been accessing hsqldb database using connection url one: jdbc:hsqldb:file:/some/path/mydatabase now works fine in single user environment. i've got multi-user environment desktop app , separate main process wanting read/write to/from database, wanted make database shared resource. i've had @ hsqldb documentation , post creating shared hsqldb database no avail. in post talks starting server via code. don't think want have hsqldb database , running time there multiple users of desktop app. looking @ official hsqldb documentation, states can start hsqldb server this: java -cp ../lib/hsqldb.jar org.hsqldb.server -database.0 file:mydb -dbname.0 xdb if run above command own database file , name, seems start okay

ubuntu - Installing FAAC on linux, getting errors -

i trying install faac on linux. i'm getting errors. i use install. cd /usr/src wget http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/faac-1.28.tar.bz2/download tar -xvjf faac-1.28.tar.bz2 cd faac-1.28 ./configure make make install once try make it, error mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’ /usr/include/string.h:369: error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’ make[3]: *** [3gp.o] error 1 make[3]: leaving directory `/usr/src/faac-1.28/common/mp4v2' make[2]: *** [all-recursive] error 1 make[2]: leaving directory `/usr/src/faac-1.28/common' make[1]: *** [all-recursive] error 1 make[1]: leaving directory `/usr/src/faac-1.28' make: *** [all] error 2 i read online , saying interfearing something, , had locate file , edit it. how fix installation install properly. remove line 126 containing strcasestr mpeg4ip.h found in common/mp4v2 folder, temporary wo

php - Using Ajax to send form data -

i have html/php form using using post send form data script php file. want send data out page reloading upon clicking submit button. i wondering how implement ajax allow functionality. i have grasp of javascript have never used ajax technology. if question beyond scope of q&a if please point me in right direction tutorial allow me implement technology out having spend couple of days learning how works. working short deadline. cheers. you can serialize , post form data jquery , optionally handle response. the following example jquery's documentation http://api.jquery.com/jquery.post/ : $.post("test.php", $("#testform").serialize());

javascript - Grab url parameter with jquery and put into input -

i trying grab specific paramater url such www.internets.com?param=123456 i trying this.. $j.extend({ geturlvars: function(){ return window.location.href.slice(window.location.href.indexof('?')).split(/[&?]{1}[\w\d]+=/); } }); var allvars = $j.geturlvars('param'); the weird thing variable returning comma in example looks ,123456 where coming from?! split returns array of substrings, comma coming serialization of array.

c++ - how to get the name of a button created by QDialogButtonBox? -

i'm trying button child widgets of window. buttons created through qdialogbuttonbox . how 1 cancel/ok/save button? i have: qwidget *pwin = qapplication::activewindow(); qlist<qpushbutton *> allpbuttons = pwin->findchildren<qpushbutton *>(); qlistiterator<qpushbutton*> i(allpbuttons); while( i.hasnext() ) { //identify button cancel/ok/save button here /*note: i'm having trouble, getting text of button here returns null. other way of identifying which? special case when buttons created through qdialogbuttonbox? */ } you should use qdialogbuttonbox::button() method, button of corresponding role . for instance : qpushbutton* pokbutton = pbuttonbox->button(qdialogbuttonbox::ok); qpushbutton* pcancelbutton = pbuttonbox->button(qdialogbuttonbox::cancel); // , on... generally speaking, it's bad idea find button it's text, text might change when app internationalized.

java - Getting Location details from Google Map in gwt -

i need perform tasks google map, 1. first need user able place 1 marker 2. retrieve city , other details such street address does know this? i wrote minimal example show how achieve you're looking for: public void onmoduleload() { rootpanel.get().add(new googlemaps()); } private class googlemaps extends composite { private mapwidget fmap; private geocoder fcoder; private marker fmarker; public googlemaps() { fmap = new mapwidget(latlng.newinstance(47.0559084, 8.3114878), 6); fmap.setsize("300px", "300px"); fcoder = new geocoder(); markeroptions options = markeroptions.newinstance(); options.setdraggable(true); fmarker = new marker(latlng.newinstance(47.0559084, 8.3114878), options); fmap.addoverlay(fmarker); fmarker.setvisible(false); addhandlers(); initwidget(fmap); } private void addhandlers() { fmap.addmapdoubleclickhandler(

.net - Sorting DataGrid while animating cells causes exception -

i have created datagridcell template have applied 1 of columns so: <datagridtextcolumn binding="{binding lastupdated}" isreadonly="true" canuserreorder="false" canusersort="false" canuserresize="false" cellstyle="{staticresource datagridcellstyle1}" /> and template looks this: <controltemplate targettype="{x:type datagridcell}"> <controltemplate.resources> <storyboard x:key="cellchangedstoryboard"> <coloranimationusingkeyframes storyboard.targetproperty="(panel.background).(solidcolorbrush.color)" storyboard.targetname="dgc_border"> <easingcolorkeyframe keytime="0" value="lightgreen"/> <easingcolorkeyframe keytime="0:0:8" value="red"/> </coloranimationusingkeyframes> </storyboard> </controltemplat

graph - Taking advantage of the Entity Framework's many-to-many relationships when the joining table has an extra field -

a scenario: in database have table joining customers , movies together, field specifying weight of relation. eg: customersmovies | -customerid | -movieid | -weight if had first 2 fields, entity framework recognise many-to-many relationship , able call customer.movies , movie.customers. third field, relationship broken. ideally, love able go customer.movies[0].weight or similar return joining parameter. if not supported, still many-to-many relationship other functions. is supported within entity framework? create 2 tables, customersmovies (which joins 2 tables) , customermovieweights table specifies weight given customer , movie, redundant data isn't ideal. kind regards, harry if dropped weight column junction table, need map customers , movies table. if not, need map 3 tables: customer , customermovies , movies . but of course, not able this: var customer = ctx.customers.first(); var customermovies = customer.movies; you have this: var

show multiple showlink in jqgrid in single cell -

hi have developed jqgrid in mvc web application using jquery in .net. able show hyperlink call action controller. form has download links. how configure download link , show multiple download link in single cell ? these links in variable in numbers can not keep columns each link. best way put links in single cell. using c# code behind. you can use custom formatter create 2 links in 1 cell. implementation little different depend on form in return data jqgrid server (depend on j). third parameter of custom formatter rowobject contain data of row in in send server. in situation need define custom unformatter used data formatting cell. example if allow sorting of column (if don't use sortable:false ) data custom formatted column must read , compared. in case custom unformatter needed. if have problem implementation should append question more information,

security - how to block the hackers ip adress (denial of service threads) in php -

i want block ipadress of clients send more request server samp ip adress (hackers). how send mac code particular ip adress , receiving mac code user , compare original mac code.. you can't in php though. php script isn't executed until after post has completed. potentially protect against dos need deny access before post has completed, better if can before sent client.

asp.net - On row click column value has to be changed in jqgrid -

i have jqgrid 4 columns , in rows database. want thing this. on row selection cell value of row has changed. i.e. sno sname update roll no 1 steve rename 1001 2 jack rename 1002 i want update sname when user selects rename jqgrid row example if user selectes rename first row first row should following i.e. sno sname update roll no 1 steve update/cancel 1001 2 jack rename 1002 can 1 suggest me how obtain same it seems me try make things more complex is. why not use standard behavior of jqgrid "inline editing"? if user double-click (or click depend on requirements) on row "editable" columns of row can modified (see old answer more information). if user end row editing pressing of "enter" key changed saved. if user press "esc" key or select row changes discarded. standard inline editing supports rename/up

c - Are function pointers really needed for implementing a FSM? -

i reading http://www.netrino.com/embedded-systems/how-to/state-machines-event-driven-systems later in article provide implementation of small fsm in c language. i don't quite understand why chose function pointers. in understanding pointers functions useful when 1 needs same interface, different types of "events", example parsing internet protocol packet (it's convenient register 1 pointer function , assign different functions, 1 parse http, second parse ftp , on. merely example, think got point). but not see in article, imho state machine astraightforward implementation suffice, or may i'm wrong? first, have this answer , (in opinion) easier understand 1 posted. second, right: function pointers useful implement different behavior same "event pattern". called polymorphism in oop (have this wikipedia article ). so, if think it... need fsm: react in different ways same event, is: implement different function each state transition in

JQuery UI sortables / draggable clone not working -

hi folks using ui fro drag drop, problem cannot "clone" fire. i have 2 <ul><li></li></ul> lists , want drag list 1 list 2 ok bit easy, getting "clone" remain in list 1 not. need / want happen drag list 1 list 2 (one way drag only), on receive in list 2 hide remove dragged item - ok sounds strange id of dragged item loads page based on id created "empty" <li> in 2nd <ul> so far "we" looking this: $('ul#inputs_menu li ul').sortable({ connectwith: "ul#layout_form", }).disableselection(); $('ul#inputs_menu li ul li').sortable({ helper: "clone" }).disableselection(); $(' ul#layout_form' ).sortable({ receive: function(event, ui) { var new_item = (ui.item).attr('id'); $('ul#layout_form').append('<li><div id="'+new_item.substr(4)+'"class="'+new_item.substr(4)+' inputs radius_10" ><

ruby - Rails Alternative to The Django admin panel / CRUD View Generator? -

i trying decide between rails , django.. at moment i'm finding ruby more elegant reason considering django admin panel.. i have no experience of either have develop application fast meet deadline. is there way in rails generate (close production ready) set of views of crud actions based on model admin panel in django? (ie @ model , see have person belongs group , generate dropdown grouop on create person view)? if not quickest way (without manually writing) first draft of crud views? thanks, daniel interesting tool http://activeadmin.info/

java - File storage in Spring -

i save files uploaded form folder in spring 3 application. i'm rookie this, don't know how started. files must java file format. here's how can define absolute path temporary directory using system properties , spring expression language : <!-- package shortened readability --> <bean id="multipartresolver" class="org.springframework....commonsmultipartresolver"> <property name="uploadtempdir" value="#{ systemproperties['java.io.tmpdir'] }/yourwebapp/upload"/> </bean> reference: system properties , spring expression language system.getproperties() (includes reference java.io.tmpdir )

wpf - Setting Focus on a Control Within a ControlTemplate (Part 2) -

i'm stumped on must surely 1 of common wpf requirements. i've read this question implementation of solution not work. here's markup lookless control: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:wpftest"> <style targettype="{x:type local:customcontrol}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type local:customcontrol}"> <border> <textbox x:name="mytextbox" /> </border> <controltemplate.triggers> <trigger property="isfocused" value="true"> <setter property="focusmanager.focusedelement" va

How to query form library in SharePoint 2010? -

in moss 2007 use caml query query sharepoint list , in sharepoint 2010 found newly introduced linq sharepoint (where using spmetal utility generate data context class) works fine sharepoint list how query form library of fields promoted infopath form? i suggest use linq xml

iphone - UITableView Crashes -

hey everbody, i'm getting trouble here uitableview. i'm setting uitableview create rows dynamically using xml. on iphone simulator works fine, when build on device, when drag table or down, app crashes. something realized app crashes when row out of screen. so, when table still visible on screen, app works fine, when drag out of screen, crashes. here goes code: #import "comentariosviewcontroller.h" #import "tbxml.h" @implementation comentariosviewcontroller @synthesize listacomentarios, tabelacomentarios, nomescomentarios, ratecomentarios; - (void)viewdidload { listacomentarios = [[nsmutablearray alloc] init]; nomescomentarios = [[nsmutablearray alloc] init]; ratecomentarios = [[nsmutablearray alloc] init]; tbxml * tbxml = [[tbxml tbxmlwithurl:[nsurl urlwithstri

apache - htaccess password protect but not on localhost -

i have set dev site , want password protect validated visitors can view site. , good. getting annoyed, on local version, entering username , password. so, without changing htaccess file between local copy , 1 on dev site, how password protect site allow myself access without having enter username , password? something should trick.. require valid-user allow 127.0.0.1 satisfy from: http://httpd.apache.org/docs/2.0/mod/core.html#satisfy

jboss5.x - Upgrading from DeploymentService to ProfileService in JBoss 5.1.0 GA -

in jboss 5.1 profile service deployment service doing in jboss 4.x.in jboss 4.x using deployment service create datasource "on-the-fly" , wondering if same thing using profile service (since deployment service doesn't exist more in jboss 5.x). know practical guid on using profileservice? thank , regards. i don't know of guide can provide experience using profile service , few links jboss wiki pages on topic. i'd post more links spam protection doesn't allow me post more two, should find other pages in wiki on profileservice. don't suprised in case don't find much, there isn't more. profileservice managementview http://community.jboss.org/wiki/profileservicemanagementview profileservice deploymenttemplates http://community.jboss.org/wiki/profileservicedeploymenttemplates there you'll find usefull information profileservice no detailed information available in jboss wiki far can tell. in order create datasources on fly

iphone - JSON.framework add in xcode -

i have copy json.framework in developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.0.sdk/system/library/frameworks /developer/platforms/iphoneos.platform/developer/sdks/iphoneos4.0.sdk/system/library/frameworks both folder , importing #import <json/sbjsonparser.h> but when using giving me linking error error command /developer/platforms/iphonesimulator.platform/developer/usr/bin/gcc-4.2 failed exit code 1 ld build/debug-iphonesimulator/hellothere.app/hellothere normal i386 cd /users/samargupta/desktop/hellothere setenv macosx_deployment_target 10.6 setenv path "/developer/platforms/iphonesimulator.platform/developer/usr/bin:/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /developer/platforms/iphonesimulator.platform/developer/usr/bin/gcc-4.2 -arch i386 -isysroot /developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.0.sdk -l/users/samargupta/desktop/hellothere/build/debug-iphonesimulator -f/users/samargup

foreach - VBA For each loop for gluedshapes of a shape in Visio -

i trying loop through shapes gluedshapes , iterates once breaks giving "invalid parameter error" on me.application.activepage.shapes(i).gluedshapes(visgluedshapesall2d, "") during second iteration. surely if runs correctly on first iteration should run correctly on second , third etc... in code running through shapes looking specific type, iterate through gluedshapes array , check if it's id equal id returned per array element. the code follows: = 1 me.application.activepage.shapes.count if instr(me.application.activepage.shapes(i).name, "flow connector") > 0 each j in me.application.activepage.shapes(i).gluedshapes(visgluedshapesall2d, "") if s.id = j end if next j end if next thanks, appreciated. there no need loop through shapes use dim s shape dim id variant set s = application.activewindow.page.shapes.itemfromid(selection.primaryit

How do I enable DAC on a clustered SQL Server 2008 after I can no longer connect to SQL Server in any other way -

i'm having issues sqlserver 2008 server level triggered not dropped correctly. articles on web recommend dropping them through dac. however, dac disabled default on clustered environments. how enable dac bearing in mind can no longer connect sqlserver 2008 instance in other way. cheers andy according this article other alternative drop these triggers stop server , restart using minimal configuration mode . can enable dac.

java - Aggregation, Association and Composition -

this question has answer here: c# code association, aggregation, composition 2 answers i have such simple example: public class order { private arraylist<product> orders = new arraylist<product>(); public void add(product p) { orders.add(p); } } is aggregation or composition? guess it's composition, because orders delated after delete of order, right? unfortunately task , answer different;/ know why? second problem: public class client extends person { string adress = ""; orders orders = new orders(); public client(string n, string sn) { name = n; surname = sn; } public string getaddress() { return adress; } public orders getorders() { return this.orders; } } is association between client , orders? teacher told me association, wondering why it's not

Django: How to use float precision instead of double precision in MySQL -

models.floatfield creates double in mysql. possible, , how, create float precision field instead of double precision? the justification similar of having smallintegerfield. there few options this, don't understand why want to. change in database, won't work when recreating tables django won't manual cast if database changes, results. create custom fieldtype (i.e. inherit floatfield , change get_internal_type() returns singleprecisionfloatfield . after need create own database backend , add custom type creation.databasecreation.data_types (source: http://code.djangoproject.com/browser/django/trunk/django/db/backends/mysql/creation.py ) change every floatfield single precision. above have create own database backend and/or change floatfield implementation in current one.

MySQL stored function, how to check for no rows and not generate a warning? -

i've function: drop function if exists find_linkid; delimiter // create function `find_linkid`(pc1 varchar(50) returns int begin declare linkid int; select a.id linkid pc_a a.pc=pc1; on if linkid null select b.id linkid pc_b b b.pc=pc1; end if; return linkid; end // basically, run 1 query, if doesn't return (the a.id declared not null), run query , return link id. if isn't found either, linkid null, returning null if pc1 isn't found @ ok. this works, gives warnings if first query doesn't return anything: select find_linkid('12bd'); +------------------------------+ | find_linkid('12bd') | +------------------------------+ | 667 | +------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> show warnings; +---------+------+-----------------------------------------------------+ | level | code | message

design - How to decide when to implement a C++ template? -

i'm coming c, , getting deeper , deeper c++. using container classes of standard library, as-well smart pointer classes boost library, i've had first introduction class templates. use them lot now. recently made first approach of writing my own class templates . 99% of can think of, class template might useful, class template exists in standard library or 1 of boost libraries. when decide implement class template? criteria? have example? c++ proposes several programming paradigms, have discovered, , not exclusive. what write templates written object-oriented codes, it's matter of trade-off. the c++ templates follow generic programming paradigm, idea class / method able work type, long instances of type follow concept . the first striking difference, regard object-oriented code, there no need common base class. in fact, combining templates , free-functions, can work heterogeneous set of objects. that therefore when shine: if have heterogeneous set

objective c - Select the default window to be opened at startup -

i'm working on macos x (objective-c / cocoa) application works way : first window opened, requesting user's username / password. if credentials valid, main application displayed. this open credential window : @implementation betaseriesdesktopappdelegate - (void)applicationdidfinishlaunching:(nsnotification *)anotification { authwindow = [[authenticatewindow alloc] init]; [authwindow makekeyandorderfront:nil]; [authwindow becomefirstresponder]; } - (void)login:(id)sender { nslog(@"login"); user *user = [[user alloc] init]; } @end problem is, main window if opened @ application startup. how can prevent so? property must set in interface builder or have in applicationdidfinishlaunching method? else? in interface builder, select window. in window attributes info pane, deselect option "visible @ launch".

ruby - connect: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) -

i'm having terrible time getting ssl verify certificate. i'm ignorant on how certificates work that's major handicap begin with. here's error when running script: c:/ruby191/lib/ruby/1.9.1/net/http.rb:611:in `connect': ssl_connect returned=1 e rrno=0 state=sslv3 read server certificate b: certificate verify failed (openssl ::ssl::sslerror) here's relevant code: client = savon::client.new order_svc request = client.create_empty_cart { |soap, http| http.auth.ssl.cert_file = 'mycert.crt' http.auth.ssl.verify_mode = :none http.read_timeout = 90 http.open_timeout = 90 http.headers = { "content-length" => "0", "connection" => "keep-alive" } soap.namespaces["xmlns:open"] = "http://schemas.datacontract.org/2004/07/namespace" soap.body = { "wsdl:brand" => brand, "wsdl:parnter" => [ {"open:catalogname" => catalogna

windows - How to transcode video formats -

we're converting bunch of .rm files .mp4 , wondered best way is. here details: convert files h.264. keep filename add .mp4 end. also extract jpg image of video @ 5 seconds in each file , name original filename + .jpg. this on windows system. there free tool recommend this? thank you. ffmpeg pretty defacto standard app transcoding video. http://www.ffmpeg.org/ convert h264/mp4: ffmpeg.exe -i inputfile.rm -vcodec libx264 -s 320x240 -acodec libfaac outputfile.mp4

c# - explaining the parts of the ldap string "LDAP://DC=amrs,DC=win,DC=ml,dc=COM" -

can explain makeup of ldap string parts. the 1 have is: string strsql = "select mail 'ldap://dc=amrs,dc=win,dc=ml,dc=com' samaccountname = '" + username.replace(@"amrs\", "") + "'"; this gets email particular username. need other info ldap query , fail setting correct , have no clue values in ldap settings. "ldap://dc=amrs,dc=win,dc=ml,dc=com" can explain me please? the dc= prefix in ldap string stands domain component (dc). these parts make domain of ldap server. fixed , need used object on server. in "dns style", read: (something).amrs.win.ml.com (e.g. server name, machine name etc.) richard mueller has great post explaining commonly found prefixes in ldap bind strings - stuff dc= , ou= (organizational unit) or cn= (common name).

sql server - Passing MDX parameters to SQL query -

i have several reports ssas 2008, 1 of them has drill through sql server report because data far granular cube. any tips on passing parameters? of course passed in mdx, , can't figure out way "key" source mdx. surprisingly can't find lot of pointers on this. let me know if vague... are getting mdx passed in string can examine , fiddle with? if can extract dimension , member name, name in sql database find id required, passed on? i assume getting strings this: [location].[all location].[south].[surrey].[guildford] if 'guildford' in sql db you'll able find out row 2134 , that's need?

actionscript 3 - How can I pass all parameters (one by one) in an object to a constructor in AS3? -

this hard question do, i'll try explain. have class , parameters of contructor object. need function returns instance of class, passing parameters constructor. this code: random , unmodifiable class: public foo { public function foo(a:int, b:string) { // constructor } } and function (in class): function bar(params:object):* { var baz:foo = new foo(params.a, params.b); return baz; } what need make function generic, without pass params parameter foo constructor because can't modify it. like: function bar2(clazz:class, params:object):* { var baz:* = new clazz(/*some magic way transform params in comma separated parameters*/); return baz; } anyone can me? lot. this called parameterized factory. first thought function.apply , doesn't apply constructors (he-he). so, people making factories this: function create(what:class, args:array):* { switch (args.length) { case 0: return new what(); case

ajax - Scrolling gallery using Javascript -

i trying build this flash gallery using javascript. can point me towards this? i @ jquery ui or jquery tools, have many built in effects might able this.

python - GAE verify appspotmail.com forwarding -

i trying setup email forwarding my-domain.com myappid.appspot.com. when sign in email account , enter email forwarding messages, says confirmation message code had been sent there. how can access code? i created , made forward confirmation message email. there got link, clicked , worked perfectly! class logsenderhandler(inboundmailhandler): def receive(self, mail_message): logging.info("received message from: " + mail_message.sender) sender_address = "sender@email.com" subject = "processing message" user_address = 'my@email.com body = mail_message.original mail.send_mail(sender_address, user_address, subject, body)

actionscript 3 - How big should a Flex SWF be? -

i've small flex4 project targeting flash 10, developed in flashdevelop. know flex swfs carry overheads plain as3 project, 240kb release build seems still lot - it? or realistic minimum? in case it's relevant, flashdevelop builds project following (anonymized): mxmlc -load-config+=obj\********.xml -incremental=true -benchmark=false -optimize=true -static-link-runtime-shared-libraries=true -o obj\***************** doesn't flash player include flex runtimes or sensible that? the player not include flex framework. shouldn't. flex framework independent of player , if included player have include every version of framework use 1 each swf built against. solve framework different (as flash framework). the resolution large swfs use framework runtime shared libraries. way player load shared library swf once specific framework version used , shared library used across swfs compiled against same framework version. you can find more information here: htt

c++ - Is a Boost windows program portable to other windows systems? -

i'm considering 2 options program. either c++ boost asynchronous io or java asynchronous nio. know java portable long system has java run time. i'd prefer use c++ boost i'm not sure if program write can ported different windows machine , still run. need ensure program has necessary dependencies @ runtime? plan on using windows.h, c++ 2003 standard, , boost libraries. so long use boost, c++ standard library (and crt, if feel must), code port pretty easily. make sure avoid microsoft crt extensions such str*_s functions (e.g. here ) - msdn not flag these nonstandard, unfortunately. also avoid using c++0x features in visual c++ v10 maximize portability in short term - or check other compilers targeting have features plan use. be careful: if use bunch of stuff out of windows.h , break portability , increase work need do. avoid as possible if expect port later, , if need there, try isolate usage in distinct 'i need change when port' header , code f

webforms - Help creating multi page web form with perl CGI -

i want create multi page web form using perl cgi changes page based on drop down selection. have looked @ tutorials multi page cgi form moves in order mine able go different page based on selection. i'm not sure how should try organize different pages , handle switching pages without getting messy. suggestions how organize , move throughout pages great help. from perspective of cgi script, ui element source of submission not make difference @ all. matters name/value pairs script receives. if want form submitted without user having click submit button, you'll need @ javascript client side issue, not server one.

vb.net - Conditional statement in databound expression -

i want display image if 2 conditions met. the data item not null the value of data item greater 0 markup <img id="img1" runat="server" visible='<%#iif( databinder.eval(container.dataitem, "amount") dbnull.value or databinder.eval(container.dataitem, "amount") = 0, false, true)%>' src="/images/check.png" /> error message operator '=' not defined type 'dbnull' , type 'integer'. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidcastexception: operator '=' not defined type 'dbnull' , type 'integer'. try using orelse . in vb.net or conditional operator causes both sides evaluate regardless of success. if have null it's going attempt comparison anyway. using orelse cause second condition not evaluated i

jquery - How to output multi-line HTML with variable interpolation using Javascript? -

i'm trying output following each time function run: <object id="video" width="500" height="500" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" /> <param name="allowfullscreen" value="true" /> <param name="flashvars" value='config={"playlist":["poster_location", {"url": "clip_location","autoplay":false,"autobuffering":true}]}' /> <img src="poster_location" width="500" height="500" alt="poster image" title="no video playback capabilities." /> </object> and i'd interpolate javascript variables within parts of code (to change video/poster etc). i realise can done targeting each part need

Learning & Using "old" languages (Ada/Cobol/Algol) -

are there reason learn languages such ada , cobol? there future in programming in languages? i'm interested in languages , i'm learning them fun. its worthwhile learning new languages. if they're never useful professionally chances they'll teach programming didn't know before or @ least broaden outlook. as prospects quick bit of reading around seems ada still in favour critical systems in aviation industry , cobol still has place in business. know engineer in mid 20's writes code in fortran77 that's industry wants! while number of employers looking these languages might low, because there limited number of people know them salary developers specialise in them can quite high. when mission critical apps developed in them cost millions replace having pay more usual coder maintain existing system accepted.

routed commands - WPF Commanding problem -

why commanded control disabled command can executed? command runs alt + f4 public static class commandlibrary { static commandlibrary() { shutdowncommand = new routeduicommand("exit", "exit", typeof(commandlibrary), new inputgesturecollection {new keygesture(key.f4, modifierkeys.alt)}); } public static routeduicommand shutdowncommand { get; private set; } public static void bindcommands(window hostwindow) { if (hostwindow == null) return; hostwindow.commandbindings.add(new commandbinding(shutdowncommand, onshutdowncommandexecuted, onshutdowncommandcanexecute)); } private static void onshutdowncommandexecuted(object sender, executedroutedeventargs e) { messagebox.show("shutdown excuted!"); } private static void onshutdowncommandcanexecute(object sender, canexecuteroutedeventargs e) { e.canexecute = true; } } <menuitem command="local:commandlibrary.shu

Javascript: how to get text nodes following/preceding break tags and wrap them with ddb tag? -

i have accomplished in jquery implementation in javascript without dependence on libraries. $("br",document).parent().contents().each(function() { var text = this.textcontent ? this.textcontent : this.innertext; text = this.textcontent.replace(/\s+/g, '') if ( this.nodetype == 3 && text.length != 0) { $(this).wrap('<ddb></ddb>') } }); the following code should exact same thing function does. <html> <body> hello <p> hello <br/> hello 2 <br/> <br/> <br/> </p> <button onclick="wraptext()">wrap</button> <script type="text/javascript"> function wraptext() { var nodelist = document.getelementsbytagname('br'); (var i=0; < nodelist.length; i++) { var node = nodelist[i]; var parentnode = node.parentnode; if (!parentnode) continue; (

iphone - How to show an UIAlertView (Or UIView) at the first launch of an Application? -

i know how show uialertview or uiview @ first launch of application. thanks. use nsuserdefaults store bool, so: -(void) showfirstrunalerts { bool ranbefore = [[nsuserdefaults standarduserdefaults] boolforkey:@"ranbefore"]; if (!ranbefore) { uialertview *alert = [[uialertview alloc] initwithtitle:@"message title." message:@"your message." delegate:self cancelbuttontitle:@"thanks!" otherbuttontitles:nil]; [alert show]; [alert release]; [[nsuserdefaults standarduserdefaults] setbool:yes forkey:@"ranbefore"]; [[nsuserdefaults standarduserdefaults] synchronize]; } }

How to determine the value of key pressed in Windows Phone 7 Numeric Keyboard? -

i hooked event handler keydown event of textbox. event handler has argument of type keyeventargs properties key , platformkeycode . issue both 1 , ! keys pressed on windows phone soft keyboard, values key , platformkeycode d1 , 49 respectively. cant tell key pressed. keyboard.modifiers static property returns " none " so how determine key pressed? this known issue. keydown/onkeydown , keyup/onkeyup issues you read input values instead , act on 1 / ! seperately.

java - Constant code-completion in Netbeans -

i've discovered strg+space brings suggestions code completion in netbeans. 1 of features i've loved in visual studio , i'm glad it's available in netbeans, too. in opinion intellisense job. on contrary pressing strg+space suggestions not comfortable. know write , use auto-completion variable , method names. therefore typing name faster using strg+space , picking suggestion. suggestions shown while i'm coding. under tools/options i've toggled on sounds "code completion", "auto popup completion window", "auto popup documentation", ... it's not working. still have use strg+space. shall do? intellij has 3 auto-complete modes , find more powerful same in eclipse/netbeans. it annoying press + if not used it, sine have 3 modes, want able select 1 want. perhaps used , without thinking it.

Handling exceptions in Silverlight Asynchronous lambda calls -

in silverlight use lambdas data retrieval service (in example wcf data service). exceptions inside callback swallowed system unless handle them try catch. example: this.context.beginsavechanges(() => { // throwing exception lost , application_unhandledexception doesn't catch }, null); i have helper function log exception , redirect aspx general error page, have wrap in lambdas try/catches ok, if have it, there better way? you create set of helper methods wrap lambda's with:- public static class helper { public static asynccallback getasynccallback(action<iasyncresult> inner) { return (a) => { try { inner(a); } catch (exception err) { // handling "uncaught" errors } }; } public static action getaction(action inner) { return () => { try {