Posts

Showing posts from June, 2014

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - signal sent when stream is closed -

i have client-server app , observed (in local environment i.e. lan ) when close stream connects client server @ 1 end, @ other end observable ( i.e. if in client close stream connects client server, @ other end, @ server, noticeable , reported exception in try-catch block surrounds server-stream code ) . how possible ? client/server send specific code stream closed before closing stream ? applicable in wider networks ( big wans ) ? the bigger question when close stream @ 1 end, can rely on fact @ other end noticed , in consequence close thread , not wait endless recieve data never come due fact that stream closed ? the maximum distance between client , server 700 km ( don't know if plays role mentioned in case ) thanks ! in tcp, connection shutdown procedure involves sending additional datagrams other side, each side notice connection orderly shut down. relying on has 1 major pitfall: in case of unorderly shutdown (e.g. physical disconnect of network cable)

spring mvc - #springFormInput Sytex problem -

#springforminput("userform.password" 'type="password"') not working; is correct? use #springformpasswordinput("userform.password" "") ( list of macros )

asp.net - What is the best invisible character can I use to replace  ? -

i use telerik report print report. i need use telerik.reporting.textbox print labels. some labels stock in .txt files, " apple". when see label spaces, means have indent in report, in textbox. the thing when export report in pdf, have indentation, not when see in browser. if replace spaces "& nbsp;", see indentation in browser, when exporting pdf, see "& nbsp;". one way use htmltextbox, both browser , export works fine, have other constraints says must keep textbox. my idea replace spaces blank character, invisble one, alt+0160, there lot of choice, , want 1 work in browser, export (tiff, pdf, excel...). is have clue choice ? you use unicode code point u+00a0 (non-breaking space), entity   represents. how should encoded in document depends on character set in use.

facebook - Android Social Stack -

i wanna create application interact social networks twitter , facebook. feeds , display on screen. there api can use ? yes,there need use api both ,please refer link more https://github.com/facebook/facebook-android-sdk http://www.vogella.de/blog/2010/02/15/twitter-android/ http://www.androidpeople.com/android-post-status-to-twitter-using-jtwitter-example/ i hope may while..

JQuery/Javascript - Search DOM for text and insert HTML -

how search dom string in document's text (say, "cheese") insert html after string (say, "< b >is fantastic< /b >"). i have tried following: for (var tag in document.innerhtml) { if (tag.matches(/cheese/) != undefined) { document.innerhtml.append(<b>is fantastic</b> } } (the above more of illustration of have tried, not actual code. expect syntax horribly wrong please excuse errors, not problem). cheers, pete there native methods finding text inside document: msie: textrange.findtext() others: window.find() manipulate given textrange if found. methods should provide more performance traversing of whole document. example: <html> <head> <script> function fx(a,b) { if(window.find) { while(window.find(a)) { var node=document.createelement('b'); node.appendchild(document.createtextnode(b)); var rng=window.getselectio

c# - UDP hole-punching: testability on single machine -

i'm writing simple p2p application test feasibilty of using udp hole-punching in larger project. i tried test apps home yesterday , worked. however, @ work , same code no longer job. sender sending appropriate port on external ip address of our router here, receiver isn't getting of them. prior calling udpclient.receive() , receiving app sends packet ip:port listening on. again, works on home setup, not here. outcome same regardless of whether windows firewall on or off, that's not issue. could routers handling situation differently? edit1: both apps run on same machine. in answer own question: the routers indeed exhibiting different behavior. my home router hooked laptop. assume why when send out udp packet port n leaves router on port n . however, work network consists of several computers , router randomizes port on end, means packet sent port y leave router on port x . i have gotten home , work machines communicate through nat without us

.net - does microsoft have its own external grid controls? -

except available in visual studio, there official external microsoft's grid controls? example, telerik has controls .net. microsoft have similar ones? edit: it's webforms... thanks, ilija the controls reference (like telerik) made used inside of vs .net. since microsoft built .net (and vs) had no reasons make 'external' controls. if around places codeplex , sourceforge can find 'external' grids, of them not offically supported microsoft controls.

compression - Reducing video size with same format and reducing frame size -

this question might basic is there way reduce frame size/rate of lossy compressed (wmv, mpeg) format, smaller video, of lesser size, same format. are there open source or proprietary apis this? ffmpeg provides functionality. need run someting like ffmpeg -i <inputfilename> -s 640x480 -b 512k -vcodec mpeg1video -acodec copy <outputfilename> for newer versions of ffmpeg need change -b -b:v : ffmpeg -i <inputfilename> -s 640x480 -b:v 512k -vcodec mpeg1video -acodec copy <outputfilename> to convert input video file video size of 640 x 480 , bitrate of 512 kilobits/sec using mpeg 1 video codec , copying original audio stream. of course, can plug in values need , play around size , bitrate achieve quality/size tradeoff looking for. there ton of other options described in documentation run ffmpeg -formats or ffmpeg -codecs list of of available formats , codecs. if don't have target specific codec final output, can achieve better c

how to integrate graphs and pie charts in Google sites as a form? -

how integrate pie chart , graphs in google sites can please me out google apps script have checked out google visualization api ?

shared hosting - Connecting to Zend Debugger on remote server -

i having great difficulty connecting zend debugger on dreamhost account. following error message. failed connect host '192.168.11.7'. failed connect host '192.168.56.1'. failed connect host '127.0.0.1'. is problem debugger not being able connect local machine? need forward port on router perhaps? i have added external ip allowed hosts no avail. any hints appreciated, thanks is xdebug enable on dreamhost - not sure is. can port forward using ssh shell, check here

canvas - DICOM image viewing on Web app -

i need know if dicom image needs shown on browser, approach should followed? image server else on cloud. need access dicom image, paint in canvas, if user edits upload edited image server. need have performance well, dicom images huge in size(~1gb) best way this? 1) dicom images aren't modified users. (maybe annotations or window/center values), it's different. 2) dicom images ~1mb, yours special. doubt standard viewers load them. 3) no display able show 1gb @ time, it's enough send small-resolution version of image (max 1mpx), , send updates zoomed areas. given this, you'll have explain better question.

