Posts

Showing posts from May, 2011

Emacs + GDB + SCons + Step through Debugging -

when compiling project via makefile using emacs compile command, when gdb run on resultant binary application can stepped through. however, when building using large project scons, attempting step through not work in emacs doesn't seem know files load or how they're related binary. what 1 have do step through in emacs? if emacs can't support scons natively how can done manually; make must using mechanism alert emacs file's presence. are sure make , scons compile options same? sounds scons build lacking debug symbols (in gcc, use -g option).

dynamic linking - dynamically link one lib to another lib at build time, yet link statically into iphone app -

i've got lib, a, can linked iphone app itself. i'd make 2 other libs, b , c, depend on a. an app may want built linking libs statically in of these combinations: a, a+b, a+c, or a+b+c. however, when building b or c, i'd them link dependent lib dynamically, e.g. b depends on not copy statically. possible? note: i'm not asking if libs can dynamically link apps. i'm trying find out if libs can dynamically linked @ compile time, such lib not contain copy of dependent lib inside of itself. @ when building app, user can statically link of above allowable combinations above. iphone apps not support dynamic linking of third-party libraries.

winforms - Interprocess communication using sockets between windows service and form app -

i need send command windows service windows form. have tried executecommand of servicecontroller had hard time testing. i planning use sockets ipc can receive feedback. if 1 find similar example great. thanks. if don't mind third-party solution, our msgconnect ( http://www.eldos.com/msgconnect/ ) designed purpose , has sample. msgconnect can use mmf or sockets transport.

c# - Deepclone issue with child object need deep serializing -

i've got issue when implementing deepclone serialization/deserialization way. fact: want class owndataset have deepclone instance, 2 below common procedures - constructor , getobjectdata declared: protected owndataset(serializationinfo info, streamingcontext context) : base(info, context) { dstype = datasettype.standard; attributes = new ownattributelist( (list<ownattribute>) info.getvalue("attributes", typeof (list<ownattribute>))); islinkedds = info.getboolean("islinkedds"); pcaforscores = (pca)info.getvalue("pcaforscores", typeof(pca)); levels = (string[])info.getvalue("levels", typeof(string[])); } [securitypermission(securityaction.demand, serializationformatter = true)] public override void getobjectdata(serializationinfo info, streamingcontext context) { base.getobjectdata(info, context); info.addvalue

cocoa touch - App to display safari cookies on iphone -

i want make app in iphone such displays history of safari browser in iphone. means want access safari cookies through other app. first time m placing query on overflow...... can please let me know this... please reply i don't know whether work or not can try using nshttpcookie , nshttpcookiestorage classes... code similar nshttpcookiestorage *cookiestorage = [nshttpcookiestorage sharedhttpcookiestorage]; nsurl *url; nsarray *cookies; nsstring *cookiestring = @""; cookies = [cookiestorage cookies]; if([cookies count] > 0) { nshttpcookie *cookie =[cookies objectatindex:0]; cookiestring = [nsstring stringwithformat: @"%@=%@", [cookie name], [cookie value]]; nslog(cookiestring); }

asp.net - Request.Form in Inline Data-Binding Code -

i've got asp:repeater on page holds < input type="radio" elements. appreciate asp:radiobuttonlist control used this, problem after radio buttons require textbox enabled using javascript when associated radio button in repeater clicked (while other textboxes in repeater disabled), hence decision use native html elements. problem validation; if text box blank when posting want display warning , force user enter text, leaving radio button selected checked. request.form collection doesn't appear populated when accessing between <%# ... %> placeholders, , therefore unabled detect selected radio button write "checked" attribute to. any suggestions on how read request.form collection in order check appropriate radio button input element? edit - requested, below html markup used in repeater: <asp:repeater id="choicerepeater" runat="server"> <itemtemplate> <input type="radio" name

javascript - Background Page in popup- chrome extension -

i embedding dynamic webpage in popup. working , every time popup loaded webpage loaded again, me losing work did on webpage in popup. though fine, want webpage remain loaded in background , show in popup on click. copied complete code pop page(script+html) background.html. how should access page in popup , show directly(i want show html also-from background page) thanks popups live in same process (the extension process) background page, , 1 page can dom window of other. popup gets background page calling chrome.extension.getbackgroundpage() . every time open popup, read , write variable on background page, example chrome.extension.getbackgroundpage().entereddata = "value"; . alternately, can use html5 localstorage store variables after browser shut down; e.g. localstorage['entereddata'] = "value" .

jquery ui - How to change the color of jqGrid cell? -

