Posts

Showing posts from July, 2015

javascript - JS String.replace can be tempremental with Safari -

the backstory: this works fine in browsers except safari (5.0.1) var chunk = arr[i]; chunk = chunk.replace('$', '\\$'); var = eval('message.match(/' + chunk + '/gi);'); if(a instanceof array) symbol = symbol.concat(a); so modified following: var chunk = string(arr[i]); chunk = chunk.replace('$', '\\$'); var = eval('message.match(/' + chunk + '/gi);'); if(a instanceof array) symbol = symbol.concat(a); which made safari bit more happy throwing ambiguous error (fun!) i've found solution , i'm posting below in case other fellow scripters run problem. i couldn't reproduce problem because i'm not sure what's value of chunk . anyway, 1 more example of unnecessary usage of eval , can use regexp constructor build regexp object string, example: var re = /foo/gi; is equivalent creating object in runtime regexp constructor: var re = new regexp('foo', 'gi'); appl...

unix - Print STDOUT in the middle of 2 Pipes in Solaris(bash) -

http://www.webdesignerdepot.com/rss.htm i have same issue. command: ./somescript.sh > ../log/scriptlog.log requires output of command go std out. inside script command | mailx -s "subject" recipient@somedomain.tld what : command | tee > /dev/stdout | mailx -s "subject" recipient@somedomain.tld where output of command goes stdout( redirected ..log/scriptlog.log file ) and stdin mailx command. any way that? tee sends stdout. ... | tee -a log/scriptlog.log | ...

ruby on rails - RoR free element from array -