networking - Javascript XMLHttpRequest: Ignore invalid SSL Certificate -

so have been having trouble grabbing information device interfaced via https due fact has invalid security certificate. know device trusted , don't have access server-side can't change it. wondering if there way set xmlhttprequest object in javascript ignore invalid ssl certificate , grab information anyway. seems reject certificate , stop. thanks. well had found solution before didn't work, because still using actual xmlhttprequest though. when creating using statement: httpreq = new activexobject("msxml2.serverxmlhttp.3.0"); there method called setoption opened use: httpreq.setoption(2, 13056); with parameters, request ignores invalid certificate , grabs information anyway. if understand correctly won't work non-microsoft technology trying run script, that's ok scope of project.

c# - Invoke a SOAP method with namespace prefixes -

my c# web service client sends following soap message java-based web service: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body> <getdata> <request> <requestparameters xmlns="http://b..."> <equals> ... </equals> </requestparameters> </request> </getdata> </soap:body> </soap:envelope> and java-based web service returns error: 500 internal server error ... cannot find dispatch method {}getdata ... client written in java, works, sends following message: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.o

Where is SVN caching the hostname? -

when perform svn checkout , specify hostname, svn attempting resolve hostname old repo no longer use. cannot find old hostname (codespaces.com) being cached. checkout http://mysubdomain.unfuddle.com/svn/ , revision head, recursive, externals included options of 'http://mysubdomain.unfuddle.com/svn/': not resolve hostname `https://svn.codespaces.com/my-old-project/': requested name valid, no data of requested type found. (http://mysubdomain.unfuddle.com) i have uninstalled tortoisesvn , svn itself. , reinstalled them 1 one. have searched c drive , registry string literal codespaces.com - no avail. this has had me banging head on table 2 full days , @ wits end. can shed light on how resolve issue? the host stored in .svn/entries .

visual studio 2010 - Building a website project as 32-bit on a 64-bit build server -

i have vs 2010 solution contains website has web service within it. web service references com dll causing problems when solution built on our 64-bit build server. typical 32/64-bit error: aspnetcompiler : error aspconfig: not load file or assembly 'xxx' or 1 of dependencies. attempt made load program incorrect format when build site using 32-bit aspnet_compiler builds okay. so, how specify website should built 32-bit? configuration manager within vs let me choose cpu, cannot change x86 website... thanks. you can use following command. actually, in case using aspnetcompiler x86 edition build own project call "c:\program files\microsoft visual studio 2008\vc\vcvarsall.bat" x86 msbuild mysolutiuon.sln you can use x86_amd64 cpu. note instead of using msbuild can load confiiguration like <project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <target name="precompileweb"> <aspnetcompile

.net - Customized ConfigurationSection in Derived Project -

i created base library customized configuration section located. works fine far - in derived libraries: <mysection> <tooling> <add key="asdf" value="bla/> </tooling> </mysection> now want modify configuration section "mysection" in new derived library properties. exception section 'specialtooling' not known - because defined in derived class. is possible todo?

JQuery tooltip that supports new line -

i'm looking lightweight jquery plugin displaying tooltips when user hovers on element. plugin content title attribute , it's important can make new lines. any appreciated! i use tipsy . you can add html element in tipsy, <br/> works. you need pass html option such : $('#example-html').tipsy({html: true }); if don't want use title attribute display html (it won't validate in case), can use fallback option. $('#example-fallback').tipsy({fallback: "where's tooltip yo'? <br/> yay !" }); more options , examples on tipsy webpage .

Using PHP to split a URL -

i creating php proxy accepts url , confirms on list of servers. when importing url application ran issue needed 2 parser tags. need split along "\?" tag string, in case, "export?" i using preg first tag. accept strings export tag or there other method doing this? please le me know how accomplished or if have more questions. as ircmaxell has stated in comments , php have function parse url: parse_url . and when have url path (i assume export? path suffix plus query indicator), can use explode split path path segments: $path = parse_url($url, php_url_path); $segments = explode('/', $path); you can last path segment 1 of following: end($segments) $segments[count($segments)-1] and cope trailing slashes, can use rtrim($path, '/') remove them. all together: $url = 'http://www.example.com/subfolders/export?'; $path = parse_url($url, php_url_path); $segments = explode('/', rtrim($path, '/')); echo e