Image
i use following line @ $(document).ready( $("#stsearchtermsgrid").setcell(2, 2, '', {color:'red'}) ; but doesn't work. did write in wrong way or placed in wrong place. i know question has been asked more once before , how got first line. still not able , not knowing problem is. you right not first person ask question. clear situation cell color made the demo for change text color of cell or background color of sell in different ways: loadcomplete: function() { // 2 zero-base index of column 'name' ('client'). every options // multiselect:true, rownumbers:true , subgrid:true increase // index 1 because option inserts additional columns $("#6 td:eq(2)", grid[0]).css({color:'red'}); grid.jqgrid('setcell',"12","name","",{color:'red'}); grid.jqgrid('setcell',"10",'name', '', 'my-highlight');

spring mvc - How to post data and redirect to another page using GWT? -

when press button post data server , there redirect page. used requestbuilder waiting response, , of course it. , nothing happens, same page stays. see requestbuidler shouldn't used here... should use post data , able redirect? in spring @requestmapping(method=requestmethod.post, value="/ddd") public modelandview processorder(@requestbody string orderinstring, httpsession session) throws exception{ ... return new modelandview(new redirectview("abc")); } in gwt public void postdata(final string data, final string url) { requestbuilder builder = new requestbuilder(requestbuilder.post, url); try { builder.sendrequest(data, new requestcallback() { public void onerror(request request, throwable exception) { ... } public void onresponsereceived(request request, response response) { if (200 == response.getstatuscode()) { ..

javascript - saving content from textarea in php -

i have textarea in php page , and want save on click of save button. have insert queries in php page. how shall save content without page refresh. immediate thought ajax. safe transfer content through javascript or should use session variables carry whole text content me in it. you can use ajax. make sure use post request text may long sent get (that is, appended url in query string). sessions not valid option. sessions files exist on server. in order put contents of textarea session, first have server, it's not solution problem of getting text server.

how to link two acitivities in android project -

i new android want code splashscreen. used intent getting error instrumention source not found. have 2 files splashscreen.java , myapps.java have use threading concept , called anothe activity finally { finish(); startactivity(new intent("com.example.myapps")); stop(); } @ startacitivy getting axception please guide me have modify androidmanifest file? if yes please provide me syntax that.... thanks in advance. if you're starting new activity intent, prefer using like: intent intent = new intent(myclass.this, myapps.class); startactivity(intent); and have proper entry on manifest myapps class like: <application> ....... ..... <activity android:name="com.example.myapps" /> ........ </application>

java - Security of HTTP tunnelling with RMI -

i concerned data being sent our remote database java based client software not being sent securely using http tunneling rmi rather https. the problem need prove vunerability boss before takes company. how can send , receive data rmi cgi serverlet test theory? i have used wireshark see packets , can see url data posted have no idea of easy way replicate rmi protocol (without writing whole java app). i believe can create special method simple signature string foo(string); now try call method mechanism , user wireshark catch packets. think if data not encrypted able see parameter , return value in clear text.

wordpress - posts by category -

in wordpress how display posts category in sidebar? try plugin listing category posts widget sidebar. category posts widget [or] <?php query_posts('category_name=your-category-name&showposts=5&order=asc'); ?> <?php while (have_posts()) : the_post(); ?> <h2 class="head1"><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile;?>

get background color of particular text in PDF file -

how can find out particular text's background color (rgb) of pdf file? no such thing. the "background color" whatever drawn behind particular piece of text, if anything. , text doesn't have text. image or paths. the thing might work render pdf pixels (perhaps using ghostscript), , sample pixel colors around text (as determined itext). can determine fill color @ time text painted, know ignore. the problem comes when places text on isn't solid color. doable, painful.

using antlr from java to obtain meta data about Java classes -

i have downloaded antlr 3.3 , antlr works, along java.g antlr site. able generate javaparser, javalexer.java , tokens using antlr works java.g. mounted antlr jar in ide , following following instructions use in code: http://www.antlr.org/wiki/pages/viewpage.action?pageid=789 the first problem arose when documentation above says code following line: rulereturnscope result = parser.compilationunit(); the problem parser.compilationunit() not return result. then tried following example further down under "parsing tree", incomplete. i can't find documentation on how use library. here want do: -in java submit file name, file object or file contents string antlr , have return sort of object can navigate in code give me things imports, methods, class variables, expressions etc. basically netbeans ide 6.9.1 refactoring, fix imports, go source, rename variables etc. need meta data class, , not sure how obtain it. thanks. to answer question why compil

Openfire Kraken Plugin Facebook Transport not working -

i have configured openfire 3.6.4 kraken plugin accessing gtalk, yahoo, facebook , msn buddies. working fine except facebook. i tried every versions of kraken plugins available. in cases, facebook transport showing means user gets login in facebook not getting buddy list. in other case, transport doesn't registered means user don't logged in. (credential not valid error) i checked kraken developer forum, didn't exact solution. how can overcome issue? download latest source of kraken repository. , build it. work you. for reference: http://kraken.blathersource.org/node/9

css - Style is not applying to FF but on chrome -

this weird, whenever open on firefox style isn't applying. looks fine in css , link it. here's test page: http://loreto.byethost13.com/testing/ anyone has idea problem? in css, before commented reset code, have this: a{text-decoration:none; color:#333;"} removing quotation mark should fix problem.

Modify VB.net SQL search to use pattern -

the code below works great, , need more :). vb.net 2008 access database. @ moment matches based on paramvalue, , needs exact match. how can change pattern instead?? example want contains text "fizz" , "bom". --and please share link can learn blend of sql+access+vb.net. thank you! steve dim table new datatable(tablename) table.locale = system.globalization.cultureinfo.invariantculture using connection new odbcconnection(connectionstring) connection.open() dim query string = string.format("select * [{0}] [{1}] = ?", _ tablename, _ paramname) dim selectcommand new odbccommand(query, connection) selectcommand.parameters.add(new odbcparameter("@" & paramname, paramvalue)) dim adapter new odbcdataadapter(selectcommand) adapter.fillschema(table, schematype.mapped) adapter.fill(table) end using return table reference lin

jquery - How to run these functions one after the other? -

how can have these functions run 1 after other, each 1 finished before next starts? $(window).unbind(); $('.buyersseclink').removeclass('buyersseclinkon'); $(this).parent().delay(900).addclass('buyersseclinkon'); $(window).bind('scroll', function () { $('.buyersseclink').removeclass('buyersseclinkon'); }); thanks delay() not work methods such addcless . jquery documentation suggests should use settimeout instead: $(window).unbind(); $('.buyersseclink').removeclass('buyersseclinkon'); var current = this; // store reference, because in settimeout callback "this" maybe referring else window.settimeout(function() { $(current ).parent().addclass('buyersseclinkon'); $(window).bind('scroll', function () { $('.buyersseclink').removeclass('buyersseclinkon'); }); }, 900);

compass with eclipselink -