i have element in array such that, [#<name id: 23, first_name: "anderson", last_name: "gorge">] how can remove array block, want as #<name id: 23, first_name: "anderson", last_name: "gorge"> without array block do mean have a  single element in array , want extract it? there many ways of doing it, 2 come mind are: >> obj = [#<name id: 23, first_name: "anderson", last_name: "gorge">].first => #<name id: 23, first_name: "anderson", last_name: "gorge"> >> obj = [#<name id: 23, first_name: "anderson", last_name: "gorge">].shift => #<name id: 23, first_name: "anderson", last_name: "gorge">

c - Python Extension Can't Use library_dirs -

when specifying library_dirs in python distutils.core.extension error when trying build: /library/frameworks/python.framework/versions/2.5/lib/python2.5/distutils/dist.py:263: userwarning: unknown distribution option: 'library_dirs' warnings.warn(msg) why this? using python 2.5 on mac os x. the error means you're not passing library_dirs distutils.core.extension , distutils.core.setup function.

Select & Copy firefox content to clipboard in C or C++ -

i found few questions similar mine none of answers satisfactory , few years old. hoping perhaps progress has been made on front since then. what interested in ability access content of active firefox window , copy clipboard -- using c or c++ code. in internet explorer can use com's ihtmldocument2 access broswer's contents dom . is there similar in firefox? if so, how do that? btw, current (ugly) workaround mimic ctrl+a, ctrl+c sending virtual keystrokes, not robust , elegant solution. ideas, tips, insight, knowledge appreciated. thanks. note: further clarify challenge, note not interested in javascript based or flash based solution. instead, interested in c/c++ solution, if limited microsoft windows platform only. the dom in firefox exposed c++ via xpcom beware, unlike mshtml (in ie) interfaces in mozilla not frozen unfrozen interfaces version specific , may change release release. the xpcom equivalent of ihtmldocument2 nsidomdocument . xpco...

javascript - How to check if a value exist in select box -

is there method other running loop check if value exists in select box using javascript ? i looking document.getelementbyid('selbox').valueexists('myval'); you can't extend methods select -element has. there not solution without function check existence of value in select . a "solution" without loop following... function selecthasvalue(select, value) { obj = document.getelementbyid(select); if (obj !== null) { return (obj.innerhtml.indexof('value="' + value + '"') > -1); } else { return false; } }

asp.net mvc 2 - PartialView and HTTPPOST action -

i've problem partial view , controller httppost action : when i'm in httppost partialview, partial return, not index page partialview. i don't understand why! the context : i've offer(associated viewmodel), composed of 4 parts : client, swimmingpool, cover, resume make offer on single page partialview, 1 per parts. code in view (offer/index) : <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <h2>index</h2> <% html.renderaction("p_client"); %> </asp:content> code in controller : public class offercontroller : controller { public actionresult index() { return view(); } [httpget, childactiononly] public actionresult p_client(string id) { blablabla return partialview("p_client", viewmodel); } [httppost] public actionresult p_client(offerviewmode...

Returning PK of gridview when updating or inserting (ASP.NET, C#) -

i require changes such inserts, updates , deletes table auditted, , i'm using simple sqldatasource , gridview automagically generated insert/update/delete statements. problem is, when row updated want id (primary key) , put auditting table - because parameters update query actual data , not primary key, don't know how access information. here update query: insertcommand="insert [nominalcode] ([vaxcode], [reference], [costcentre], [department], [reportingcategory]) values (@vaxcode, @reference, @costcentre, @department, @reportingcategory)" and here codebehind auditting: protected void sqldatasource1_updating(object sender, sqldatasourcecommandeventargs e) { string fields = e.command.parameters[0].value.tostring() + "," + e.command.parameters[1].value.tostring() + "," + e.command.parameters[2].value.tostring() + "," + e.command.parameters[3].value.tostring() + "," + e.command.parameters[4].value.tostring();...

iphone - uiview like actionsheet -

is possible show uiview actionsheet on presentmodalviewcontroller(i.e. uiview should go top should not go , should half) view last view controller on screen. thanks in advance. regards, sathish this blog entry think you're trying achieve.

c# - Create instances of classes that populate forms in Visual Studio -

i want instantiate classes have written in visual studio 2008 , populate listview these instances resides in form opens within visual studio. give example let's have class employee within our solution. using vs extensibility open form in vs contains listview. create 100 employee instances populating listview , able edit properties. if change in class employee e.g: add attribute date of birth, listview have updated. can provide examples or links helpful? assuming uderstanding question correctly, have form listview, , when open form on opening create 100 instances of employee first step. start array list of employee. list<employee> employeelist = new list<employee>(); populate list when form loads. private void form1_load(object sender, system.eventargs e) { for(int = 0; < 100; i++) { employeelist.items.add(new employee()); } // bind employeelist listview listview.itemsource = employeelist; } if update employeelist ...

Color not showing with foxit reader. -

i using foxitreader version-4.2.0, problem when open pdf file in it, font not show color. opening same pdf file in foxit reader version2.3 shows font it's actual color. whats exact problem ? you can try this, tools--preference--documents, check option 'use windows colors scheme'. see actual color. think no business versions. :)

Searching for a precise term for a SQL phrase -

i'm trying document sql , wanted right terminology. if write sql so; select child.id, parent.id hierarchy child inner join hierarchy parent on child.parentid = parent.id then have 1 actual table ('hierarchy') giving 2 names ('parent' , 'child') question how refer logical entity of table name. what write in blank here name? "this query uses 1 table (hierarchy) 2 _ (child , parent)" [edit] left previous draft in question. corrected. in sql server docs, term table_source : specifies table, view, or derived table source, or without alias, use in transact-sql statement in bnf grammar, it's: <table_source> ::= { table_or_view_name [ [ ] table_alias ] [ <tablesample_clause> ] [ ( < table_hint > [ [ , ]...n ] ) ] | rowset_function [ [ ] table_alias ] [ ( bulk_column_alias [ ,...n ] ) ] | user_defined_function [ [ ] table_alias ] [ (column_alias [ ,...n ] ) ]...

asp.net - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' -

i trying insert html pages mysql asp.net project getting error; have error in sql syntax; check manual corresponds mysql server version right syntax use near 'de osman patlaması', '', '<div style=\"text-align: center\">\r\n<img src=\"/i' @ line 1 how can fix problem server side code is; mysqlconnection mycon = new mysqlconnection(); mycon.connectionstring = configurationmanager.connectionstrings["mysqlconnectionstring"].connectionstring; mysqlcommand cmd = new mysqlcommand(); cmd.commandtype = commandtype.text; string query = @"insert `test`.`posts` (`id`, `author`, `title`, `description`, `content`, `ispublished`, `iscommentsenabled`, `pubdate`, `lastmodified`, `raters`, `rating`, `slug`, `tags`, `categories`) values (null, '{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{1...

https - Why should i use ssl? -

i'm running dating site , not using ssl @ moment. i've noticed major sites facebook , twitter not use https login use plain old http, there advantage https-ing site or cc transactions or ? thanks in advance. actually, facebook does use https login: <form method="post" action="https://login.facebook.com/login.php?login_attempt=1" id="login_form"> as twitter: <form method="post" id="signin" action="https://twitter.com/sessions"> you'll notice don't use https page displays signin form. that's because isn't necessary. however, it's idea use ssl login if can, if because many users employ same password sites. one solution, i'd see more sites employ, using openid/oauth login instead of requiring username/password.

Trouble with inheritance of operator= in C++ -

i'm having trouble inheritance of operator=. why doesn't code work, , best way fix it? #include <iostream> class { public: & operator=(const & a) { x = a.x; return *this; } bool operator==(const & a) { return x == a.x; } virtual int get() = 0; // abstract protected: int x; }; class b : public { public: b(int x) { this->x = x; } int get() { return x; } }; class c : public { public: c(int x) { this->x = x; } int get() { return x; } }; int main() { b b(3); c c(7); printf("b: %d c: %d b==c: %d\n", b.get(), c.get(), b==c); b = c; // compile error // error: no match 'operator= in 'b = c' // note: candidates b& b::operator=(const b&) printf("b: %d c: %d b==c: %d\n", b.get(), c.get(), b==c); return 0; } if not declare copy-assignmen...

sharepoint - How to configure a non-trivial list view in share point -

i have sharepoint list. has items properties a, b, c, d, , e. want create view filter items this.... where (a = 1 , b = 2) , (c = 3 or d = 4 or e = 5) sharepoint appears flatten out where (a = 1 , b = 2 , c = 3 or d = 4 or e = 5) and gives me results not want. irl, view work in progress (a , b - text field) assigned set of developers (c, d, , e - people). does have reasonable solution this? computed columns doesnt seem allow data type "people". there other formulae or trickery can code in make work? probably need xslt view or webpart. update: sorry, totally forgot caml views . lot more suitable solution. read this article example

linq to sql - LINQtoSQL , repository pattern and lazy load -

how use linqtosql repository pattern? i’m new l2s , find lazy loading real impediment using repo pattern. usually, think of repository pattern this: var mycustomer = null; using (var myrepo = new repo()){ mycustomer = myrepo.getcustomerforcustomerid(123); } if(mycustomer.orders.any()){ //do } trouble is, won’t l2s attempt make data connection when mycustomer.orders interrogated? doesn’t lead unpredicatable database access issues? i mean, yes, tell repo verify orders inside of repo confident our complete test coverage verifies developers never call entity didn't explicitly load, rather rid of lazy loading/object-datacontext persistence. so have 4 options create domain objects created l2s objects – lots of work , maintainance create derived verisons of l2s object break linkage (http://www.codeproject.com/kb/linq/linq-to-sql-detach.aspx) use llblgenpro instead. appeal wisdom of stack overflow readers i’m going 4 now. how ensure objects wont call...

iPhone, How do I force one view into landscape mode? -

how force 1 view landscape mode graph. i want click tab bar button make graph view appear when button clicked on view want push child screen need in portrait mode. once click want return graph view in landscape. use uiview's transform property rotate pi radians: -(void)viewwillappear:(bool)animated { cgaffinetransform newtransform = cgaffinetransformmake(0.0,1.0,-1.0,0.0,0.0,0.0); self.view.transform = newtransform; } http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html%23//apple_ref/doc/uid/tp40006816-ch3-sw4

php - For a consumer website, should I have a user ID in my DB in addition to the user-selected unique username? -

this "web dev best practice" question. envisioning website users sign username select (revolutionary, know). enter valid email address. test uniqueness of in db before allowing sign-up. the site non-commercial in nature, , don't need guid. given this, should have in db separate user id? understand vaguely mysql might index more efficiently number-based id? alternatively, should use email address unique identifier? thanks. jdelage user names typically not unique, , e-mail addresses can reused. that's 1 reason have numeric unique user id. another when create database relation, mysql has make copy of primary key of user table. example, if have list of orders per customer. order contain username if primary key. usernames longer integers, hurts index performance. if combine two, user changes username or email becomes big problem: have rename primary key, isn't easy, , you'd have update references user other tables. but overall, ...

multithreading - Memory management bottleneck to SMP Parallelism -

across multiple languages (mostly d , java/jython) i've noticed parallel programs no obvious synchronization bottleneck don't scale 4 or more cores because of memory management bottlenecks. i'm aware thread-local allocators mitigate problem, garbage collector implementations still need stop world. garbage collection not embarrassingly parallel (shared state has updated way often), using parallel collector doesn't solve problem. in case of manual memory management, if allocations thread-local allocator, memory still has freed, possibly different thread 1 allocated in. is there language/runtime/malloc implementation memory management bottleneck smp parallelism practical purposes solved problem, while still allowing traditional shared address space multithreading? no. what describe memory management bottleneck intrinsic feature, albeit not desirable one, of smp computers. sooner or later demands of processors access memory overwhelm memory bus , proces...

iphone - UIScrollView with UIButton doesn't scroll when touch down on button -

i've got uiscrollview in uiview . i've added uibuttons scroll view. if touch down not on button , drag, scroll view drags fine. if touch down on button , drag scroll view doesn't move. i want scroll view scroll around if dragged , buttons selected on touch inside event. i don't want check "delay content touches" because don't want have wait delay. does know need work? regards, rich there's no automatic way of doing that. have manually handle touch event, , determine user wants do, if moves finger x pixels or down, wants scroll, , if releases touch inside button, wants activate action. regards!

c# - adding an exam booking detail to database -

how add exam booking audit trail database, can determine when , has uploaded exam results you create table , write class inserts values table. easy that. p.s. ask vague question , vague answer.

Use JSON to extract parameters from URL -

how extract parameters url when method posted using json? i guess getting response in json form for extracting parameters can use newtonsoft.json.dll.you documentation here :- http://james.newtonking.com/pages/json-net.aspx or after getting data can use usual crawling methods extracting data

java - Spring Session User Info retrieval in Dao layer -

i have web-application in java, spring framework, hibernate on tomcat, has no security except login , logout functionality (no spring security) i can access user information in controller by: // request httpservletrequest httpsession session = request.getsession(true); systemuser user = (systemuser) session.getattribute("user"); and logic. however, need information in dao layer. data database retrieve user specific data. 1 way pass "user" object service layer , service layer pass on dao layer. quite huge load of work. i wonder if there way in spring how access session object in dao layer? or other way retrieve user specific data. this might personal opinion far better passing type of information along method parameter rather accessing web context classes in dao. what if want use dao classes outside of web application? the dao accessing sort of request context holder makes question of data dao method needs run hidden secret - rather decla...

Jquery inside modal box function -

i use next function build modal box. , need jquery combo box inside modal box. function launchmodal(id) { jquery('body').append('<div id="catmodal" title=""><select id="ac_s1"><option value="home security"></option></select></div>'); jquery('#'+id).dialog({ resizable: false, height: 370, width: 900, modal: true, buttons: {close: function(){jquery(this).dialog('close');}}, close: function(event, ui){jquery(this).dialog('destroy').remove();} }); and wrote jquery(document).ready(function(){ jquery("#ac_s1").combobox(); } but works outside modal box function, if insert inside of modal box function content, stops working , simple html select menu appears. how solve it??? give id modal div - modaldiv write html in that try $('#modaldiv...

Convert javascript array handling to jQuery -

i'm doing javascript assignment , have learned can in jquery if wish, rather vanilla javascript. thought i'd give go see it's like. this contents of javascript function: rowsarray = $("#table1 tr"); (i=0;i<rowsarray.length;i++){ numseatsinrow = rowsarray[i].getelementsbytagname("img").length; // discovers number of seats in row [i] for(j=0;j<numseatsinrow;j++) { // loops round once each set in row [i] var currentseat = rowsarray[i].getelementsbytagname("img")[j]; currentseat.setattribute("id","row" + + "seat" + j); currentseat.onmouseover = function(){this.src = "images/taken.gif"}; currentseat.onmouseout = function(){this.src = "images/available.gif"}; currentseat.onclick = function() { this.src = "images/mine.gif"; this.onmouseover = null; this.onmouseout = null; document.getelem...

Conflict with ajax while using with Jquery -

hi using jquery tab in page. while using update pannel both tab appear in same page. occures after post back.. problem there using jquery , update pannel together? how can overcome this? i'm using jquery-ui tabs , <asp:updatepanel> controls on same page, , it's not best setup, works. 1 thing got me tabs() wasn't being called after partial-postback call databind() in 1 of inner asp.net controls. worked around way, , perhaps you: function refreshtabs() { $("#tabs").tabs(); } function pageload () { refreshtabs(); } by putting call tabs() inside asp.net's pageload() function instead of jquery's $() function, it's called after every postback, if partial postback triggered. hope helps!

python - blender not responding to my accelerometer motion -

m using arduino interact accelerometer mma7361l blender2.49.using python 2.62. arduino code : void setup() { serial.begin(9600); } void loop() { serial.print(analogread(0)/4, byte); //x-axis serial.print(analogread(1)/4, byte); //y-axis serial.print(analogread(2)/4, byte); //z-axis delay(40); } my python code is: import blender import gamelogic import serial serialport = serial.serial('com4', 9600) ob = blender.object.get ('cube') cont=gamelogic.getcurrentcontroller() own = cont.owner rotxx = move.drot[0] rotyy = move.drot[1] rotzz = move.drot[2] move = cont.actuators["move"] blender.window.waitcursor(1) x=[0,0,0] in range(1, 100): x1[0] = serialport.read(size=1) x1[1] = serialport.read(size=1) x1[2] = serialport.read(size=1) x2=[(((m - n)*1.65)/180) m,n in zip(x,x1)] rotxx = rotxx + x2[0] rotyy = rotyy + x2[1] rotzz = rotzz + x2[2] move.drot=(rotxx,rotyy,rotzz) cont.activate(move) x1=x e...

asp.net - ViewState, QueryStrings and their effect on SEO -

well, start with, i'm novice asp.net/c# programmer, , had experience of couple of projects during college , couple of freelancing projects when recruited startup company build asp.net based website. i've abut completed website, , since company not able find worthy enough seo, i'm expected our site's seo well(which totally new experience me). did mention i'm web developer here? so, you'd expect novice programmer having no concern future seo needs, built site without giving due consideration of seo enhancement techniques. the problems: viewstate - when required? required if i'm not creating controls on fly? i'm using datacontrols though. , website(the pages visible user not cms), purely information based. also, if disable control(ex: datalist)'s viewstate, viewstate of controls inside disabled?(which i'd actually) querystrings - comes toughest part, i've used query strings extent can website querystring driven, unfortunately enough ...

asp.net - Javascript store not removing all elements before re-adding -

so have dropdown setup on page called ddlvehicletype populated store. method gets called when dropdown changed, , it's supposed remove items aforementioned store, re-add them needed, , populate dropdown new values. it's doing it's supposed except clearing store before re-adds values, result is, when switch, i'm getting used plus new values should in there themselves. here weird thing though, when switch back, values removed without re-adding anything. can tell me i'm doing wrong? method below: function filtervehicletypes() { var masterstore = global.getcomponent("vehicletypestore").getstore(); var source = global.getcomponent("ddlvaluationsource").getrawvalue(); var isincuded = ''; var includeflags = ''; if (source == undefined || source == null) source = ''; global.getcomponent("ddlvehic...

decimal - Binary to standard digit? -

i'm going make a computer in minecraft . understand how build computer can make binary operations want outputs displayed standard integer numbers. how "convert" binaries standard digits? there chart that? , digits shown in old calculators; 7 lines. -- | | -- | | -- in electronics, need called "binary binary coded decimal" converter. "binary coded decimal" set of bits needed produce number on 7 segment display. here's pdf describing how 1 of these chips works. page 3 of pdf shows truth table needed conversion picture of of nand gates implement in hardware. can use truth table build set of boolean expressions needed in program.

Changing KML Placemark icons on click in Google Maps API V3 -

i trying change kml placemark icons of kml overlay in sample maps application working on. here's sample code - function seekml() { var mylatlng = new google.maps.latlng(40.65, -73.95); var myoptions = { zoom: 14, maptypecontrol: true, center: mylatlng, maptypecontroloptions: { style: google.maps.maptypecontrolstyle.dropdown_menu, position: google.maps.controlposition.top_right }, navigationcontrol: true, navigationcontroloptions: { style: google.maps.navigationcontrolstyle.small }, maptypeid: google.maps.maptypeid.roadmap }; url_end = "?nocache=" + (new date()).valueof(); //for no kml caching mykml = "http://kmlscribe.googlepages.com/samplesinmaps.kml" + url_end gmap = new google.maps.map(document.getelementbyid("map"), myoptions); var ctalayer = new google.maps.kmllayer(mykml,{suppressinfowindows: true}); ctalayer.setmap(gmap); google.maps.event.addlistener(ctalayer, 'click',...

Find sitecore items with a specific OMS profile? -

i have find items in sitecore (or rather, in contents) have oms (marketing suite) profile checked in "tracking" attribute. tracking attribute appears stored xml , has raw value like <tracking> <profile name="widdly scuds"><!-- irrelevant keys... --></profile> </tracking> and need fetch, example, items "widdly scuds" profile. the first solution thought of fast query on tracking attribute. sitecore query or xml have crawl entire contents each time, probably unacceptably slow, i'll try if there no alternatives. this first fast query tried: fast://*[@tracking = '%widdly scuds%'] but returns 0 results. tried this: fast://*[@tracking = '<tra%'] and (which match names of many of profiles: fast://*[@tracking = '%a%'] and returns 0 results. i'm not how tracking stored or queried, appears unusual since can't results means. the query needs fast enough run few dozen times...

silverlight 4.0 - MEF Silently Stops Finding Exports in Deployment Catalog? -

when deployment catalog contains system.windows.controls.layout.toolkit.dll mef 'breaks'... i'm doing adding reference file in project , following diagnostics code writes nothing vs output window: this.compositioncontainer.exportschanged += (s, args) => { var o = args.addedexports; o.tolist().foreach(export => system.diagnostics.debug .writeline("mef export: " + export.tostring())); }; ...when reference removed exportschanged event fires. problem "special" problem or can else on earth reproduce problem? make sure subscribing downloadcompleted event of deploymentcatalog. in event handler, check error property of eventargs, , tell problem is.

How to create an XML text node with an empty string value (in Java) -

i using transform object save xml file seems drop empty text nodes. there way create (and keep) text node empty string i.e. "". here how create node: element type = doc.createelement("type"); type.appendchild(doc.createtextnode(value)); it value empty string "". when @ xml text editor see <type /> instead of <type></type> after read xml file in , traverse nodes <type> element doesn't have children though explicitly created 1 #text node it! edit - happy thanksgiving (for fellow canadians) important note, not working known set of tags, rather program working on uses presence of text node assign jtextfield gui. field left empty (not null ""). when store field , read gui doesn't render jtextfield anymore because there no text node. looking @ ways create xml document creates text node if there nothing in it. if can't done xml have use attribute mark tags editable (somewhat andrey bre...

windows - Block MsgBox From External Application Using VB.Net -

is there way intercept msgbox() external application , block using vb.net? for discussion, let's msgbox title "sql application" , message "sql error - try again". i have found examples of looking msgbox pop-up (by watching window title) , sending key(s) press ok, curious if whole process avoided. otherwise, user still sees msgbox or "flash", if it's temporary. is possible avoid this? well, detours (see http://research.microsoft.com/en-us/projects/detours/ ), , write detour messagebox load process, there several issues: 1) it's 32 bit only, unless pay pro version 2) development effort involved may non-trivial, esp if dont have lot of inhouse c/c++ experience. suppose write managed wrapper detours, sounds kind of involved too. 3) cant use commercially without pro version. is app you've inherited?

WPF Image Command Binding -

i'm putting wpf application in have image control want bind custom command object view model execute when image clicked. have exposed command object view model , need bind image control. is possible bind command object image control? if advice appreciated. you need put image in button, , bind button command: <button command="{binding mycommand}"> <image source="myimage.png" /> </button> if don't want standard button chrome, change template of button that: <controltemplate x:key="tplflatbutton" targettype="{x:type button}"> <border width="{templatebinding width}" height="{templatebinding height}" background="{templatebinding background}" borderbrush="{templatebinding borderbrush}" borderthickness="{templatebinding borderthickness}"> <contentpresenter horizontalalignment=...

Lightweight asp.net membership provider alternative -

looking light weight alternative membership provider. such thing exist? it should allow creation , modification of accounts, nothing fancy. password reset nice. great if didn't require database used object database (couchdb, db40 etc). wrote, simple , light weight version of membership provider. i highly recommend artem xml providers . a full provider stack xml backing store. perfect small sites few users demo apps.

How to execute another NSIS installer and wait for it to finish? -

i'm writing installer in nsis, kind of wrapper installer, created nsis. the inner installer not mine. it's created bioware installer 1.03 (nsis 2.34). may broken somehow, can't modify it! installer modifies registry values (otherwise "inner" installer won't run), executes installer, overwrites files , restores previous registry values. my problem: have no idea how wait "inner" installer finish! it's because installer first unpacks it's content , creates new process, real installer. , code executes first process (unpacking) finishes. waiting crucial here, because need overwrite files. i have read this: http://nsis.sourceforge.net/when_i_use_execwait,_it_doesn't_wait , can't find switches nsis installer. i have tried execwait , nsexec::exec, none of them waits real installer, first process finish. first off, have never seen execwait fail, wait child process, not child of child process. every process in chain needs wa...

ajax - Inserting html with jquery doesn't work -

i'm building simple shoutbox. here's html : <div id="shoutbox"> <form method="post" id="form" class="shoutbox-form"> <table> <tr> <td><label>user</label></td> <td><input class="text user" id="nick" type="text" maxlength="25" /></td> </tr> <tr> <td><label>message</label></td> <td><input class="text" id="shout" type="text" maxlength="255" /></td> </tr> <tr> <td></td> <td><input id="send-shout" type="submit" value="dodaj!" /></td> </tr> </table> </form> ...

javascript - accessing variable in parent page from iframe -

i have page iframe contains html page. want access javascript variable in parent page within iframe. name of variable in main page observer . i have tried this parent.observer = 'aadasds'; but getting following error: permission denied property window.observer . exchanging values between iframes (and parent) allowed if both sites come same domain. if do, example should work. if don't, browsers inhibit communication. however there number of hacks circumvent this: e.g yahoo.crossframe library described in julien le comte's blog using third iframe enable 1 way communication, or "resize iframe around iframe"-idea described in adam fortuna's blog enabling 2 way communication. edit (as people still seem read old answer): in modern browsers can use postmessage exchange data between iframes. there many javascript libraries try emulate functionality in older browsers, too. e.g. mis-using location.hash, jquery-postmessage-plugi...

windows - VBA get list of available languages on current machine -

i have muulti-language access application needs access languages/keyboard layouts installed on machine. have fields accept input in various languages. able change active language/keyboard layout when these fields entered , exited. i'm sure there sort of windows api haven't been able turn up. happy code examples, links or me pointed in right direction. you can change active keyboard layout using keyboard input functions . functions should @ are: loadkeyboardlayout activatekeyboardlayout unloadkeyboardlayout getkeyboardlayout getkeyboardlayoutname getkeyboardlayoutlist you can find list of locale ids on msdn or download here . can installed locales using enumsystemlocales function. can't vouch quality of code, here examples of using these functions: http://vbnet.mvps.org/index.html?code/locale/enumsystemlocales.htm http://www.vbforums.com/showthread.php?t=22694 http://www.ex-designz.net/apidetail.asp?api_id=499 http://www.xtremevbtalk.com...

browser - Blender vs. Unity -

i want make 3d game, preferably can played in browser. people blender, unity. pros , cons of each? 1 prefer? why? also, have suggestions tutorials? blender , unity not same thing, unity game engine, means purpose create games, , can program in using c# or javascript. cannot make 3d models in it. while blender program modeling mainly, can create applications or games in not program's main purpose. for unity can create 3d model/animations, , import them not sure if compatible blender but, compatible maya. i recommend more unity making game, because has web support, requieres install plugin. in unity website can find documentation , examples started. i hope helps.

rest - JAX RS Jersey Schema Validation -

how configure schema validation jax-rs restful services? we using xsd define models, , jaxb generate java models. this how it's done automatically in rexsl : xslresolver#addxsdvalidatortomarshaller() (pay attention highlighted method). in nutshell, need use setschema() of jaxb marshaller .

java - Non-Extended Classes in android -

i have class scores.java need know whats correct way create these. "the constructor scores not defined. have extend off in android?? package com.threeuglymen.android.stuff; import android.app.application; import android.app.service; import android.content.context; import android.content.intent; import android.content.sharedpreferences; import android.content.sharedpreferences.editor; import android.preference.preferencemanager; import android.util.log; public class scores { private context mycontext; public scores (context context) { // todo auto-generated method stub this.mycontext = context; } public void resetscores(){ try { sharedpreferences pref = preferencemanager.getdefaultsharedpreferences(mycontext); editor edit = pref.edit(); edit.putint("correct", 0); edit.putint("incorrect", 0); edit.commit(); } catch (exception e) { log.d("scores...

php - Mysql select list of items (repeat until certain amount) -

i have following structure: table: products id, name, sort_order let's have 5 products, want 20. how loop through 20 results? additionally, i'll need start @ specific sort_order. let's have 1,2,3,4,5 and want 20 results , start @ 3. should end as: 3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,etc. any ideas? i'm totally lost.. thank you! $how_many = 20; $counter = 0; $rows = array(); $result = mysql_query("your query"); while($row == mysql_fetch_row($result)) { $rows[] = $row; } $expanded = array(); for($i = 0; $counter < $how_many; $counter++) { $expanded[] = $rows[$i]; $i++; if($i == count($rows)) { $i = 0; } } and $expanded filled 5 rows 4 times. edit: , don't forget adjust $i start element. example mean $i = 2 (third element).

java - Missing libraries in JNI2OpenCV? -

i'm newb when comes jni2opencv. has errors regarding java.library.path. i've read thread opencv jni how make work? seems different case mine. here's errors get: exception in thread "main" java.lang.unsatisfiedlinkerror: c:\jni2opencv.dll: can't find dependent libraries @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary0(classloader.java:1803) @ java.lang.classloader.loadlibrary(classloader.java:1728) @ java.lang.runtime.loadlibrary0(runtime.java:823) @ java.lang.system.loadlibrary(system.java:1028) @ jni2opencv.jniopencv.(facedetection.java:6) @ jni2opencv.facedetection.(facedetection.java:16) @ jni2opencv.main.main(main.java:18) i've copied dlls specific libraries , still errors. tried dependency walker, didn't have slightest clue on told me. help? thank you! :) check have install microsoft c++ 2010 redistri...

Keep git history when splitting a file -

i want take function out of 1 file , put another, keep blame history. cp a.php b.php vim b.php # delete 1 function vim a.php # delete 1 function git add a.php b.php git commit but if run git blame b.php see blaming new commit. perhaps previous question informative: how git track source code moved between files? to paraphrase accepted answer: essentially, git doesn't "store" moved code; when generating things blames moved code, that's done ex post facto examining state of entire repository commit commit.

svn - Missing import function SCM in Xcode? -

i've followed link: how set scm in xcode? when opening window import repository have repository bar , no import features. i have run command line 'svnadmin verify [my svn directory]' seeing green light in configure repository window should reinstall scm somehow? thanks is possible somehow toolbar in repositories window lost entries? can provide screenshot? or referring window have configure repository? 1 + , - buttons below repo-sidebar? have configure repository first, pressing plus button...

java - How does a synchronized statement work in this case? -

assume have class this: public class server { public static void main(string[] args) { map<integer, serverthread> registry = collections.synchronizedmap(new linkedhashmap<integer, serverthread>()); ... while(true) { socket socket = serversocket.accept(); serverthread serverthread = new serverthread(id, registry); registry.put(id, serverthread); } } } then: public class serverthread extends thread { private map<integer, serverthread> registry; private int id; public serverthread(int id, map<integer, serverthread> registry) { this.id = id; this.registry = registry; } ... private void notify() { synchronized(registry) { for(serverthread serverthread : registry.values()) { serverthread.callsomepublicmethodonthread(); } } } } i want make sure registry doesn't modified while iterating on it. making synchroni...

Global temporary tables in SQL Server -

i have ##table can accessed across sessions getting error there object named '##table' in database. why , how resolve it. found interesting reference here : global temporary tables operate local temporary tables; created in tempdb , cause less locking , logging permanent tables. however, visible sessions, until creating session goes out of scope (and global ##temp table no longer being referenced other sessions). if 2 different sessions try above code, if first still active, second receive following: server: msg 2714, level 16, state 6, line 1 there object named '##people' in database. i have yet see valid justification use of global ##temp table. if data needs persist multiple users, makes more sense, @ least me, use permanent table. can make global ##temp table more permanent creating in autostart procedure, still fail see how advantageous on permanent table. permanent table, can deny permissions; cannot deny users ...

android - How to listen to a closed activity from a widget? (onActivityResult is only in Activity) -

i have widget launches activity, when activity finishes using finish() don't know how widget can know since can't override onactivityresult() seems way listen when activity closes... anyone know of way listen when activity closes when widget launches activity? in case helps, here code i'm using in widget launch activity @override public void onupdate(context context, appwidgetmanager appwidgetmanager, int[] appwidgetids) { intent = new intent(context, choosecontact.class); pendingintent pendingintent = pendingintent.getactivity(context,0,i,0); remoteviews updateviews = new remoteviews(context.getpackagename(), r.layout.main); updateviews.setonclickpendingintent(r.id.button, pendingintent); appwidgetmanager.updateappwidget(appwidgetids, updateviews); // not necessary, habit super.onupdate(context, appwidgetmanager, appwidgetids); } as said, it's better activity update widget. can override onstop method of activity, , send intent w...

c++ const member function that returns a const pointer.. But what type of const is the returned pointer? -

i apologize if has been asked, how create member function in c++ returns pointer in following scenerios: 1. returned pointer constant, junk inside can modified. 2. junk inside constant returned pointer can modified. 3. neither junk, nor pointer can modified. is so: int *const func() const const int* func() const const int * const func() const all of tutorials i've read don't cover distinction. side note: if method declared const tutorials i'm stating won't modify parameters.. not clear enough me in case when parameter pointer. parameters need like: a. void func(const int* const x) const; b. void func(const int* x) const; c. void func(const int* const x) const; i don't know book have read, if mark method const means this of type const myclass* instead of myclass* , in turn means cannot change nonstatic data members not declared mutable , nor can call non-const methods on this . now return value. 1 . int * const func () const the f...

rest - Give me a example of non-RESTful design? -

i learned term "restful" rails developer. after reading wikipedia, here , here . i don't it. seems me, rails using concise way describe urls. seems me every uri restful, in it's designed scope . for example, think get /delete?student_id=3 restful in scope the application itself . can tell me constrict violate? please refer constrict rest definition . a get request should idempotent , request should not leave side-effects on server. quoting http spec sec 9.1.1 : in particular, convention has been established get , head methods should not have significance of taking action other retrieval. these methods ought considered "safe". allows user agents represent other methods, such post , put , delete , in special way, user made aware of fact possibly unsafe action being requested. therefore get /delete?student_id=3 violates idempotency assumption of get verb, since delete record on server. a restful interface uniform interface...

mysql - SQL generalization/specialization, data redundancy -

i have 3 tables: actions, messages, likes. defines inheritance, messages , likes actions' childs (specialization). message , both have column userid , createdat. should of course moved parrent table action , removed message , likes. there's 1 case when need select both messages , likes database, in other cases select 1 of them, either messages or likes. is ok duplicate userid , createdat in child , parrent table? costs disk space saves 1 join - have join messages, likes actions everytime needed userid , createdat. whatsmore need change current code... what suggest? in opinion case of premature optimization (or premature denormalization, if prefer). you're guessing join overhead cause significant problems, you're guessing duplicating userid , createdat columns in dependent tables improve performance significantly. i suggest should not duplicate columns until know there's real problem. keep few observations on performance optimization tacked o...

java - XML Catalog Resolving / resolver.jar vs com.sun.org.apache.xml.internal.resolver -

dear forum, difference between jdk contained import com.sun.org.apache.xml.internal.resolver.catalogmanager; and 1 contained in apache xerces project import org.apache.xml.resolver.tools.catalogresolver; are there benefits of using latter simple catalog resolving? read on wikipedia seems clear me there no benefit in using latter: org.apache.xml.resolver.tools.catalogresolver used resolve external entities locally-cached instances. resolver originates apache xerces included sun java runtime. anyway xml related projects qizx supply seperate resolver.jar. help. michael the com.sun.org.apache.xml packages copies of apache projects have been "internalised" jre. you'll find done many of apache xml projects, including xerces , xalan. in 99% of cases, internal 1 fine. reason use org.apache versions if need latest version, bugfix.

c++ - How Can I pass message from DLL to Application -

i have atlcom shell extension adds right click extension windows explorer. how can pass message dll mfc application. to sumarize, want pass message dll mfc application. you can use windows api sendmessage or postmessage .

multithreading - how do i send a custom message to a windows service? -

i have implemented windows xp service application starts couple of working threads. 1 of threads need send custom messages service. how do that? one option use omnithreadlibrary (read this blog post example).

Issues with Images on HTML Emails -

Image
i'm having difficulty building html email. have converted entire email 8 row table in below order: header (image) date field content field content base (rounded bottom image) footer top (rounded top image) footer footer base (rounded bottom image) as can see, 4 of these fields have image in them. i've been strict layout of table, making 550px wide, images 550px wide , use border-collapse on table remove appearence of field edges. the problem i'm having fields without images in them stick out couple of pixels, i'm using rounded bottoms , tops kinda ruins layout. simple can't fathom why it's doing this. the images added per <img> tag , think happening it's putting spacing between edge of field , image , rest of table dependent on width of largest 1 it's pushing others out couple of pixels. struggling find solution this, i've tried lots of different things such minus margins on images , tables. can offer solutions this? the ...

css - How can I add border radius and drop shadow for IE8? -

is there anyway ie8? -moz-box-shadow: 0px 0px 14px #585858; /* ff3.5+ */ -webkit-box-shadow: 0px 0px 14px #585858; /* saf3.0+, chrome */ box-shadow: 0px 0px 14px #585858; /* opera 10.5, ie 9 */ -moz-border-radius: 6px; border-radius: 6px; you can css3pie . adds rounded corners, drop-shadow , gradient background support ie. hope helps !

selector - jQuery - How to match an element has attribute a or attribute b -

how write jquery selector match element has attribute or attribute b. must match 3 elements below <a a="123" b="345"></a> <a a="123"></a> <a b="345"></a> you can use multiple selector ( , ) attribute-equals selector (or other selectors), example: $("a[a=123], a[b=345]") you can test out here .

.net - Linq to SQL Performance -

succinct how performance tune linq sql dal methods? amount of data being transferred. verbose i have winform app uses linq sql access it's data. have 5 branches, 1 physically @ same location sql server , other 4 @ various distances , bandwidths. app typical enterprise lob crud app. search person, select them, , select control, demographics, loads person's demographics , displays them on screen. i store "key stone" id's , make db calls using primary keys. works great in main location, sql server on site. however, branches experiencing severe delay loading of controls. this typical example( loading person details user control ) of dal: public static datatable getgeneralpersoninfo(int personid) { using (var context = connectdatacontext.create()) { var generalpersoninfo = person in context.tblpersons person.personid == personid join address...

How to create user accounts in MongoDB? -

i wonder what's 'correct' way create user accounts in mongodb , actions register/login. have create specific collection users (username,email,password) or mongodb has built in users? if have create users collection manually, how deal password encryption? thanks. you'll have create , manage collection of users manually. as encrypting passwords, common approach hash passwords using suitable hash-function before store them in db. later, when user tries login use same hash-function on string entered in password field , compare result password entry in db. way never store actual passwords , if hacks won't users passwords, hashes. for security (against dictionary attacks) should salt hashed passwords. read here

python - Django - 404 page displayed for dev web server (http://127.0.0.1:8000/) -

i familiarizing myself django. i have installed , tested demo site. want switch on admin module, see happens. the steps took (granted, unnecessary, wanted make sure starting clean slate): edited mysite/settings.py enable admin edited mysite/url.py enable admin dropped , recreated backend db run ./manage.py syncdb (and responded correctly prompts) started dev web server (./manange.py runserver) here mysite/settings.py file looks (relevant section only) installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', # uncomment next line enable admin: 'django.contrib.admin', # next lines models 'mysite.foo', 'mysite.foobar', ) here mysite/urls.py file looks like: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # example: # (r...

c# - Error : No credentials found by which to authorize the user Missing authentication credentials -

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