java - Get database connection from a connection pool -

i refactoring others code. 1 thing notice of manner on how system getting connection connection pool. sample this. on every call of service method, system making context lookup on jndi datasource. public class checkinservlet extends httpservlet { public void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { try { //obtain connection initialcontext initialcontext = new initialcontext(); javax.sql.datasource ds = (javax.sql.datasource) initialcontext .lookup("jdbc/mysqldb"); java.sql.connection conn = ds.getconnection(); //business logic //redirect } { conn.close(); } } } i think there performance hit on doing every time. thinking of way around these on how retrieve connection connection pool. i thinking using servlet's init() method think not optimal. idea

java - Prefix for testing methods in Unit: "test" vs "should" -

it common practice prefix tests method names in junit "test". in last few years, people changed prefix "should". if want test customer creation in database, name method "testcustomercreation". however, people name "shouldcreatecustomer". this lot of personal taste when person in project or when else in project agrees me. when/where not case, divergences or inconsistent mixes starts shows up. i readed somewhere article of guy named methods "testshouldcreatecustomer", , reason decided drop "test" prefix. in fact wasn't prefixing "test", using "testshould" , changed "should". obviously, did not convinced me. i inclined stick "test" prefix because methods names starts verbs in infinitive form ("get", "set", "add", "remove", "clear", "send", "receive", "open", "close", "read", &

Rails: Active Model explanation? -

what's difference active resource , active record in rails? activerecord: orm manage data in relational database through sql. read more.. activeresource: manage data through rest api on server, no longer part of rails, extracted gem. read more.. activemodel: behavior (mixins) make ruby object act it's activerecord or activeresource adding validations, callbacks, naming conventions, tracking, etc. read more..

php - replicate json encoded assoc array? -

i have json string { "to": { "data": [ { "name": "f8", "id": "11204705797" }, { "name": "f9", "id": "11205705797" } ] } } and need replicate in php, have array of name&id's this array ( [friends] => array ( [0] => 939394934-steve [1] => 939394934-steve [2] => 939394934-steve [3] => 939394934-steve ) ) and explode - id-name how can this? if understand correctly, want this: $data = array(); foreach ($array['friends'] $friend) { list($id, $name) = explode('-', $friend, 2); $data[] = array( 'name' => $name, 'id' => $id, ); } $to = new stdclass; // 'to' appears object... because of {} $to->data = $dat

cocoa - When programming for Mac OS X, is there an equivalent to viewDidLoad? -

possible duplicate: viewdidload in nsviewcontroller? i started development on ios apps , moving mac os x apps. wondering if there's equivalent method in mac os x ios's viewdidload run code after view controller launches. thank you! from apple release notes : advice people looking -viewwillload , -viewdidload methods in nsviewcontroller even though nswindowcontroller has -windowwillload , -windowdidload methods override nsviewcontroller class introduced in mac os 10.5 not have corresponding -viewwillload , -viewdidload methods. can override -[nsviewcontroller loadview] customize happens before or after nib loading done view controller.

tortoisesvn - Parallel path in SVN overwriting each other's files -

i have 2 paths, let's say: root\folder1 root\folder2 while folder names different, both contain files same names, of contents differ. have paths , files added svn. now, make change root\folder1\filea , commit it. if try make change root\folder2\filea, error citing need update first. when update, local copy overwritten changes made filea under root\folder1. , works vice versa. i don't know why happening. deleted root\folder2 , recreated , re-added svn. same thing still happening... it sounds folder1 , folder2 2 working copies of same repository directory. if check svn info (or equivalent in tortoisesvn) folder1 , folder2, should give clue what's going on.

cocoa - Library app Vs Standalone iPhone app -

i building native iphone application wherein application act standalone app on 1 device , act library on other device. can please guide me how should design app. should same method "applicationdidfinishedlaunching" called in both cases , in basis of parameters distinguishing call made. because, in both cases, have different screen flows. library code has compiled running app used. no other app can access code, apps sandboxed , prohibited accessing each other's directories, , code contained in such. if taps on icon, if library code not exist app. another app can start app using registered launch url, result in app being brought foreground. other app put background or terminated.

windows - 'git' is not recognized as an internal or external command -

when try use git command on regular windows cmd or cmd ruby, following error. 'git' not recognized internal or external command, operable program or batch file. how fix problem? have correctly set path point @ git installation? this how can it: right-click "my computer", select "properties", open "advanced", click "environment variables", highlight "path" variable, click "edit", add specific path front of "variable value" field, separated semicolon existing entry. do not add space between ; , last entry

c# - Remove \r from string -

i have html in string have tried utmost remove \r many times fails. text.replace("\r\n", "").replace("\r", "").replace("\n", ""); you need assign result text , like: text = text.replace("\r\n", "").replace("\r", "").replace("\n", "");

java - drawing rectangle -

i writing program accepts coordinates user , drawing shapes on screen stars(*) e.g rectangle i.e rectangle=100,150,50,50 x,y,width,height. how can it?? i think tutorial useful you: http://download.oracle.com/javase/tutorial/2d/geometry/primitives.html

lucene - How to reload synonyms.txt in Solr? -

when changed synonyms.txt see diferences when this: restart solr server indexed item (empty commit?) some knows way reload synonyms.txt file without restart server? tks lot. reloading core should reload synonyms. map indexes cores (even if it's 1 core per instance) due enhanced flexibility provides (as in case).

c# - WCF in IIS, using MSMQ in workgroup mode -

i've been trying out msmq wcf, can't seem work properly. i've got client (which sends messages queue) working, using wcf , service reference. code more or less this: static void main(string[] args) { var client = new msmqservicereference.msmqcontractclient(); client.sendmessage("test"); client.close(); console.readkey(); } where msmqcontractclient proxy generated visual studio when add service reference. endpoint in app.config pointing msmqueue: <client> <endpoint address="net.msmq://localhost/private/msmqservice/msmqservice.svc" binding="netmsmqbinding" bindingconfiguration="msmqbindingnontransactionalnosecurity" contract="msmqservicereference.imsmqcontract" name="msmqservice" /> </client> this works, messages being posted queue. now trying service work, keep getting error: binding validation failed because binding's msmqauthentication

css - Prepend comment to SASS/Compass output -

is there convenient way have sass automatically prepend comment beginning of each css output file? specifically, when using compasss i'd stick brief warning telling designers not edit css directly , point them instructions on getting started compass. use output style of :compressed , strips out comments in input scss/sass file. if there isn't convenient way i'll submit issue/patch. thinking of adding option named :output_prefix takes string prepended output css files. compressed strips out comments. suggest put in property: warning { do-not: "edit file"; } regarding proposed patch, not think use case compelling enough warrant such feature.

ms access - SQL Server sp_who shows last workstation to link tables hostname instead of present workstation hostname -

i've got access front end sql server 2008, when exec sp_who see who's using in manner workstation id's show workstation id. i'm guessing because last person link remote tables in fact, me. is there way fix this? it's not terrible it's happening seems there's easy way resolve this. i pass actual workstation id on multiple queries on end when things deleted, they're present user (and not other users data). also in logon form front end tried link 1 table via vba code see if remedy problem, seemingly did not. changed code pass wsid along odbc connection string , re-link tables on first open fixes this.

javascript - Copy all styles from one element to another -

how can every styles (even inherited) element element b ? in javascript or using jquery. let's tell have element <p class="foo">...</p> , append new element <div /> same, except content. if don't care ie, can this: var p = document.getelementbyid("your_p_id"); var div = document.createelement("div"); div.innerhtml = "your div content"; div.style.csstext = document.defaultview.getcomputedstyle(p, "").csstext; this works inline, embedded, , inherited styles. edit: , "don't care ie," of course meant "don't care except webkit." update: works in current versions of chrome(19), safari(5), firefox(12), , ie(9). it works in older versions of some, such ie8.

Dynamic Object .NET -

i facing interesting problem right now. know not pretty have cope anyway. i calling webservice returns (array of string) (by index) 0 - table name ("employees") 1 - list of fields returned ("id, name, birthdate") 2 - first field value ("1") 3 - second field value ("bobby") 4 - third field value ("1970-01-01") what accomplish create object name after index 0, having strings in index 1 being properties , feed them proper value. what best way accomplish this? have started reading expandoobject before going far hear take on this. regards edit: have quite few different tables fetch data from, causing me problem. it depends on use-case doubt dynamic way go here. have name-value collection so: class result { dictionary<string, string> values = new dictionary<string, string>(); public string this[string name] { { return this.values[name]; } set {

ios - How to fetch application icon and application description from iTunes store? -

how fetch application icon , application details itunes store if have app id? i believe there way retrieve @ least icons via 1 of many app store rss feeds , perhaps more via custom feed . i've not tried method, know @ least apps , websites use them way. better answer you can retrieve requesting xml information app store. dan grigsby wrote about year ago: app store data mining techniques revealed – part 1 app store data mining techniques revealed – part 2: scripting app store xml downloads part 2 explains how send query specific app using app id. article doesn't provide code doing in ios, it's straightforward once know ask for.

sql server 2005 - Telerik MVC Extensions GridBindingToData sample: CRUD operations using ADO.NET DataTable (arbitrary table)? -

in gridbindingtodatatablesample sample can found @ url: http://www.telerik.com/community/code-library/aspnet-mvc/grid/crud-operations-using-ado-net-datatable.aspx hard coded datakeys , columns collection. need generic crud code work html.telerik().grid html helper. imagine have metadata tablecolumnmedatata table contain table/column metadata: table column type length pk ============================================= emploc employeeid int 4 1 emploc locid int 4 1 --------------------------------------------- orders orderid int 4 1 orders customerid nchar 10 0 orders employeeid int 4 0 orders orderdate datetime 8 0 orders shipvia int 4 0 orders freight money 8 0 orders shipname nvarchar 80 0 --------------------------------------------- employees employeeid int 4 1 employees lastname

jquery - How to replace text inside the jgrowl box smoothly? -

i setting text inside jgrowl message box. here example: function findid(whichid, command){ if($(whichid).length) { var url='<script>\n\ $("'+whichid+'").fadeout().load("include/common.php?q='+command+'&p='+username+'", function(response, status, xhr) { $(this).fadein(); });<\/script>'; $(whichid).fadeout().html(url).fadein(); } } var myid0="myid0"; var data='<div id="'+myid0+'" class="arm-info"></div>'; $('#rightcolumn').jgrowl(data, {sticky:true }); mytimerid0=window.setinterval(findid, 3000, '#'+myid0, "show_queue"); it works replacement jerky. how make smooth transition between 2 load calls? thanks arman. maybe replace html after fadout complete, fadein

iphone - memory leak using MBProgressHUD -

i using mbprogresshub, variations on code found here . some things code: the code in app delegate a number of other classes call it i'm using asynchronous nsurlconnection i not declare it: @property (nonatomic, retain) mbprogresshud *hud; i not : @synthesize hud; (and of course not release in dealloc) i use follows: - (void)setsearchingmode:(bool)issearching { // when network action, toggle network indicator , activity indicator if (issearching) { [uiapplication sharedapplication].networkactivityindicatorvisible = yes; uiwindow *thewindow = [uiapplication sharedapplication].keywindow; hud = [[mbprogresshud alloc] initwithwindow:thewindow]; [thewindow addsubview:hud]; //hud.labeltext = @"connecting"; [hud show:yes]; } else { [uiapplication sharedapplication].networkactivityindicatorvisible = no; [hud hide:yes]; [hud removefromsuperview]; [hud release]; } }

c++ - How to use Memcpy() function -

i want use memcpy in end, instead of block_orig_left[i1][j1]=block_orig[i1][j1]; pred_orig_left [i1][j1]=block_pred[i1][j1]; i have error using memcpy src/coder.c:909: error: invalid operands binary * (have ‘unsigned int’ , ‘int **’) src/coder.c:910: error: invalid operands binary * (have ‘unsigned int’ , ‘int **’) int **block_orig_left=null; block_orig_left=intmatrix(bsize_y_level[levelv], bsize_x_level[levelv]); pred_orig_left=intmatrix(bsize_y_level[levelv], bsize_x_level[levelv]); for(i1=0; i1<bsize_y_level[levelv]; i1++) for(j1=0; j1<bsize_x_level[levelv]; j1++) { block_orig_left[i1][j1]=block_orig[i1][j1]; pred_orig_left[i1][j1]=block_pred[i1][j1]; average_block_orig_left+=block_orig[i1][j1]; } memcpy(block_orig_left, block_orig, sizeof(int **)*block_orig); memcpy(pred_orig_left, block_pred, sizeof(int **)*block_pred); how use memcpy correctly? you multiplying size of int** int**, doesn't make sense. in other words,

c# - multiple uses of attached property does not work -

my guess i'm not understanding attached properties correctly. i'm trying convert flowdocument on richtextbox html string property in view model. have 2 richtextboxes using richtextboxassistant class (thanks this blog post ): <richtextbox x:name="rtb_description" local:richtextboxassistant.bounddocument="{binding myvm.description, validatesondataerrors=true}"/> <richtextbox x:name="rtb_descriptionhowto" local:richtextboxassistant.bounddocument="{binding myvm.descriptionhowto, validatesondataerrors=true}" /> in richtextboxassistant class, have dependency property: public static readonly dependencyproperty bounddocument = dependencyproperty.registerattached( "bounddocument", typeof(string), typeof(richtextboxassistant), new frameworkpropertymetadata( null, frameworkpropertymetadataoptions.bindstwowaybydefault,

xaml - WPF : How to create separate Resources for each item in a bound ItemsControl -

i want achieve following: my viewmodel exposes property named 'categories' collection of categoryviewmodel objects each categoryviewmodel object exposes property called 'items' collection of strings*. on view, want tabcontrol tabitem each object in 'categories' collection. the content of each tabitem should xceed datagrid control displaying contents of selected tab's items collection. <tabcontrol itemssource="{binding categories}"> <tabcontrol.itemtemplate> <datatemplate> <textblock text="{binding categoryname}" /> </datatemplate> </tabcontrol.itemtemplate> <tabcontrol.contenttemplate> <datatemplate> <xcdg:datagridcontrol itemssource="{binding items}" autocreatecolumns="true"> </xcdg:datagridcontrol> </datatemplate> <

iphone - How to render multiple solid cut planes? -

i'm rendering cut planes solid capped clipping using stencils in opengl. each cut plane works fine itself, want able create multiple cut planes @ same time. problem i'm running when cut object second cut plane, in view orientations there no faces use create stencil draw capping plane. know there must way work multiple stencil buffers want, can't think of right way this. figure involve saving stencil buffer each clipping plane situation, clipping stencil buffers using clipping planes. know should go this? not familiar capped solid clipping plane method i'm referring to, can found @ following links: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&number=269481

groovy - grape doesn't work in Eclipse -

groovy eclipse plugin version: 1.7.5.xx-20101020-1000-e36-release. import com.jidesoft.swing.jidesplitbutton @grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0)') public class testclassannotation { public static string testmethod () { return jidesplitbutton.class.name } } new testclassannotation().testmethod() the first line error: groovy:unable resolve class com.jidesoft.swing.jidesplitbutton it can run groovy shell, error warning bore when compile in editor, same error when compile or run command line: org.codehaus.groovy.control.multiplecompilationerrorsexception: startup failed: general error during conversion: error grabbing grapes -- [unresolved dependency: com.jidesoft#jide-oss;[2.2.1,2.3.0): not found] (and long stack trace) is seeing?

php - preg_replace - Replacing <br> with nothing in <pre> tags -

i have following: $newtext = preg_replace('@<pre>.*<br[/>]*?>?</pre>@si','',$text); and want replace <br>, <br />, or <br/> tags nothing when between <pre> tags, isn't working. what's wrong it? your problem you're trying use regular expressions parser's job. if working, you'll finding edge cases things break down road. see: regex match open tags except xhtml self-contained tags

Really Slow MySQL Insert Query -

i've got table half million records in it. it's not huge. couple varchar(255) fields, ints, float, , couple timestamps. there indices on ints foreign key constraints. inserts taking forever . i'm talking 1-4 seconds insert one row. i've had deal slow select queries plenty of times, i'm stuck trying figure out what's going on insert. edit: okay, asking ideas on how debug this, but, here's tables involved. inserting "ingredients" takes forever. throwing portion of schema onto web doesn't bite me later... create table `ingredients` ( `id` int(11) not null auto_increment, `quantity` float default null, `food` varchar(255) not null, `unit_id` int(11) default null, `ingredient_group_id` int(11) default null, `order_by` int(11) not null, `created_at` datetime not null, `updated_at` datetime not null, `description` varchar(255) default null, `range` float default null, primary key (`id`), key `unit_id` (`unit_id`), ke

activemerchant - What can I store locally while still being PCI Compliant using Braintree in Rails? -

what credit card information allowed store while still being pci compliant if relying on braintree payment processing? the reason asking because, simple optimization, if customer has bought store credit card, can show them last 4 digits of credit card, , card type, without having make api call braintree. i'd have make call if wanted change card or make purchase, 1 page, wouldn't. question is, allowed store: the last 4 digits of credit card and card type and possible cardholder name or there list of pci compliance "do's , don'ts" can check out? yeah, it's fine store things. check out pci quick reference guide brief overview of should , shouldn't do.

objective c - Cocoa UI Analytics -

i’d track user interaction inside of os x application. goal incredibly simple start: track how many times specific item clicked on i’m using sparkle enable application updates , able send additional information through delegate method. read: sending (client side) , storing (server side) data isn’t issue. my questions: how can cleanly attach “hook” system store event (like “clicked”) where store stats on local machine? (incrementing plist property?) does such system exist? really appreciate help. i’m rather new cocoa please ask if need further clarification on of above points. thanks again, dustin if set view first responder methods such -(void)mousedown:(nsevent *)theevent fired on required clicks. that's true, require subclass every single ui element pretty annoying after while depending upon how many ui elements require custom analytics tracking. said, can't think of way - thought mention caveat doing way.

winforms - Can I start a windows form from a console program -

i'd start new windows form console program. possible? add reference windows.forms, then: static void main(string[] args) { application.enablevisualstyles(); application.run(new form()); //of course can put own custom form here. }

iphone - Intermittent JSON parser failure for unescaped control character -

functionality in iphone app searches twitter text. code straightforward, pass url string twitter api, , parse result. although half time json parser fails errors unescaped control character '0x0'. code , full error message below. - (void)grabdata:(nsstring *)searchterm { nsstring *urlstring = [nsstring stringwithformat:@"http://search.twitter.com/search.json?q=%@&rpp=25",searchterm]; nsurl *url = [nsurl urlwithstring:urlstring]; nslog(@"created url:%@",url); //setup , start async download nsurlrequest *request = [[nsurlrequest alloc] initwithurl:url]; nsurlconnection *connection = [[nsurlconnection alloc] initwithrequest:request delegate:self]; [connection release]; [request release]; } - (void)connection:(nsurlconnection *)connection didreceivedata:(nsdata *)data { // store incoming data string nsstring *jsonstring = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencodi

HTML5 acronym tag replacement using jQuery -

using jquery, how replace every <acronym> tag <abbr> ? $('acronym').each(function() { var $this = $(this); $this.before('<abbr>' + $this.html() + '</abbr>'); $this.remove(); });

scala - OneToMany Relations with Lift -

i have question once again , have feeling solution simple. should simple, in case. have been trying model mappings database, nice onetomany trait, so class user extends megaprotouser[user] onetomany[long, user] { def getsingleton = user object posts extends mappedonetomany(post, post.author, orderby(post.edited, descending)) } class post extends longkeyedmapper[post] idpk onetomany[long, post] { def getsingleton = post object author extends longmappedmapper(this, user) object title extends mappedstring(this, 100) { override def dbindexed_? = true override def defaultvalue = "new post" } object contents extends mappedtext(this) object edited extends mappeddate(this) } all nice done, have one-to-many relationship right. but, troubles me real lot, how get data in relationship? supposing i've got post object , want author's name it? bind("post", in, "title" -> post.title, "author" -> /* insert

android - how can i make the View do NOT expand over its sibling View -

i have layout similiar this: <relativelayout ...> <edittext android:id="@+id/editbox" android:layout_width="wrap_content" .../> <button android:layout_right="@id/editbox" android:layout_width="wrap_content" android:text="button" /> </relativelayout> the button @ right of edit text. , edit text 'wrap_content'. when type texts edit view, view's width increase , expand button. want 2 views (button , edit text) have own area. how configure this? hi keyin lynx: use minwidth , maxwidth attribute,for instance: android:minwidth="10dip", android:maxwidth="60dip", attributes.

asp.net - Proper way to populate dropdownlist based off another value? -

i'm running minor issue asp.net code i'm working on. simplicity sake lets have 2 dropdownlists, 1 full of various items , full of other items, based off selected item of first dropdownlist. set variables hidden inputs check see if item in first dropdownlist has changed , if has change second dropdownlist, i'm having check make sure if else causes postback not repopulate second dropdownlist not lose selected user. check allows me make sure when navigate away page, correct values selected , not replaced postback repopulation. i'm new asp.net/html/css/javascript , like. know while have works, isn't close being correct way things. please me correct ways , figure out best way solve current problem. asp.net tutorial websites nice need keep improving skills it. try autopostback true selected index changed event: <asp:dropdownlist id="dropdownlist1" autopostback="true" onselectedindexchanged="dropdownlist1_selectedindexchanged&qu

c# - Fluent NHibernate and friend relationship -

i need model friend relationship fluent nhibernate. company model has list<company> related related companies. relations between companies modeled in database in table, related looks this: customer_id | related_id both columns foreign key pk in customers table. the problem relations saved once each pair (do call bi-directional?). i'm able change table structure if it's easier solve in way. i need map fluent nhibernate when customer.related() , generates query like: select * companies left join related on customer_id = id or related_id = id i've tried map in number of different ways, closest i've tried is: hasmanytomany(x => x.related) .inverse() .parentkeycolumn("customer_id") .childkeycolumn("related_id") .table("relations") .cascade.all(); however, (of course) maps when customer_id matches. how solve this? edit: think it's similar fluent nhibernate: how create on

iphone - Corelocation automatically drops pin when Current Location is found -

i making map view corelocation. problem i'm facing right whenever found location. pops current location. haven't tested bug thoroughly possible turn off? can add pin myself? thanks in advance if adding mapview via xib in map view properties panel uncheck the shows user location or if adding programmatically do [mapview setshowsuserlocation:no]; but have find location , add pin.

I need to create a small HMI/SCADA WPF application that uses WCF -

i have create simple app, suit example of using wpf , wcf creating hmi screens. i'm not sure wcf supposed in such application, guess there must opc server application connects to. app connect opc server using wcf service , wcf service reside inside application or outside? is wcf service meant used connection opc server? i'm not yet quite sure process simulate, need simple. please, ideas welcomed. thank you it sounds have wpf application act hmi, containing ui elements. wpf application create client proxy wcf service using address (the host address service running on), binding (probably tcp or http) , contract (an interface) of service. the wcf service hosted somewhere (the host address) , expose endpoint specifies binding , contract. wpf app's client proxy communicate with. methods implemented in service's contract instantiate opc classes , write or read opc items needed. in simplest form, have 1 solution 2 projects: 1 wpf application (with c

php - Duplicated Rows with UNIQUE INDEX MySQL and NULL Columns -

table sufix: id, name (3, 'com') table domainname: id, name (2, 'microsoft') table domain: id, name_code, sufix (1, 2, 3) -- microsoft.com table subdomainname: (4, 'windows') table subdomain: id, name_code, domain (7, 4, 1) -- windows.microsoft.com table email: id, name, atserver (3, 'myemail', 7) -- myemail@windows.microsoft.com (4, 'other', 1) -- other@microsoft.com here problem of foreign key constraints. how can resolve domains , subdomains create emails correctly? i'm having problems unique index null values, example, solution maybe: table email: id, name, subdomain, domain (3, 'myemail', 7, null) -- myemail@windows.microsoft.com (4, 'other', null, 1) -- other@microsoft.com but (5, 'newemail', null, null) -- duplicated values in table (6, 'newemail', null, null) (7, 'newemail', null, null) (8, 'newemail', null, null) and (**3**, &#

flex - how can we get the actual text width in pixel of Spark TextInput? -

as textwidth property no more accessible in spark textinput how can property ? in spark there's called textlinemetrics you can this var tm:textlinemetrics = label.measuretext( name ); var width:int = tm.width; here's example <?xml version="1.0" encoding="utf-8"?> <fx:script> <![cdata[ import mx.controls.alert; import mx.controls.text; protected function cmddoaction_clickhandler(event:mouseevent):void { var tm:textlinemetrics = cmddoaction.measuretext(cmddoaction.label); var _width:int = tm.width; alert.show(_width.tostring()); } ]]> </fx:script> <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> <s:button id="cmddoaction" label="kensodev" click="cmddoaction_clickhandler(event)"/> </s

api - Send SMS from jailbroken iPhone -

what best way programmatically send sms iphone? talking modem on /dev/tty.debug or using private api options. i want make command line sms utility, , want work on 3.x -> 4.x ios. also couldn't make work at+cmgf=1 & at+cmgs="[phone_num]"\r\n[msg]\x1a (talking tty.debug, iphone 3gs ios 4.1). you can have @ project seems achieve want: http://code.google.com/p/iphone-sms/

zend framework - How to limit the depth of Zend_Navigation? -

i creating categories sidebar using zend_navigation. in bootstrap putting in pages, products, categories , else can find in future. getting categories links out using $navigation->findallby('class', 'categories') returning array of categories. working , displaying should. now... how limit depth of sub-categories / pages? instead of (at moment) 6 levels of categories , sub-categories, have (for example) 2? $this->navigation()->menu()->setmaxdepth(2)

Sql Server Where Case Then Is Null Else Is Not Null -

i have procedure receive bit variable called @fl_finalizada . if null or false want restrict select show rows contain null dt_finalizacao values. otherwise want show rows containing not null dt_finalizacao values. something this: select * mytable ... , ( ope.dt_finalizacao = ( case when (@fl_finalizada <> 1) null end ) or ope.dt_finalizacao not null ) in case receive message: none of result expressions in case specification can null . how can achieve this? thanks in advance. select * mytable (isnull(@fl_finalizada, 0) = 0 , ope.dt_finalizacao null ) or (@fl_finalizada = 1 , ope.dt_finalizacao not null )

Objective-C creating a dynamic bidimensional array -

i'm trying create class can manage bidimensional array. used same algorithm in c without objects (obviously) , works fine. problem when try modify variable of object doesn't modify in main program, , absurd! nsmatrice.h #import <cocoa/cocoa.h> #import <foundation/foundation.h> struct ogmat { float value; int row, col; struct ogmat *next; }; typedef struct ogmat tmat; typedef tmat* tptmat; @interface nsmatrice : nsobject{ tptmat m; } - (void) crea; //inizializza la matrice - (int) destroy; //la distrugge - (bool) exisistsatxy :(int) x :(int) y; - (void) setvalueatxy :(float) value :(int) x :(int) y; - (float) getvalueatxy :(int) x :(int) y; @end nsmatrice.c #import "nsmatrice.h" @implementation nsmatrice - (void) crea{ //inizializza la matrice m=null; } - (int) destroy{ //la distrugge while (m!=null){ tptmat pa; pa=m->next; free(m); m=null;

asp classic - Edit an email before sending -

my application uses following function send email. function sendhtmlemail (strfrom, strto, strcc, strsubject, strbodyhtml) ' create newmail object set objnewmail = server.createobject("cdonts.newmail") ' set sender , recipients (latter can ';' separated lists) objnewmail.from = strfrom objnewmail.to = "abc@xyz.com" objnewmail.cc = "def@stu.com" ' set email subject objnewmail.subject = strsubject ' construct , set email's body strhtmlstart = "" & strsubject & "" strhtmlend = "" objnewmail.body = strhtmlstart & strbodyhtml & " to : " & strto & " cc :" & strcc & strhtmlend ' set parameters normal importance mime-encoded , html-formatted email objnewmail.importance = 1 '9-low, 1-normal, 2-high objnewmail.bodyformat = 0 '0-html, 1-text objnewmail.mailformat = 0 '0-mime, 1-text ' send em

regex - Expect script that enters a username and password repeatedly -

i have script needs switch between various branches in subversion repository in order copy. results in having enter password repeatedly. now, once have done couple of time , script. mess causing me great anger. i have used expect enter password on prompt before. hoping learn how expect run on multiple password prompts again , again , again, until task finished. so far have. #!/usr/bin/expect global env set timeout 10 spawn command requires password expect "^user" send "password\r" #i need repeat on , on until prompt stops showing up. please , thank you. naive, brute force method: while 1 { expect $prompt send $password\r } better: expect { $prompt { send $password\r exp_continue } timeout { puts "haven't seen prompt $timeout seconds" } "some pattern indicates password no longer required" } puts "continuing ..."

javascript - jquery co-ordinate problems on an image with in a absolute positioned div -

i have problem recording x , y co-ordinates using jquery/javascript, on image in 'position: absolute div' container. basically supposed happen somewhere in image clicked, , div containing information placed on co-ordinates. however when image's div container has position absolute, x , y co-ordinates off, needs there overlay image on divs, unless can think of better way? below code, appreciated <style> #image_container {position: absolute} #test_img {} .image_dot { height: 5px; width: 5px; background-color: red; position: absolute; } </style> <div id="image_container"> <img src="mrt.jpg" id="test_img" /> </div> <script type="text/javascript"> $("#test_img").click(function(event) { var x = event.pagex - this.offsetleft; var y = event.pagey - this.offsettop; $("#image_container").append('<div class="image_dot&qu