i trying setup compass eclipselink. throws me following exception exception [eclipselink-28014] (eclipse persistence services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.entitymanagersetupexception exception description: exception thrown while processing property [eclipselink.session.customizer] value [org.compass.gps.device.jpa.embedded.eclipselink.compasssessioncustomizer]. internal exception: org.compass.core.compassexception: failed find persistence unit info @ org.eclipse.persistence.exceptions.entitymanagersetupexception.failedwhileprocessingproperty(entitymanagersetupexception.java:178) my persistence.xml follows: <property name="eclipselink.session.customizer" value="org.compass.gps.device.jpa.embedded.eclipselink.compasssessioncustomizer"/> <property name="compass.engine.connection" value="target/test-index"/> <property name="compass.debug"

joomla1.5 - How to include iframe coding in joomla -

how include iframe coding in joomla joomla has tinymce default editor. don't allow iframe tag. you can enable iframe tag in editor. go > extensions > plugins > tinymce paste iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder] in extended valid elements now go editor, open html view , paste iframe code. save it.

apache pig - How to read data from data bag within a PIG script -

i have databag following format {([channelname#{ (bigxml,[])} ])} databag consists of 1 item tuple. tuple consists of item map. map of type map between channel names , values. here value of type databag, consists of 1 tuple. the tuple consists of 2 items 1 charrarray (very big string) , other map i have udf emits above bag. now need invoke udf passing tuple within databag against given channel map. assuming there not data bag , tuple ([channelname#{ (bigxml,[])} ]) can access data using $0.$0#'stdoutchannel' tuple inside bag {([channelname#{ (bigxml,[])} ])} if $0.$0.$0#'stdoutchannel' (prepend $0), following error error 1052: cannot cast bag schema bag({bytearray}) map how can access data within data bag? try break problem down little. let's inner bag: mybag = $0.$0#'stdoutchannel'; first, can illustrate or dump this? what can bag? foreach on tuples inside. a = foreach mybag { generate $0 mychararr

networking - Designing a WLan Receiver -

i plan model complete wlan receiver ieee 802.11 b/g/n phy layer detecting fields in packet. this experiment academic purpose only. seeking guidance, how can build such model. any ideas / pointers designing such receiver highly helpful studies. looking forward hear interesting ideas. thanks kiran with new 802.11 framework in linux can put interface monitor mode, , capture frames libpcap. no need special hacks. don't need programming skills experimentation: put wlan0 monitor mode, , start sniffing around tcpdump.

asp.net - How to pass value to javascript from code behind page? -

i have web application want call 1 method on body onload method. i have method <body id="pageid1" onload="setupfeaturedproperty(1,['http://www.brightlogic-estateagents.co.uk/mrus/upload/918-1.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/918-2.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/918-3.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/918-4.jpg']);setupfeaturedproperty(2,['http://www.brightlogic-estateagents.co.uk/mrus/upload/665-1.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/665-2.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/665-3.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/665-4.jpg']);setupfeaturedproperty(3,['http://www.brightlogic-estateagents.co.uk/mrus/upload/38-1.jpg', 'http://www.brightlogic-estateagents.co.uk/mrus/upload/38-2.jpg', 'http://www.brightlogic-estateagents.co

automation - Count the number of pages in a site -

i'd know how many public pages there in site, example, smashingmagzine.com. there way count number of pages? you can query google's index using site operator. e.g: site:domain-to-query.com this return list of pages site indexed google. other search engines provide similar functionality don't know syntax off hand. of course not pages may indexed, , index may contain pages no longer exist.

Ubuntu/Linux or Node.js based method of sending emails -

i have internal network smtp server need go through send emails. i've gotten work nodemailer appears fail after greeting, "error" message below. it's responding 250, i'm not sure why it's not sending, wondering if knows of linux/ubuntu based library can use accomplish task via cli. server responded 250-hostname hello [ip] 250-turn 250-size 250-etrn 250-pipelining 250-dsn 250-enhancedstatuscodes 250-8bitmime 250-binarymime 250-chunking 250-vrfy 250-x-exps gssapi ntlm login 250-x-exps=login 250-auth gssapi ntlm login 250-auth=login 250-x-link2state 250-xexch50 250 ok um, that's not error. 250 status code means ok. have listed server's response ehlo command. each line start 250 lists extended smtp feature server supports. next step? if authorization required, send auth command. if not, start mail transaction using mail , from , , data . i think before proceeding should take time read on basics of smtp. make more sense you.

Mercurial repository not pushing to web server -

i have apache running mercurial 1.7.5 (all on windows 2003 64bit) , can clone, push , pull server repos. problem when clone 1 of projects , make change of moving files /mainfolder/subfolders1/subfolders2 1 folder subfolders1 mainfolder. commits fine local repo , can cloned locally when push server error (after long wait) pushing http://xxxx:81/hg/hgweb.cgi/repox searching changes http error 504: gateway time-out i have tried doing recover didn't seem fix issue. .hg sort of large compared others on system because of oracle drivers (51.8mbs total .hg folder) have googled issue as can , cant seem find running own server having similar issues i can clarify more if needed... in advance help apache 2.2 log: 16.43.60 - - [09/feb/2011:09:09:15 -0500] "get /hg/hgweb.cgi/stringutility?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between http/1.1" 200 1 10.16.43.60 - - [09/feb/2011:09:09:15 -0500] "get /

Asp.net Telerik Ajax -

hi trying master page web project. have following code masterpage. <%@ master language="c#" autoeventwireup="true" codebehind="craigavonaquaitcs.master.cs" inherits="craigavon_aquatics.craigavonaquaitcs" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"> <link href="style1.css" rel="stylesheet" type="text/css" /> <asp:contentplaceholder id="head" runat="server"> <title>craigavon aquatics</title> <telerik:radstylesheetmanager id="radstylesheetmanager1" runat="server" /> </asp:contentplaceholder> </head> <body> <form id="form1" runat="server"> <

php - Problem selecting multiple checkboxes -

i using checkbox has name "selectedids[]" , trying select checkboxes javascript. code not working. when change name of checkbox "selectedids" works, can't because need ids selected on posted page. the checkbox follows: foreach($rows $row) { <input type="checkbox" name="selectedids[]" value="<?php echo $row['id']; ?>" class="checkbox" /> ........ ........ } and java-script function follows: function setallcheckboxes(checkvalue) { var checkvalue=true; if(!document.forms['main']) return; var objcheckboxes = document.forms['main'].elements['selectedids[]']; if(!objcheckboxes) return; var countcheckboxes = objcheckboxes.length; if(!countcheckboxes) objcheckboxes.checked = checkvalue; else // set check value check boxes for(var = 0; < countcheckboxes; i++) objcheckboxes[i].checked = checkvalu

android - progress bar in appwidget for a playback service -

i wanted display progress bar in appwidget displays playback progress background service. know appwidget supports control, wondering how might go updating progress bar in way consistent widget design (e.g. low battery consumption). way in activity polling playback on timer. haven't implemented yet, not sure if work in appwidget. know better me? have service update app widget's remoteviews when sufficient time has elapsed make worthwhile update.

biztalk - Determining the actual file name sent when using Send Port Macros -

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

Aborting chains of Ajax calls in Javascript -

sometimes when user triggers same event more once, same ajax call made multiple times. pretty straight forward setup simple object keep track of identical calls , abort oldest ones, how can deal when there chains of calls made? what mean chains: lets user clicks button , triggers ajax_a(...). @ later point ajax_b(...) executed. @ point user clicks same button again invokes same chain again. is there practical way of aborting whole chain (both ajax_a(...) , ajax_b(...))? our current solution quite obtrusive sections make ajax call part of chain. you might want have @ new jquery 1.5 deferreds: http://www.erichynds.com/jquery/using-deferreds-in-jquery/

c# - In a GridView, how to add multiple commands to one item template? -

i stripped example make simple. have gridview template field. template field contains 2 buttons , label (they must in same template field). want first button set label text "win", , other button set label text "fail". onrowcommand doesnt seem triggered buttons in template field. how can accomplish this? my gridview code below: <asp:gridview id="gridview1" runat="server" enablemodelvalidation="true" autogeneratecolumns="false" onrowcommand="gridview1_rowcommand"> <columns> <asp:templatefield showheader="false"> <itemtemplate> <asp:button id="btnwin" runat="server" commandname="win" text="win" /> <asp:button id="btnfail" runat="server" commandname="fail" text="fail" /> <asp:

objective c - Size a UIToolbar to fit its items? -

i'm trying figure out clean way make uitoolbar wide needs to fit items contains. there way either: configure uitoolbar adjust width automatically items changed? programatically determine minimum width required items, can used set uitoolbar 's frame? i haven't been able figure out due spacing between items , fact uibarbuttonitem s not uiview subclasses. after trying suggestions other answers did not work unless used custom views, or unless loaded, arrived @ way set toolbar width based on items: //add bar items toolbar first. uiview* v = toolbar.subviews.lastobject; float newwidth = v.frame.origin.x + v.frame.size.width; //set toolbar width you'll need override uitoolbar -setitems: or otherwise detect changed buttons autoresize. i have included feature in refactoring library, es_ios_utils , set navigation item's right item multiple buttons. in preceding link, see uitoolbar +toolbarwithitems: , uinavigationitem -setrightbarbuttonitems

IIS 7.5 error hander redirects to 404.html before ASP.Net exception handler -

a issue on production web server: if set customerror true in web.config, production web server redirects 404 error default %systemdrive%\inetpub\custerr\\404.htm, ignored asp.net excption handler generated use friendly error message. it's not happening on our test server sets site vitual directionary. iis configuration hijacked handler? both running on same code bases. p.s. if switched customererror false. both servers gave asp.net detailed error/exception details.

visual c++ - Problems with CMAKE vars -

i'm using cmake generate vs2008 sln/vcproj files few simple things don't appear work: 1)this works: include_directories ($env{mcs_ogre_home}/ogremain/include) but doesn't, vc++ additional include dirs gets totally screwed when this, brackets , kinds floating around: set (ogre_path $env{ogre_home}/ogremain) include_directories (${ogre_path}/include) 2)this works: target_link_libraries( debug $env{ogre_home}/lib/ogremainstatic_d.lib ) but doesn't, library path isn't shown under library paths in vc++: link_directories($env{ogre_home}/lib/) target_link_libraries( debug ogremainstatic_d.lib ) i figure must simple? rather than: set(ogre_path $env{ogre_home}/ogremain) use: string(replace "\\" "/" ogre_path "$env{ogre_home}/ogremain") cmake uses "/" path separators on platforms. also, it's recommended use full path names (with "/" separators) library arguments target_link_librarie

debugging - How do I examine the color properties of a control in the Visual Studio Immediate Window? -

Image
i set breakpoint in visual studio 2008 smart device project examine state of control properties. specifically, want know background , foreground colors are. however, when query these properties, shows me long list of system colors this: why showing me crap? how show me backcolor?

documentation - Free "Business Rules" tools? -

i have been tasked capturing business rules in legacy program company uses lot. as start, fired excel , started typing. took short time realize better if there customized tool enter information into. this new task me, don't know if hoping software either non-existent or expensive. figured can't hurt ask if out there knows of nice free tool enter business rules into. depending on how complex business rules flow charting app visio. if rules numerous , complex diagram might large or have span several pages readily consumable persons other (page object links work case.) i have produced charts these have spanned 20 printed pages (4x5) many dozens of objects , decision points. end result, though large, useful because non-tech, biz-types can follow along, make decisions , programming biz logic chart becomes trivial.

javascript - How to put all elements' content in array using jQuery ? -

<div id="main"> <p>text1</p> <p>text2</p> <p>text3</p> </di> result should : ["text1","text2","text3"] jquery provides .map() this: var items = $('#main p').map(function () { return $(this).text(); }).get(); .map() iterates on elements, invoking function on each of them , recording return value of function in new array, returns. you have solved simple .each() : var items = []; $('#main p').each(function (i, e) { items.push($(e).text()); });

Django-like URL Routing for PHP -

i looking way provide url routing similar 1 in django. looked @ lot of resources online & liked cobweb problem dont want use entire framework want use url rerouting logic/code. there resource django-like url routing logic? what looking microframework. it's routing layer of framework. there several of these available. these looked interesting me: limonade glue slim breeze the 1 blew mind though silex , based on symfony2 , requires php 5.3.

python - converting a List<String> property to individual values in a CSV export from GAE -

i have list of string inside class in app engine project, , in database export csv (through bulkloader.yaml) resulting field proper list. problem csv imported again mysql database , such field remains single list of strings. any idea how tweak .yaml config_file generate tuple every string? you can't make bulkloader export multiple rows single entity using yaml configuration. you'll either need write custom exporter, or custom converter - see bulkloader source details (in docstrings).

asp.net mvc - Multiple Html.AntiForgeryToken (inside an HTML table) -

in view have loop render list of users: foreach (var user in model.users.collection) {} one of columns of table input button, perform action specific user. input button post request action method. i'd protect html.antiforgerytoken . however, each table row has html.beginform input button. <td> <% using(html.beginform(user.isinrole ? "removeuserfromrole" : "addusertorole", "usermanagement", formmethod.post)) { %> <%: html.antiforgerytoken("addremoveuser") %> <input name="action" type="submit" value="update" /> <% } %> </td> how should proceed this? render multiple html.antiforgerytoken 1 each html.beginform? correct this? thanks you use same salt value tokens. <%: html.antiforgerytoken("some_random_string") %> and try apply same salt on 2 controller ac

objective c - Changing iphone code on the fly -

i have no idea event start searching type of thing, decided ask experts =) i'm trying design app parses html websites , interprets it, know, websites not permanent , change in format render app useless (or @ least until apple approves version 1.x weeks later). the way solve problem in windows create dll parses data, , update file when goes awry (very quick fix). similar solution possible on iphone? , importantly, can guys think of better solution? can't server side because of login complications, etc. thank you! you can download , execute javascript inside uiwebview. that's mechanism apple allows downloaded code of kind, , it's explicitly allowed in sdk agreement. added: , can feed javascript functions (in hidden web view) text , regex expressions text modifications way.

flash - Replace String with Movieclip -

in application have string this.. var str:string = "the item [mc]"; here need replace [mc] movieclip object. possible? but not use tlf text,because increases file size. i assume want string appear in textfield? can use <img> tag place symbol instance library.

WCF Service using ASP.NET Forms Authentication -

i invoking wcf web service (.net 4.0) via jquery $.ajax() asp.net page. how can secure wcf service such authenticated asp.net users can invoke service's methods? need imperatively check forms authentication cookie manually in each service method, or there more declarative approach? solution : move .svc files under "services" directory (or directory hold services secured) , secure directory own web.config. configure location deny anonymous users: <?xml version="1.0"?> <configuration> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </configuration>

jsf 2 - Jsf custom selectItems -

look following code <h:selectmanycheckbox layout="pagedirection" styleclass="pressreviewtable"> <f:selectitems value="#{theme.articles}" var="prart" itemlabel="#{prart.prlabel}" itemvalue="#{prart.id}" itemlabelescaped="false"/> </h:selectmanycheckbox> i try put html on on itemlabel <b> have following error: the value of attribute "itemlabel" associated element type "f:selectitems" must not contain '<' character. i find trick put directly in #{prart.prlabel} html i'm not satisfied that. use mojarra , primefaces. i want : <f:selectitems value="#{theme.articles}" var="prart" itemlabel="<b>#{prart.value1}</b> : <font>#{prart.value2}</font>" itemvalue="#{prart.id}" itemlabelescaped="false"/> what's other way? if there... thanks since each

css float - CSS Div positioning problem in IE -

i have jq slideshow in div on page: http://www.lucky-seed.com/web.html and have css sheet ie following style: .slideshow { height: 599px; width: 700px; max-width: 700px margin-top: 00px; margin-left: 295px; float:left; position: relative; display: inline;} where going wrong? looks great in ie, once in ie, can't seem move position around no matter do. thanks in advance insights. hello fellow pittsburgher :p you've got many different, conflicting styles going on there. while it's not specific answer, might suggest using css framework blueprint ( http://www.blueprintcss.org/ ) better manage columns greater simplicity , let worry ie compatibility. rolling columns unnecessary these days.

removeEventListener on anonymous functions in JavaScript -

i have object has methods in it. these methods put object inside anonymous function. looks this: var t = {}; window.document.addeventlistener("keydown", function(e) { t.scroll = function(x, y) { window.scrollby(x, y); }; t.scrollto = function(x, y) { window.scrollto(x, y); }; }); (there lot more code, enough show problem) now want stop event listener in cases. therefore trying removeeventlistener can't figure out how this. have read in other questions not possible call removeeventlistener on anonymous functions, case in situation? i have method in t created inside anonymous function , therefore thought possible. looks this: t.disable = function() { window.document.removeeventlistener("keydown", this, false); } why can't this? is there other (good) way this? bonus info; has work in safari, hence missing ie support. i believe point of anonymous function, lacks name or way reference it. if cre

flex - How to set a public var in a popup window? -

i trying set variable in titlewindow pupup , use in script section. variable not being set , don't know why. here main.mxml file: <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600" creationcomplete="application1_creationcompletehandler(event)"> <fx:script> <![cdata[ import mx.events.flexevent; import mx.managers.popupmanager; protected function application1_creationcompletehandler(event:flexevent):void { var test:testwindow = testwindow(popupmanager.createpopup(this,testwindow,true)); popupmanager.centerpopup(test); test.testtext = 'test 2'; test.bol = true; } ]]> </fx:script> <

php - pass a post value from view to controller to model, and back to controller in code igniter -

i'm creating login form codeigniter, , have controller collects inputs form, want check make sure user entered in database, i'm collecting values in post , want send them model database connection. if results in database want send controller yes or no , can go there. i'm kind of stuck, have far: the controller: function do_login() { $login = $this->input->post('login'); $pwd = md5($this->input->post('passwd')); } the model: function check_login() { $sql = $this->db->query("select * members loin = '?' , password = '?'", array(//post stuff goes in here)); return $sql->result(); } i'm not sure how pass data model, , controller. any great! thanks! in mvc form post sending controller (in action property in form) , controller (as name decribed) controls happend, in case should ask database verification via model, response, decide do, , use view display results... so i

iphone - UIButton grid activate same time dragging -

i have grid of various uibuttons (5 x 5)... have uicontroleventtouchupinside.. means when user wants choose various buttons need press each, 1 one... how can activate buttons when user dragging finger on various buttons. here code use: for (i = 0; < num_caselles; i++) { lletra = [[uibutton alloc] initwithframe:cgrectmake(pos_h, pos_v, mida_boto, mida_boto)]; [botones addobject: lletra]; [lletra settitle: [caselles objectatindex: i] forstate: uicontrolstatenormal]; lletra.tag = i; [lletra addtarget:self action:@selector(lletrapitjada:) forcontrolevents: uicontroleventtouchupinside]; } you can react to: uicontroleventtouchdragenter or uicontroleventtouchdragexit to handle these cases.

aop - Intercept interface methods in Ninject Interception Extension -

i'm playing around ninject interception extension. ian davis's blog post indicates interception based on actual service type, rather interface. example, following code have no effect because ifoo interface: kernel.interceptbefore<ifoo>(f => f.dosomething(), => console.writeline("before")); and of course, next code piece work if foo.dosomething virtual : kernel.interceptbefore<foo>(f => f.dosomething(), => console.writeline("before")); this seems pretty glaring hole when comes aspect-oriented programming. i've been pretty conscientious programming interfaces use mocking frameworks mock our various services, vast majority of actual method implementations not virtual. if mocking framework can produce ifoo method ask for, seems ninject ought able to. so guess question two-fold: is there reason ninject interception doesn't allow bind interface methods? is there easy way make ninject bind dynamic &qu

vba - 1004 Runtime Error on adding Excel chart -

consider code: subroutine(byref objexcelapp object) dim objchart excel.chart<br> dim objchartadd excel.chart set objchart = charts.add 'plotting graph in excel 'after completion set objchart = nothing end sub when run code, runs fine, , without closing application if rerun report type - prompts error 1004 @ set objchart = charts.add any help, can provide appreciated. can add chart in ui? bet you're in situation chart cannot added (multiple sheets selected; workbook not activated; protected range active; etc). chris

css - Partially Bold Text in an HTML select -

i'm not sure if possible, have case i'd bold part (not all) of text within option of html select tag. i tried using b tags, strong tags, no luck (on chrome). css might work, since works @ element level, i'm not sure how go way. is there way this? no; it's not possible. instead, can make fake dropdown list using javascript.

Receiving "wrong name" NoClassDefFoundError when executing a Java program from the command-line -

i have problem while trying executing java application. whenever try execute program through command java progaudioj i error: exception in thread "main" java.lang.noclassdeffounderror: progaudioj (wrong name: es_2011/progaudioj) @ java.lang.classloader.defineclass1(nativemethod) @ java.lang.classloader.defineclasscond(classloader.java:632) @ java.lang.classloader.defineclass(classloader.java:616) @ java.security.secureclassloader.defineclass(secureclassloader.java:141) @ java.net.urlclassloader.defineclass(urlclassloader.java:283) @ java.net.urlclassloader.access$000(urlclassloader.java:58) @ java.net.urlclassloader$1.run(urlclassloader.java:197) @ java.security.accesscontroller.doprivileged(nativemethod) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:307) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:3

Facebook C# SDK FacebookApp not recognized -

i using facebook c# sdk 5.0.1 beta , trying use following sample code posted on codeplex: // using dynamic (.net 4.0 only) var app = new facebookapp(); dynamic me = app.get("me"); string firstname = me.first_name; string lastname = me.last_name; string email = me.email; but cannot vs recognize facebookapp(). downloaded sdk today (feb. 9th 2011) , made sure unblock or unlock dlls. running code off of c drive , running vs2010 admin. using vs 2010 4.0 framework (not client). if dont use above code snippet project builds , runs cannot fb login button display (that 2nd issue). weird if copy url (http://localhost:5000/account/login.aspx) firefox login button displays , can log facebook , (i think) authorized. oh, believe have app setup correctly in facebook , copied appid , appsecrect config file. , using ie 8. suggestions? thanks. try download again. current version 5.0.3. also, documentation in need of updates. have renamed class facebookapp facebookclient

c++ - Loading a Bullet Physics mesh from a file -

i'm trying set city environment ogre , bullet, i'm having trouble figuring out how load meshes bullet. google shows references collada importer, seems have been removed svn. the ogre mesh best thing import, have .dae , .blend files , use if possible. i had same requirement when using bullet irrlicht. found no solution apart writing physics loading code myself. used object naming convention in 3d editor, , when loading model, iterated through sub-objects , constructed suitable btrigidbody each tagged object. e.g. if (needsbody) { if (prefix == "ball") { body = createspherebody(mesh, density); } else if (... similarly joints: if (parent && parent->body) { // add constraint ... if (prefix == "ball") { // ball/socket joint constraint = new btgeneric6do

How to view/edit extended properties of SQL Table in SharePoint 2010 -

possible duplicate: edit sql extended properties in sharepoint 2010 hi everyone, i know how view/edit table data external sql (non sharepoint) database sharepoint 2010 web front end. however, want view/edit extended properties (metadata) well. how can this? thanks! you don't make clear if wanting access sharepoint database (not supported nlv say) or a.n.other database via sharepoint. i assuming latter. there lots of table viewer/editor web parts don't know of let work metadata you're going have develop own - this guide , this one viewer should give head start.

How to accommodate spaces in a variable in a bash shell script? -

hopefully should simple one... here test.sh file: #!/bin/bash patch_file="/home/my dir/vtk.patch" cmd="svn \"$patch_file\"" $cmd note space in "my dir". when execute it, $ ./test.sh skipped '"/home/my' skipped 'dir/vtk.patch"' i have no idea how accommodate space in variable , still execute command. executing following on bash shell works without problem. $ svn "/home/my dir/vtk.patch" #works!!! any suggestions appreciated! using bash cygwin on windows. use eval $cmd, instead of plain $cmd

code first - Entity and mapping using Entity Framework 4 how to handle null (ICollection)? -

i have fellowing entity : public class post { public long postid { get; private set; } public datetime date { get; set; } [required] public string subject { get; set; } public user user { get; set; } public category category { get; set; } [required] public string body { get; set; } public virtual icollection<tag> tags { get; private set; } public post() { category = new category(); } public void attachtag(string name, user user) { if (tags.count(x => x.name == name) == 0) tags.add(new tag { name = name, user = user }); else throw new exception("tag specified name attached post."); } public tag deletetag(string name) { tag tag = tags.single(x => x.name == name); tags.r

RE :How can we execute a shell script file from my Android Application -

i trying write android application runs shell commands, or shell script if preferable, , displays output... can give me in right direction? my code follows: void execcommandline() { runtime runtime = runtime.getruntime(); process proc = null; outputstreamwriter osw = null; try { string[] str={"/system/bin/sh","/data/shtest.sh"}; system.out.println("exec string"); proc = runtime.exec(str); osw = new outputstreamwriter(proc.getoutputstream()); //osw.write(command); osw.flush(); osw.close(); } catch (ioexception ex) { log.e("erre","ioexception"); //log.e("execcommandline()", "command resulted in io exception: " + command); return; } { if (osw != null)

c - TrigMath, 2 masses, rigid rod computing velocity -

Image
like else, doing thrust clone brush up. have arrived @ stage ship picks pod. essentially have 2 masses (consider centre of sphere only) connected rigid, massless rod. l never changes, doesn't break. in case, ship(ma) has mass 1.0, , pod(mb) has mass 2.0. math required compute new positions? when apply thrust ship(ma), how apply pod(mb)? (and make swing around expected) doing ship straight forward, usual velx-=sin(angle)*thrust, vely+=cos(angle)*thrust. posx+=velx. etc. know used know how this, school soo many years ago. here 2 approaches you. the first simpler. relax rigidity. make bar joins 2 spring. equal , opposite force exerts on both of them proportional amount length has been displaced. if make spring rigid, you'll have rigid bar simply. the second make bar rigid. in case entire system can described position , velocity of center of mass, , angle , rate of rotation of whole system. center of mass weighted average of positions of points in syst

Use Web Service in Android -

i want use web service in android application. have built web service using soap. you can try if ksoap2 library meets needs, since more suited mobile devices libraries aimed pcs

XML Flash problem in Joomla -

i've been creating xml flash carousel website in as2 in flash. i've managed working, icons images specified in xml file, links click on each icon lead external site. my problem is, when embed same flash file joomla, doesn't display, leaves space object should (a space of 650 x 400 pixels). when right click space, usual 'about adobe flash player 10' message when right click flash file. this xml problem rather flash problem because flash there not displaying because can't read file icons display them. is there can this? there common thing joomla can't use xml flash or xml joomla @ all? just reference, i've put entire carousel in images/stories folder in file structure. hope can help, kind regards, snakespan this sounds crossdomain issue. 1. url in browser site. 2. url have coded flash file download xml. if not in same domain issues. eg. go www.mysite.com/filewithflash.html flash file loads mysite2.com/xml.xml (note no www). or

android - press the save button EditText value is stored in to the database -

i have 4 edittext , 2 buttons namely, save , review button. if press save button edittext value stored in database , on clicking review button saved value in database listed in listview. how done please explain me. import android.content.context; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.provider.basecolumns; public class databasehelper extends sqliteopenhelper { public databasehelper(context context) { super(context, "medicinepill", null, 1); } @override public void oncreate(sqlitedatabase db) { db.execsql("create table if not exists names3 (" + basecolumns._id + " integer primary key autoincrement, first varchar, last varchar ,dose2 varchar ,dose3 varchar)"); } @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { // steps upgrade database new version ...

objective c - Get pixel colour from a Webcam -

i trying pixel colour image displayed webcam. want see how pixel colour changing time. my current solution sucks lot of cpu, works , gives me correct answer, not 100% sure if doing correctly or cut steps out. - (ibaction)addframe:(id)sender { // recent frame // must done in @synchronized block because delegate method sets recent frame not called on main thread cvimagebufferref imagebuffer; @synchronized (self) { imagebuffer = cvbufferretain(mcurrentimagebuffer); } if (imagebuffer) { // create nsimage , add movie // think can remove steps here, not sure where. nsciimagerep *imagerep = [nsciimagerep imagerepwithciimage:[ciimage imagewithcvimagebuffer:imagebuffer]]; nssize n = {320,160 }; //nsimage *image = [[[nsimage alloc] initwithsize:[imagerep size]] autorelease]; nsimage *image = [[[nsimage alloc] initwithsize:n] autorelease]; [image addrepresentation:imagerep]; cvbufferrelease(

asp.net mvc linq checking list for iqueyable -

i have no. of records being inserted in list<> . i have iqueryable returning more 1 record i want check whether records iqueryable returns present in list or not? is there way in linq can that? if talking union of both list of records u can use "union()" of "intersect()"(if interested in intersection), if talking left or right joins on these lists, should @ left join, right join using linq hope shall help.

gcc warning - enforing check about returning a value in gcc -

i compiling c/c++ files using gcc. i noticed today bug caused app crash. caused fact function didn't return value (see below). know if there flag in gcc enforcing these kind of checking or why compiler not warning me this? i compiling c files object files basic -g -d_gnu_source -o outobjectfile -c myfile.c option. //.c file int myfunc(){ ...do ..without return statement } //.h file extern int myfun(); when using gcc, compile with: -std=c99 -pedantic -wall -wextra -wwrite-strings c -ansi -pedantic -wall -wextra -weffc++ c++

c# - How can I determine the subsystem used by a given .NET assembly? -

in c# application, i'd determine whether .net application console application or not. can done using reflection apis? edit: ok, doesn't i'm going answer question because doesn't framework exposes functionality want. dug around in pe/coff spec , came this: /// <summary> /// parses pe header , determines whether given assembly console application. /// </summary> /// <param name="assemblypath">the path of assembly check.</param> /// <returns>true if given assembly console application; false otherwise.</returns> /// <remarks>the magic numbers in method extracted pe/coff file /// format specification available http://www.microsoft.com/whdc/system/platform/firmware/pecoff.mspx /// </remarks> bool assemblyusesconsolesubsystem(string assemblypath) { using (var s = new filestream(assemblypath, filemode.open, fileaccess.read)) { var rawpesignatureoffset = new byte[4]; s.seek(0x3c, seekorig

c - Replacing stdin within a piece of code -

i have piece of code uses stdin. when run program command-line pass location of wav file i.e. /users/username/desktop/music.wav. the code written in c. stdin variable runs throughout 2 functions. how replace stdin within code input of file directory , location? in other words, how hard code '/users/username/desktop/music.wav' 2 different c functions. i think looking freopen . if understand correctly, read filename argv[1] , call freopen(): freopen(argv[1], "r", stdin);

php - Quantifier range not working in lookbehind -

okay i'm working on project need regex can match * followed 1-4 spaces or tabs , followed row of text. right i'm using .* after lookbehind testing purposes. can match explicitly 1, 2, or 4 spaces/tabs not 1-4. i'm testing against following block * test line here * second test * third test * test and these 2 patterns i'm testing (?<=(\*[ \t]{3})).* works expected , matches 2nd line, same if replace 3 1, 2 or 4 if replace 1,4 forming following pattern (?<=(\*[ \t]{1,4})).* no longer matches of rows , can't understand why. i've tried googling without success. i'm using g(lobal) flag. php, many flavors, doesn't support variable length lookbehind. support alternation ( | ) @ top level of lookbehind. ? can break pattern. alternative use: (?<=\*[ \t]|\*[ \t]{2}|\*[ \t]{3}|\*[ \t]{4}).* or better, abort lookbehind group: \*[ \t]{1,4}(.*) this should work you, since doesn't seem have overlapping of matches anyway.

iphone - UITextField becomeFirstResponder and overlap subviews -

i have 2 problems. create class "myfirstclass.m" , in "projectcontroller.m" create uitextfield txt . in "myfirstclass.m" have method take txt parameter. if inside class call method: [txt becomefirstresponder]; it doesn't works. "myfirstclass.m" extends nsobject , "projectcontroller.m" extends uiviewcontroller . how can solve? because in same class "myfirstclass.m" have method create uitextfield add principal view, , when showed current textfield become first responder. my second problem is: have uibutton , uitextfield, add them ad view, want that: uitextfield showed in foreground , uibutton in background. property of uitextfiled can set background image, want uibuton bigger uitextfield, want uibutton background , uitextfield foreground. thanks in advance! to first question: i'm assuming you're using interface builder. make sure uitextfield connected corresponding outlet of uiviewcontroller

c# - How can I access to a ServerControl exists inside an ItemTemplate? -

i have following listview : <asp:listview id="procedureticketlist" runat="server" ... <itemtemplate> <asp:gridview id="mygridview" runa... how can access mygridview programmatically ? try following code snippet. protected void procedureticketlist_databound(object sender, eventargs e) { gridview gv= ((gridview)e.item.findcontrol("mygridview")); . . . } edit: check following code snippet. <%@ page language="c#" autoeventwireup="true" codefile="default2.aspx.cs" inherits="default2" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id=

.net - IIS web deploy problems -

yo i have web deploy set on server 1 works - can't life of me remember how many goats , sheep slaughtered ms gods of fud make work. now i'm moving hosting on amazon instance - need re-set iis. now - have done far install ms web deploy 2.0 through iis. i can't connect , dont have in default site (i expecting see msdeploy2 or - after friend @ work said should - - looking @ old server - don't see there either) what doing wrong? there million , 1 ways described on internet of doing , not 1 of them works because microsoft swap, change , rename every time @ redmond farts. the complete reference guide configure instance , deploy application maybe try install web deploy extension iis , try again? check manual configure web deployment handler

sql server - SQL View - add default values if null? -

i'm generating view, , want populate cells pre-defined value if null. the select view is: select a_case.id, r1.type referred_by_1, r1.type referred_by_2, r1.type referred_by_3 dbo.caseinfo a_case left join dbo.referrer r1 on p.id = r1.case_id , r1.seq = 1 left join dbo.referrer r2 on p.id = r2.case_id , r2.seq = 2 left join dbo.referrer r3 on p.id = r3.case_id , r3.seq = 3 the referrers optional, , if not specified, need populate field 'nd'. i think maybe should using case when, i'm not sure how integrate existing select... any advice gratefully received! - l you can use isnull : select a_case.id, isnull(r1.type, 'nd') referred_by_1, isnull(r2.type, 'nd') referred_by_2, isnull(r3.type, 'nd') referred_by_3 ...

c# - Validate against AD using email (not sAMAccountName) -

is there way authenticate against ad using email field (and password, sure) ? have both samaccountname , email set on server have validate using mail , not samaccountname. i using following code authenticate using samaccountname (it´s class library, way...) using (principalcontext pc = new principalcontext(contexttype.domain, dominio)) { return pc.validatecredentials(samaccountname, password); } if have upn (user principal name) set on each user , same email address should able use straight away. upn on form firstname.lastname@domain . default domain name of active directory used, internal (giving e.g. upn anders.abel@company.local ). possible register new upn suffix , setting user's email address upn without breaking anything. otherwise should able attach ad service account, search right user object based on email field, retrive samaccountname , logon using that.