Posts

Showing posts from February, 2015

visual c++ - I would like to get process name,process id ,Process Path,Product Name Window Title -

Image
how process information format develop tools visual c++ 2008 process name,process id ,process path,product name window title don't know how connect information toghter i assuming want information youself (the running process). to process name , path use getmodulefilename function full path , use last element in path process name. to process id use getcurrentprocessid function. to window title use getwindowtext function.

android - Getting android_key_not_configured facebook error -

i trying enable facebook login in android app. have linked the facebook app in application. once press login, facebook error android_key_not_configured has body seen before? i saw message too. hadn't added key in "key hashes" field on facebook native android app menu . went ahead , added dummy key "foo". after adding dummy key, next time ran app, after waiting 5 minutes, got "login failed" invalid_key:android key mismatch. key "my_key" match allowed keys specified in application settings.

components - The qml default signal handler cannot work -

---question--- i create "textbtn" component , add signal "btnclicked" in it: textbtn.qml import qt 4.7 rectangle { property alias btntext: showstr.text width:100 height:30 border.color: "black" border.width: 1 color: "white" signal btnclicked() //the default signal handler onbtnclicked: console.log(btntext+" clicked.") mousearea { id: btnmousearea anchors.fill: parent onclicked: btnclicked() } text { id: showstr anchors.centerin: parent color: "black" } } another component "menurow" contains 3 "textbtn"s follows: menurow.qml import qt 4.7 row { spacing: 5 textbtn { id: testbtn01 btntext: "test01" } textbtn { id: testbtn02 btntext: "test02" } textbtn { id: testbtn03 btntext: "test03"

How do I deploy a rails app to more than one domain/user/db combination in Capistrano and Rails 3? -

this might sound strange (or dangerous) deploy 1 rails app multiple domains. built 1 cms maintain several different clients. difference between sites css files, images, database.yml, , config.yml file. when deploy update sites @ once. each domain uses different usernames , passwords cannot use single user normal set in deploy.rb file. need run deploy on different sets of users, domains, , databases. my needs different deploying several staging, test, or load balanced servers. each web server unique , independent production server, running though different rails app. i need following in deploy.rb: role :app, "www.cats.com", "www.dogs.com" role :web, "www.cats.com", "www.dogs.com" role :db, "www.cats.com", "www.dogs.com" # both need same migrations set :deploy_to "/home/#{cats_user}/www.cats.com", "/home/#{dogs_user}/www.dogs.com" is possible? if not, alternative appreciated! we use mu

XSLT Validate and Concatenate Multiple Variables -

i have validate , concatenate multiple variable after validating them. <xsl:variable name="val1" select="//xpath"/> <xsl:variable name="val2" select="//xpath"/> <xsl:variable name="val3" select="//xpath"/> <xsl:variable name="val4" select="//xpath"/> <xsl:variable name="val5" select="//xpath"/> is there template available or can me doing this. update comments i want concatenate 5 values this: address, address1, city, state, zipcode . if address missing i'll output " , address1, city, state, zipcode ". want rid of first comma. <xsl:variable name="__add" select="translate(//*/text()[contains(., 'address')]/following::td[contains(@class, 'fnt')][1], ',', '')"/> <xsl:variable name="address"> <xsl:for-each select="$__add | //*/text()[contains(., 

Android Shared Preferences Initialization -

it nice have default values in shared preferences begin with. there way initialize them xml file or property file? looking best way this. thanks. read answer in question: android preferences: how load default values when user hasn't used preferences-screen?

log4j - grep-friendly logging of stack traces -

i lot of grepping through logs generated java's log4j , python's logging module. both create stack traces include newline characters, causing log entry span multiple lines. makes things hard find grep , violates conventional log file formatting rules (one entry per line). if find interesting in stack trace, have open entire log file (which can large) , browse line grep found, scroll find start of log entry. feels kludgey. is there better way handle this? perhaps removing newline characters stack traces somehow? thanks suggestions! if have gnu grep can use -c (aka --context ) switch: -c num , --context = num print num lines of output context. places line containing -- between contiguous groups of matches. i'm not sure if -c part of posix grep worth shot.

user interface - Matlab plots directly inside c++ GUI -

i'm using matlab compiler generate c++ shared library m files. possible display matlab plots directly inside c++ gui (not in separate window) ? i found easy solution. if using windows setparent matlab window. this. hwnd h = findwindow(l"sunawtframe", l"figure 1"); void matlabviewerhack::embedmatlabplot(hwnd h) { setwindowpos(h,null,rect.left(), rect.top(), rect.width(), rect.height(),0); setwindowlong(h, gwl_style,ws_child|ws_visible); setparent(h, parent_widget); //dynamic_cast<qwidget*>(parent())->winid() //updating ui_state, windows xp, window 7 sendmessage(h, wm_updateuistate, uis_initialize, 0); sendmessage(parent_widget, wm_updateuistate, uis_initialize, 0); sendmessage(h, wm_changeuistate, uis_initialize, 0); sendmessage(parent_widget, wm_changeuistate, uis_initialize, 0); current_window = h; }

Writing a translator using Antlr/Stringtemplates -

i want write translator. idea translate special formed c++ interfaces c++/cli. have antlr grammar parses , generates ast. want use information , string templates emit source code. my idea transform ast in kind of object hierarchy properties (e.g. interface object containing indexed property methods contains method-description-objects. master string template fed root object , inserts properties @ correct positions or passes them sub-templates. now question: how write string template / property needs called undefined number of times? example: interface contains number of methods. means, subtemplate method needs called several times, each time different property. how can write down mix of stringtemplate & indexed property? thank tobias i'm doing similar. basic idea model must expose list of object, , use list within string templates. instance, let's have braindead implementation. i'm going use java because that's know best; should idea. https://

select - Filtering out unique rows in MySQL -

so i've got large amount of sql data looks this: user | src | dst 1 | 1 | 1 1 | 1 | 1 1 | 1 | 2 1 | 1 | 2 2 | 1 | 1 2 | 1 | 3 i want filter out pairs of (src,dst) unique to 1 user (even if user has duplicates), leaving behind pairs belonging more 1 user: user | src | dst 1 | 1 | 1 1 | 1 | 1 2 | 1 | 1 in other words, pair (1,2) unique user 1 , pair (1,3) user 2, they're dropped, leaving behind instances of pair (1,1). edit : clarify, not interested in pairs filtered out, need all rows pairs not unique. any ideas? answers question below can find non-unique pairs, sql-fu doesn't suffice handle complication of requiring belong multiple users well. how select non "unique" rows my solution (tested): select user, src, dst, count(user) num_of_users test group src, dst having num_of_users = 1 edit: following code produces results provided in example. select test.user, test.src, test.dst test

c# - How do you send a request directly to .DLL (not .ASPX, .ASHX, etc.)? -

i want know how can send direct request .dll parameters. don't want use .aspx , .ashx. hope .dll request used more secure site. for example: irctc (india railway site): https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/services/login.do please let me know how can send or execute page .dll in asp.net. you can implementing ihttphandler interface , pretty build own routing there (check url , figure out should , write result using context.response ). register in web.config iis6 or lower: <httphandlers> <add path="*" verb="*" type="your.type, your.assembly"/> </httphandlers> or iis7 or higher: <system.webserver> <handlers> <add name="all" path="*" verb="*" type="your.type, your.assembly"/> </handlers> </system.webserver> however, should not more secure using framework. concern?

android - Can a broadcastReceiver catch multiple broadcasts? -

i trying create multiple proximity alerts cant work... i think broadcast receiver gets overwritten , handling last broadcast. if had 2 points close 1 intent created last generate alert... i read should use request codes have no idea on how that... my method setting pending intents , broadcast receiver... private void addproximityalert(double latitude, double longitude, string poiname, string intentfilter) { bundle extras = new bundle(); extras.putstring("name", poiname); intent intent = new intent(prox_alert_intent+poiname); intent.putextras(extras); pendingintent proximityintent = pendingintent.getbroadcast(mainmenu.this, requestcode, intent, 0); locationmanager.addproximityalert( latitude, // latitude of central point of alert region longitude, // longitude of central point of alert region point_radius, // radius of central point of alert region, in meters prox_alert_expiration, // time proximit

Looping in XSLT -

i have following xml <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="sample.xsl" type="text/xsl"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/atom" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel xmlns:cfi="http://www.microsoft.com/schemas/rss/core/2005/internal"> <title cf:type="text">the hindu - front page</title> <link>http://www.hindu.com/</link> <description cf:type="text">the internet edition of hindu, india's national newspaper</description> <image> <url>http://www.hindu.com/hindu/hindux.gif</url> <title>hindu.com</title> <link>http://www.hindu.com/</link> </image>

java - Jackson JSON processor problems -

i have been scratching head on hours : jsckson deserializes b bombs on c below : b , c both subclasses of a , , has setter getname . note uppercase n in name intentional, how json looks. deserializing c complains unrecognized field name name , b ok. version 1.7.2 objectmapper mapper = new objectmapper(); mapper.getdeserializationconfig().addmixinannotations(b.class, mixin.class); string json = "{\"name\" : \"13\"}"; b b = m.readvalue(json, b.class); system.out.println(b.getname()); c c = m.readvalue(json, c.class); system.out.println(c.getname()); public class { private int id ; private string name; public int getid() { return id; } public void setid(int id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } } public class b extends { private string address; public string getaddress() { re

unicode - iPhone - Convert NSString encoding from WindowsCP1251 to UTF8 -

how can have conversion nswindowscp1251stringencoding utf-8 ? had several attempts no 1 worked should. last try was: nsdata *dt = [mystr datausingencoding:nsutf8stringencoding]; nsstring *str = [nsstring alloc] initwithdata:dt encoding:nswindowscp1251stringencoding]; the result of str unreadable. did encounter similar? i think close: // convert cp1251 nsdata *dt = [mystr datausingencoding:nswindowscp1251stringencoding]; // load utf8 nsstring *str = [nsstring alloc] initwithdata:dt encoding:nsutf8stringencoding];

.net - WPF level intermediary -

i'm having interview client tomorrow regarding wpf project might work on. i'd expert advises regarding intermediary level in wpf ensure i'm in standing, because i'm little bit freaking out. could please state points intermediate wpf developer should master ? thank you i suppose: xaml (of course!), dependency properties, routed events, controls, commanding system, syles, drawing, templates, bindings, , bit of animations.

flash - Embed font will replace or complete another embeding font? -

i have swf a, contains no font. if download swf f1, contains few characters of arial, i'll have arial font embed a, no problem that. but if, then, download swf f2, contains other characters of arial swf a, able use embed characters font, f2, or f1 ? i'd have link somewhere explained, in technical terms : wasn't able find one. thanks reading. edit : after few tests, seems player replace loaded font... how can merge them, ? i don't think can merge them. fonts treated other class. when load swf swf in same app domain, colliding classes ignored. can use different application domain if want loaded swfs mantain own versions of classes, highly doubt can merge them on runtime. every application domain, except system domain, has associated parent domain. parent domain of main application's application domain system domain. loaded classes defined when parent doesn't define them. cannot override loaded class definition newer def

php - reading and removing a substring in the most efficient way possible, like array_pop() but for sub strings -

i have string of following. in other words, may have "in morning" or "in evening" sometimes, may not have anything. "bla bla in morning" or "bla bla bla in evening" or "bla bla bla" does php have function both isolate , remove sub string @ same time? $last_in_array = array_pop($arr); both saves last element $last_in_array , removes array @ same time. strings scenario i'm explaining. if not, what's efficient way this? function string_pop(&$haystack, $needle) { if (strpos($haystack, $needle) !== false) { $haystack = str_replace($needle, "", $haystack); return $needle; } return false; } $string = "bla bla in morning"; $return = string_pop($string, " in morning"); var_dump($string); var_dump($return); output: $string: string(7) "bla bla" $return: string(15) " in morning"

android - Two ListView Side By Side -

i have 2 listview. , need place them side side horizontally. problem - 1 list visible. (note : second list in right side of layout , can have @ 1 character. , first list expand fill rest of screen.) help me please. the layout this. ------------ | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------ <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" > <listview android:layout_width="fill_parent" android:layout_height="fill_parent" /> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" > <listview android:layout_width="fill_parent" an

iphone - Back navigation from an alert view button -

i'm having problems navigation previous view controller (in stack of navigation controller) when user taps custom "back" button shown in alert view. i've tried several ways it, haven't been able it. when button tapped, application goes controller popped alert (as if user press "cancelbutton"). hope can understand me sample code: in viewdidload, pop alert with: uialertview *alert = [[uialertview alloc] initwithtitle:@"xxxxxx" message:@"" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:@"back", nil]; [alert show]; [alert release]; then, inside code of view controller call next action try navigate back: - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex{ if (buttonindex == 1) { [self.navigationcontroller popviewcontrolleranimated:yes]; }} the whole code executed , has no debug errors. if haven't expla

java - JBoss AS6 app specific logging -

i'm migrating old web apps from jboss 4.2.2 6.0.0 (as6) . in as6 have proprietary format logging applications through file named jboss-logging.xml . after read stuff ( http://community.jboss.org/wiki/separatingapplicationlogs ) reach conclusion "(...)starting jboss 6.0.0.m2 ability log separate log files, per application, implemented in different way" , documentation "(...) updated more details, once implementation ready" . however able create specific application log files in server/log dir, done using main joboss-logging.xml file in server/deploy dir. not compatible modularity applications demand. so here problem when create jboss-logging.xml e web-inf dir app whit configuration: <?xml version="1.0" encoding="utf-8"?> <logging xmlns="urn:jboss:logging:6.0" xmlns:b="urn:jboss:bean-deployer:2.0" context="myapp"> <define-context name="myapp" /> <periodic-rot

iphone - TTNavigator on IPad -

i want start using three20's ttnavigator in app, read here shouldn't used on ipad. i don't explanation, , using url browsing mechanism has ipad screen size. did encountered problem ttnavigator on ipad ? i don't want start using later find out have problems running app on ipad. the reason ttnavigator written adds ttnavigationcontroller application's window. can use in fashion if you'd , work that's not how developers want use on ipad. want able have a ttnavigator control view hierarchy in 1 (if not both) of view controller(s) in split view. because ttnavigator designed work automatically on app's key uiwindow doesn't directly support being added view controller in uisplitviewcontroller. you can hack three20 make work or can wait few more weeks official support three20 developers.

extensibility - I'm using "protected" instead of "private", because someday I could need to extend my classes, is that bad? -

i have noticed pattern in code. choose protected , rather private , default access label "hidden" methods , fields in classes. because hides details class functioning users of class, while still leaving space extension in future. there drawback in coding "policy"? thank you tunnuz generally speaking never make because day might having implement or yadayada (it makes life complicated , miserable imho..). if have method should used within class, make private. if ever have extend inheritance reconsider functions might have accessed bellow. anyway abstract methods superclass anyway have thinking of needed when , where.. a reason why ignore said private methods, if want test internal functions i.e. in unit test. in c# can allow project see protected methods externally can write tests against them.

asp.net mvc 2 - Get the latest approved member -

i'm using asp .net mvc 2.0 default membership provider. how go retrieving name of latest registered approved member? as far can tell there no 'out of box' methods of membership class allow this. need run custom query or stored procedure against aspnet_membership table using either ado.net or preferred orm. key columns need query against createdate , isapproved .

xsd - Override XHTML validation for Rich Text Fields in Sitecore -

i'm trying embed renderings detailed in this article . when try add rendering rich text field xhtml validation errors. can't disable xhtml validation client wanted extend schema used validation. stored in /sitecore/shell/schemas directory. the markup rendering i'm trying embed is: <smart:addresssnippet runat="server" /> i've tried add new schema smart namespace doesn't seem work. when go html rich text field sitecore has rewritten code be: <smart:addresssnippet runat="server" xmlns:smart="http://www.sitecore.net/xhtml"></smart:addresssnippet> this fails validation. has encountered or way add renderings validation schema? i've tested adding following xml on local instance sitecore\shell\schemas\xhtml.xsd , renders tag wanted , not have validation errors in rich text editor. <xs:element name="smart:addresssnippet"> <xs:complextype mixed="true"> <

networking - Listen/register 2G 3G change on android -

i know how know network type : telephonymanager telmanager = (telephonymanager) context.getsystemservice(context.telephony_service); int network_type = telmanager.getnetworktype(); but want register when phone switch 2g 3g or 3g 2g... anyway ? thanks helping me. regards jim you should use phonestatelistener class. contains method ondataconnectionstatechanged (int state, int networktype) . hope help.

jquery - Facebook fan page feeds -

i want include widget user add url of facebook fan page , shoudl able feeds or recent feeds particular page , displayed in box facebook fan box. should. how do that.i able 1 particular facebook page. should added dynamically. each user can enter different facebook fan page link , should able it. thanks alot <!doctype html> facebook feed <script src="jquery.ui.core.js"></script> <script src="jquery.ui.widget.js"></script> <script type="text/javascript"> $(document).ready(function(){ function fbfetch(){ //set url of json data facebook graph api. make sure callback set '?' overcome cross domain problems json var baseurl = "http://graph.facebook.com/"; var search= $("fburl").val(); //use jquery getjson method fetch data url , create our unordered list relevant data. $.getjson(baseurl + search + "feed?limit=5&callback=?",function(json){

c# - How do I store temporary data manipulated by my ASP.NET module? -

i estimate implementing wsse authentication extending code similar this custom authentication module . that code hosted in asp.net , registered in <system.web><httpmodules> section in web.config file of site. instance of module created code inside iis, passed request, live time , destroyed. in order implement wsse need somehow keep track of issued challenges ("nonces") able prevent replay attacks. so need store recent challenges somewhere in such way collection persist between incoming requests , accessible module instances. what convenient (in terms of using c# , deploying on new server) , typical solution that? session["mysess"] can you

android - Accessing instance of the parent activity? -

suppose have class first.java(activity class) , start activity in class (second.java - activity class). how can access instance of first.java second.java ? can give me explanation on this.. example great... if need second activity return data first activity recommend use startactivityforresult() start second activity. in onresult() in first activity can work needed. in first.java start second.java: intent intent = new intent(this, second.class); int requestcode = 1; // or number choose startactivityforresult(intent, requestcode); the result method: protected void onactivityresult (int requestcode, int resultcode, intent data) { // collect data intent , use string value = data.getstring("somevalue"); } in second.java: intent intent = new intent(); intent.putextra("somevalue", "data"); setresult(result_ok, intent); finish(); if not wish wait second activity end before work in first activity, instead send broadcast first activit

Linq to XML - Problem selecting elements -

<invoice type='component' displayname='invoice' pluralname='invoices' msgversion='1' version='1'> <userdata type='specialelement'> <something /> </userdata> <from type='specialelement'> <something /> </from> <to type='specialelement'> <something /> </to> <cdtdbtnoteamt type='xsd:decimal' /> <pmtduedt type='xsd:date' /> <adjstmnt> <adjamt /> <rate /> </adjstmnt> <cpydplct type='picklist'> <item text='copy duplicate' value='codu' /> <item text='copy' value='copy' /> <item text='duplicate' value='dupl' /> </cpydplct> <invitems type='parentelement'> <invgd type='element'> <gddesc type='xsd:decimal' /> <qtyvl typ

groovy - Grails pagination tag error -

i have error when click on pagination button: error processing groovypageview: tag [paginate] missing required attribute [total] @ /home/user1/workspace/adm-appserver-manager/grails-app/views/emailnotification/status.gsp:59 and code is: in gsp: <div class="paginatebuttons"> <g:paginate total="${emailnotificationinstancetotal}" /> </div> in controller: def status = { [ emailnotificationinstancelist:emailnotification.findallbystatus(emailnotification.status.sent, params ), emailnotificationinstancetotal:emailnotification.countbystatus(emailnotification.status.sent) ] } i mention total attribute don't know why error appear make sure controller returning parameter in return or render. should add default value in controller or view, in case source call fails. <g:paginate total="${emailnotificationinstancetotal?:0}" /> or emailnotificationinstancetotal: email

git - gitignore across all branches? -

hey i'm trying git, emacs user first thing make sure ~ , #*# files ignored git. documentation talks .gitignore i've been using. couple of questions remain: gitignore checked in , part of branch. should .gitignore checked in , if so, how can make easy available across branches in repository? is there way use gitignore git config gitignore stays constant on repos? how can deal emacs lock files #*# treated comment? i'm on mac ox snow leopard. regards, jeroen add $home/.gitconfig ; [core] excludesfile = /path/to/your/local/.gitignore then it'll locally available on git repositories.

Display mercurial version with CGI -

i'm using mercurial on shared hosting hgwebdir cgi script. sometimes i'd check version of mercurial there installed on server. there way display mercurial version using cgi (like output of hg --version )? https://www.mercurial-scm.org/wiki/referencecycles from mercurial import hg, ui, util import os import gc def test(): print "mercurial version: %s" % util.version() repo = hg.repository(ui.ui(), os.getcwd()) status = repo.status() print status test() print "gc.collect() returns %s" % gc.collect()

codeigniter navigation problem -

hi using codeigniter 1.7.3. implemented pagination in application works fine. when click on next previous buttons works fine. but when click other tabs home invokes homecontroller of application. after application gives error , url got changes. http://localhost/myapp/search/pages/4 to http://localhost/myapp/search/pages/home this query printed on page. select * my_table 0=0 , status='a' order creation_date desc limit home,2 this process home function in homecontroller function processhome(){ $message = $this->input->post('message'); $requestsource = $this->input->post('requestsource'); $data['tabid'] = "home"; $data['servermessage'] = $message; $data['includeview'] = "profilesearch"; $data['showcontainer'] =""; $this->load->view('index', $data); } this java script function called on c

synchronization - Django Multiple Databases - One not always available -

i developing django application use multiple database backends. put sqlite database on machine running django application, , sync remote mysql database. tricky part machine running application not have internet connection, mysql database not availalble. there multiple machines running application, each it's own local sqlite db, using same remote mysql db. i haven't written code yet, here have in mind. every time run insert or update write both databases, unless remote db unavailable, in case save sql statement in table on local database run when remote db available. can done database routers, or need manually implement each db statement? note on pk: not directly related, sure asked. primary key generated locally on each machine. in mysql db there field key, , field unique identifier each instance of application, provide unique key. suppose have model called blog can use following store locally , remotely (assuming have configured access remote db). b

wpf - How can i make a prefix so i can address a folder in xaml -

i have problems making new prefixes in xaml. of time, message uri cannot found in assembly. setup: i have wpf project (in solution class libs , asp.net projects) mainwindow.xaml file. xaml starts : window x:class="mainwindow" ... . default, there's no namespace given it. in same project made folder "folder". in folder, have resx-files. need make prefix in xaml can address files. thinking of : xmlns:p="clr-namespace:wpfapplication.folder" and controls <label content="{x:static p:nameresxfile.keyname></label> however, prefix generates "uri cannot found in assembly" error. i'm failing @ making prefixes? thanks in advance. edit if cannot make namespace ref folder, happening here ? xmlns specifies namespaces, not bother folders or files, if need access external resource can load control's resources via resourcedictionary . there think: <window.resources> <resourcedictionary x:

inheritance - Java: do methods inherit a JRE super class, like classes inherit Object? -

as far know, object in java. i looking through java jdk , experimenting creating custom jdk allows me perform more debugging operations. example, can manipulate every object changing object.java class. my question is: methods inherit class jre well, can modify parent eg. make method save it's passed arguments? thanks. if want enhance debugging, can start looking @ jvmti has offer. before that, see if jdi , higher level (and therefore easier use) api built on top of jvmti suits needs. and although you're saying doesn't sound possible in itself, similar effect can achieved instrumentation , using byte code manipulating library, bcel. as specific example, if want record method invocations , parameters, setting breakpoint jdi , querying call stack can trick.

events - Execute a function when a Flex 3 App finishes execution -

i developing lib tracks user events, button click, state change, module load , application finish. my problem how can track application finish event. googled it, found no answer. it possible use kind of event? you need use externalinterface , here example: browser window close event , flex applications

.net - ASP.NET sample website for a SaaS model? -

i'm looking offer software product using saas model. of course require build web site customers can sign up, log in, manage membership , billing options, , of course use software on web. can recommend asp.net sample site or other type of site framework can use build out software infrastructure site? in other words, i'm sure things member sign up, log in, adding/editing account/billing details , typical account/user management stuff common elements of web sites these days, use saas model. i'd rather not reinvent wheel. of course portion of site deliver software service unique. many of other functions common , prefer leverage existing code as possible. i've read dotnetduke sounds work somewhat, sounds more content management system. not interested in cms type of site. want build out infrastucture parts of web site (as mentioned above) using many pre-made parts possible. can please point me resources this? commercial solutions fine too. i wouldn't

android - Radio button arranging problem -

how can put number of radio button in multiple rows , columns within single radio group. (for example: if there 10 radio buttons in single radio group. 5 should in first row , next 5 in second row because of device width small.) you can use scroll view horizontal scroll in each roll have given hierarchal apply hierarchal layout find solution of question. table roow(your table row) -put relative layout -put scroll view (horizontally) -put radio group -put radiobitton1,radiobitton2,radiobitton3,radiobitton4, radiobitton5 -put scroll view (horizontally) -put radiobitton1,radiobitton2,radiobitton3,radiobitton4, radiobitton5 -close radio group -close find radio button scroll horizontally scroll row wise. i hope help.

.net - How to retrieve objects of an anonymous type from db4o -

i'd store objects of anonymous type db4o database. example: // store object of anonymous type db var foobar = new {foo="ugh", bar="oh!"}; using (var db = db4oembedded.openfile("db.db40")) { db.store(foobar); } i'm using following code retrieve objects: // retrieve in separate program using (var db = db4oembedded.openfile("db.db40")) { var query=from dynamic fb in db select fb; query.dump(); } however, properties of object not accessible when after retrieval: dump gives (in linqpad) this: 5ienumerable<object> (3 items) genericobject (g) <>f__anonymoustype0`2[[system.string, mscorlib], [system.string, mscorlib]], query_vrfldn genericobject (g) <>f__anonymoustype0`2[[system.string, mscorlib], [system.string, mscorlib]], query_oqabew genericobject (g) <>f__anonymoustype0`2[[system.string, mscorlib], [system.string, mscorlib]], query_cfvuva is use case supported db4o? how objects neat

cocoa touch - OAuth 2.0 - calling server api on Iphone -

i want start using oauth call web server apis. preferably want use new oauth 2.0 since i'm new stuff, i'm not sure i'm gonna need. looked around , of examples twitter, i'm gonna need oauth call own server api. is there recommended library ? saw google 1 , gonna job or there's others ? second, i'm making url request using tturlrequest , there way provide object token ? (i'm not server guy bear lack of knowledge here) take @ oauthconsumer , based on project linked to, oauth. there's guide started here , , discusses using request , access tokens well.

sql - Entity Framework and changing table schema/structure -

i wondering if knows if following somehow possible using ef or other orm. we have number of tables in database. 1 "person" id name phone email this same databases , not change, it's our base table speak :) now 1 database might have table called "person", it's same column phone . id name phone email phone is there way have phone column available in entity dictionary<string,object> ? looking basic select queries support this. won't need separate model databases. or not possible? :) -- christian linq sql or linq entities designed work on static table schema, i'm afraid you'll have use ado.net want, or go schema (fk other tables containing key values pairs exemple)

Why can XSLT not parse this XML? -

taking xslt , xml page example: http://www.w3schools.com/xsl/xsl_transformation.asp i have xml file contains (above example modified): <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <catalog xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns="http://tempuri.org/"> <cd> in case, output contains nothing when xslt/xml processed browser. moment remove attributes element, works. problem is, don't have option of pre-processing attributes out of file. can explain how force xslt work xml is, please? after all, attributes seem standard. many thanks, matt. add default namespace stylesheet well, , use it.

wcf - Both http and https for one service -

i'm tackling issue couldn't sort out it. i have 1 service worked inside asp.net 4.0 app. site available both on http , https. issue service below provided config snipped can work either on http or on https. what wrong in config? <system.servicemodel> <bindings> <webhttpbinding> <binding name="webhttpsbinding"> <security mode="transport"> <transport clientcredentialtype="none"/> </security> </binding> </webhttpbinding> </bindings> <behaviors> <endpointbehaviors> <behavior name="hms.dataservices.paymentsservicebehavior"> <enablewebscript /> </behavior> </endpointbehaviors> <servicebehaviors>

java - C JNI help with complex code -

dev env: ubuntu 10.10 (32-bit), eclipse, openjdk i have code executable written in c. need modify convert .so library , access functions java code. currently, c code comprises 3 headers , 3 source files (.c). need call main function , pass 2 strings java. rest of functions called within main(). unfortunately, 1 of other functions prints results command line. how implement jni pass 2 strings , return particular result? i found examples on web found them simplistic. fail locate jni.h header use. would use jniexport int jnicall java_ppldtct_main(jnienv*,jobject,jstring,jstring) instead of int main(int argc,char** argv) in c? all appreciated. thank you if understand correctly, trying minimal changes in existing code. if that's case, may try overwrite file descriptor 1 ( stdout ) pipe , output of program way.

c# - Silverlight DataGrid validation show validation error for all objects|properties -

Image
i have observablecollection <t> t: inotifydataerrorinfo. objects in collection have validation errors, bind collection silverlight 4 datagrid, there way show validation error in datagrid? (show red cell invalid properties each object). default datagrid show validation error when begin edit row, , active row. i haven't succeeded textblock control, used disabled textbox can change template of textbox , mean remove border , set background transparent. <sdk:datagrid autogeneratecolumns="false" itemssource="{binding items}" isreadonly="false" selectionmode="single"> <sdk:datagrid.columns> <sdk:datagridtextcolumn header="title" binding="{binding title}"/> <sdk:datagridtemplatecolumn header="link" width="100"> <sdk:datagridtemplatecolumn.celltemplate> <datatemplate> <textbox t

Count search results in Lucene.Net -

i'm new lucene , want count occurences of search word in index. saw should use like: indexreader reader = ....... termdocs termdoc = reader.termdocs(); termdoc.seek(new term("my_field", mstrsearchfor)); int occurencecount = termdoc.freq(); i can't seem create indexreader start. fsdirectory directory = fsdirectory.open(new system.io.directoryinfo("c:\\temp\\")); indexreader reader = indexreader.open(directory, true);

JQuery loading dialog effect -

in past used yui container loading effect. please see link: http://developer.yahoo.com/yui/examples/container/panel-loading_clean.html but suggested me use jquery. can let me know link or code create loading effect in jquery yui has been providing? thanks, ravi bhartiya in order functionality (easily), need use jquery ui . you'll need combine 2 of widgets have included in order replicate effect. you'll need put progress bar inside of dialog . grayed out background effect, you'll need enable 'modal' attribute on dialog. please see jquery ui documentation , demos more info, i'm not expert jquery ui.

java - Concurrent database access pattern for web applications -

i'm trying write spring web application on weblogic server makes several independent database selects(i.e. can safely called concurrently), 1 of takes 15 minutes execute. once results fetched, email containing results sent user list. what's way around problem? there spring library can or go ahead , create daemon threads job? edit: have done @ application layer (business requirement) , email sent out web application. are sure doing optimally? 15 minutes long time unless have gabillion rows across dozens of tables , need heckofalot of joins....this highest priority -- why taking long? do email job @ set intervals, or invoked web app? if set intervals, should in outside job, possibly on machine. can use daemons or quartz scheduler. if need fire process off web app, need asynchronously. use jms, or have table enter new job request, daemon process looks new jobs every x time period. firing off background threads possible, error prone , not worth complicati

flex4 - Flex 4: mx|tree - how can i disable items selection? -

i want create tree it's child nodes contain specific flex components created. override default itemrenderer achieve this. in itemrenderer have: two states: item , root_item . a function executes after creation complete using data validates proper state component should in , changes currentstate desired state. my problem once user clicks on of elements, changes automatically first state mess things up. how can disable items selection @ ? of course want user able drill , down trees not select items. thanks! update the item changes states on hover effect, or disable items selection or somehow prevent hover effect changing state. another update this code: the main treetest.xml: <?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

javascript - Handling and aborting downloads from Firefox extenstion -

i need strange behavior extension :) when user enters url or clicks on link points document need show him web page instead of downloading file (web viewer pdf, example). words, want have binding between content's mimetype , action. is there way privileged xul code? ps. know can write plugin displaying content in browser, adobe reader plugin, prefer writing in js instead of c++ (and don't wanna cross-compile code platforms plugin should work). best regards, gleb. you can register component implements nsiruicontentlistener interface category manager. category external-uricontentlisteners . entry mime type want register. value component's contract id. alternatively possible register component directly uri listener useful if loading component @ startup. when user clicks on link document served mime type (and there no installed plugins handling type) component created. 1 of ispreferred or canhandlecontent methods called; should verify content type 1

email - How do you create editable content in a ConstantContact custom template? -

i'm forced use constantcontact development platform email marketing, , offers custom xhtml tags <property> , <article> , , documentation on @ http://constantcontact.custhelp.com/cgi-bin/constantcontact.cfg/php/enduser/std_adp.php?p_faqid=2215 seems assume adding such tag custom xhtml template allow property editable in "control panel" area rather hidden deep in html code. my client not experienced hunting through code find area needs edited, i'd make easy on them , allow text editable in textarea right control panel. possible "greeting" property. can create custom properties in constantcontact default <greeting /> , can edited right wizard? since didn't see rated answer, figured i'd add one. just clarify, constant contact crap service skates on name recognition , clients ignorant know there better options. (no offense client...) now, answer question, there no way (4.13.13) (or developer outside of constant conta

ruby - Using RVM with different gemsets in TextMate -

i have set rvm , made individual gemsets projects per rvm best practices . running test file in textmate dosen't work , have read here do. problem won't work because guide expects me have 1 gemset (they call "rails3"). have 2-3 projects open @ time (using different gemsets) can't use approach. have of solved problem? i've found rvm wrappers method buggy, , you've discovered doesn't work @ gemsets unless lot of tedious setup. i've had success using following script tm_ruby : #!/bin/bash base_dir=${tm_project_directory:-$pwd} cd $base_dir exec $my_ruby_home/bin/ruby $* as long you're in textmate project , have .rvmrc file in project root run code in ruby version , gemset specified in .rvmrc . cd makes sure rvm discovers .rvmrc . put code above ~/bin/textmate_ruby_wrapper , go preferences > advanced > shell variables , set tm_ruby same path.

How can I get Emacs cc-mode functions that refer to functions to work with Java methods? -

as noted in cc-mode's documentation , functions c-indent-defun , c-mark-function "can't used reindent nested brace construct, such nested class or function, or java method." same goes c-beginning-of-defun , ilk. does have solution these functions working java methods, or maybe java-specific replacements? i don't use java, emacs has java development environment . jdee jalopy claims beautifying work. should functions mention.

c# - Custom MediaElement -

i using mediaelements in application creating. dynamically creating them , adding them wrap panel. the problem need able add key them can go , locate specific one. i going inherit mediaelement , add key member. unfortunately can't because it's sealed class. so tried create class containing mediaelement , key can't add gui since not uielement . is there anyway can this? need able add mediaelements , them able go , find them later can modify or remove them. there such way. add dictrionary <string, mediaelement> form. when adding new media element, add dictionary either. when you'll need access mediaelement can query dictionary using it's key name. you'll reference element @ same time in dictionary , on gui. and when deleting gui, don't forget delete element dictionary either.

php - Parse error: syntax error, unexpected T_FUNCTION line 10? -

what wrong code? ran code on test server , code worked when upload production server parse error: syntax error, unexpected t_function in /hermes/bosweb/web013/b130/ipg.acrsflcom/darayngedbeats/gentest.php on line 10 here code $old = "http://darayngedbeats1.s3.amazonaws.com /mp3/crazymonsta2.mp3?awsaccesskeyid=akiajxa36esclqhcb54q&expires=1297279906& signature=hd36zqe8yetiw6jpwkmcciptits%3d"; //enter key needs converted $search = array(":","?","=","&","%"); $replace = array("%3a","%3f","%3d","%26","%25"); function search_replace($s,$r,$sql) { $e = '/('.implode('|',array_map('preg_quote', $s)).')/'; $r = array_combine($s,$r); return preg_replace_callback($e, function($v) use ($s,$r) { return $r[$v[1]]; },$sql); } echo "<br><br>"; $new = search_replace($search,$replace,$old); echo $new; ?&g

Transfer files from Mediafire to Amazon S3 -

i have few gigs stored @ mediafire , want move them on s3 account. there straight forward way "upload web" using link file rather downloading files , re-uploading them s3 servers? no. if have few gigs, using 1 of many s3 browsers (e.g. s3 browser , cloudberry ) path of least resistance after download files mediafire. you might save time , money booting ec2 instance -- have pay inbound data transfer , pipe larger.

d - Is opIndexAssign possible in C++? -

the d programming language version 2 has nifty method overload expression this : classinstance[somename] = somevalue; or d function defined in this little example : ref map opindexassign(ref const(valuet) value, ref const(namet) name) { this.insert(name, value); return this; } is possible in c++ (ideally without using stl)? if so, how? normally, use proxy object return type of operator[] ; object have custom operator= defined. vector<bool> specialization in c++ standard library uses proxy behavior looking for. proxy-based solution isn't transparent d version, though. code like: class proxy; class my_map { public: proxy operator[](const key_type& k); // rest of class }; class proxy { my_map& m; key_type k; friend class my_map; proxy(my_map& m, const key_type& k): m(m), k(k) {} public: operator value_type() const {return m.read(k);} proxy& operator=(const value_type& v) {m.write(k, v); return *t