Posts

Showing posts from August, 2013

jquery - Tympanus Elastislide Carousel autoplay -

i using tympanus elastislide carousel responsive jquery plugin website. plugin works on site. but, want casousel play automacily. but, don't find code move carousel automatically. the slider plugin link: http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/ the java script using <script type="text/javascript"> $( '#carousel' ).elastislide( { // orientation 'horizontal' || 'vertical' orientation : 'horizontal', // sliding speed speed : 500, // sliding easing easing : 'ease-in-out', // minimum number of items show. // when resize window, make sure minitems shown // (unless of course minitems higher total number of elements) minitems : 3, // index of current item (left item of carousel) start : 0, // click item callback onclick : function( el, position, evt ) { return false; }, onready : function() { return true; }, onbeforesl

css - Change multiple background-images with jQuery -

in css page, have code: header { background:url('afbeeldingen/r.png'),url('afbeeldingen/black.jpg'); background-position: 50% 33%, left top; background-repeat: no-repeat, no-repeat; background-size:26%,960px 130px; margin-left:auto; margin-right:auto; } now in html page, want use jquery change first image when hover navigation bar. can please me? use class header navigation button wherever want work .header { background:url('afbeeldingen/r.png'),url('afbeeldingen/black.jpg'); background-position: 50% 33%, left top; background-repeat: no-repeat, no-repeat; background-size:26%,960px 130px; margin-left:auto; margin-right:auto; } <script> $(".header").hover(function(){ $(this).css("background","url('afbeeldingen/black.jpg'),url('afbeeldingen/anotherhoverimage.jpg')"); }); $(".header").mouseout(function(){ $(this).css(&quo

python - how can I change feature of thread after it is started? -

i have 1 thread have change parameters before have start it. but, while running, have changed 1 variable of not reflect changes. so, how can change feature of thread after started ? have did like cons = con() # con thread class cons.inter = inter cons.start() after start if change cons.inter, change not reflected. how solve ? if "features" mean user-defined attributes of thread object (as opposed thread -class-level-defined attributes, such daemon attribute), can it, , will reflected.

Jetty Websockets can't connect to server -

so have correctly setup jetty (eclipse based) server listening on 8080. (i put little hello world html test). if go to http://localhost:8080/index.html my html displayed. now have followed tutorial, work websockets. https://gist.github.com/manzke/1021982 the web.xml configured follow: <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>tailor</display-name> <servlet> <servlet-name>websocket</servlet-name> <servlet-class>org.sample.websocket.chatwebsocketservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>websocket

how to see preview of xml in Android Studio -

Image
i installed android studio , when open xml file cant preview or see pallete if go view-tool windows - palette wont show again. want see preview of xml file in eclipse the issue looking @ xml file located in project location: build/res/all/debug you need view in location: src/main/res/layout

Android button images radius -

hi have button in app , set button style shape when use images android:src="@drawable/button_background" /> i have problem radius http://i39.tinypic.com/33vm3gh.png my shep file <item android:state_pressed="false"> <layer-list> <item> <bitmap android:src="@drawable/button_background" /> </item> <item> <shape> <gradien android:angle="90" /> <solid android:color="#eeeeee" /> <corners android:toprightradius="0dip" android:topleftradius="0dip" android:bottomleftradius="5dip" a

android - Unable to receive response from the servlet -

i need retrieve control jsp response request fired earlier. problem facing not able response in jsp. i have gone through few post , tried few suggestion none seems work me. please, point out mistake. below try: protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { log.info("in form doget"); request.setcharacterencoding("utf-8"); string selectedclass = request.getparameter("key"); log.info(selectedclass); string[] section = null; dbhandler dbhandler = new dbhandler(); dbhandler.makeconnection(); if (true == dbhandler.verifyconnection()) { section = dbhandler.getsection(selectedclass); } (string str : section) { log.info(str); } logger log; if (null != section) { request.setattribute(appconstants.section, section); }

How to avoid autoselect when textbox has focus in windows phone sdk 7.1? -

let's have textbox number 123.456 (inputscope="number") when gets focus, after tapped it, 456 autoselected. i can't see property cancel this. there hidden way ? you deselect whenever selection made handling selectionchanged event. example private void mytextbox_selectionchanged(object sender, routedeventargs e) { //get position user clicked int start = mytextbox.selectionstart; //detach event handler it's not fired when clear selection mytextbox.selectionchanged -= mytextbox_selectionchanged; //clear selection keep cursor in place would've been mytextbox.select(start, 0); //reattach handler mytextbox.selectionchanged += mytextbox_selectionchanged; } this should prevent text being selected. actual position user tapped within textbox, can handle tap event , use getposition() method of gestureeventargs parameter passed.

PHP/jQuery Contact Form Not Sending -

i have contact form validated using jquery. the issues jquery solved in question. however, can not form work when take out validation , have standalone php file html form , php send it. there no error. page goes blank page after pressing submit , not message in code. here code - have feeling simple!: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php if (isset($_post['submit'])){ } else { ?> <meta charset="utf-8" /> <link href='http://fonts.googleapis.com/css?family=pt+sans+narrow' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=droid+sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="**removed**/style.css"> <script type="text/javascript"> jquery.noconflict(); jquery(document).ready(function($) { function isint(n) { return typeof n =

Can I use a .net 4.0 dll assembly reference in a .net 3.5 sharepoint web part? -

i using dll's crm 2011 sdk in .net 3.5 web part.the target sharepoint 2010 online. when try build gives me following error: the primary reference "microsoft.xrm.client" not resolved because built against ".netframework,version=v4.0" framework. this higher version targeted framework " .netframework,version=v3.5 ". visualwebpartprojectwebservicetest. i cannot upgrade web part .net 4.0 because sharepoint 2010 not supporting .net 4.0. there other solution reference .net 4.0 dlls in .net 3.5 sharepoint webpart? i no , can't use .net framework 4.0 dll in 3.5 yes in other way around. there few workarounds achieve this, in little different way. check these following posts further reference: can use .net 4.0 dll in 3.5 project? how can use .net 4.0 code in c# project built using .net framework 3.5? making call .net 4 library 3.5

First install of Adobe CQ 5.5 product with Oracle 11.2 XE -

i'm configuring adobe cq 5.5 first installation , have problems because in installation process, cq didn't found oracle driver. need use relational database (oracle) rather tar predefined system. in adobe cq documentation, says need configured before installation. but problem when cq installs, didn't found driver of oracle database. i have configured file repository.xml as: ... ... <persistencemanager class="org.apache.jackrabbit.core.persistence.pool.oraclepersistencemanager"> <param name="driver" value="oracle.jdbc.oracledriver" /> <param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:xe" /> <param name="user" value="crx" /> <param name="password" value="admin" /> <param name="schema" value="oracle" /> <param name="schemaobjectprefix" value=&q

Google analytics 2 not working in Android -

i have android project /supports versions api8/. admob , analytics work fine until decided migrate analytics version 2/beta5/ , admob 6.4.1. see in logcat analytics code not sending analytics site. @ first looked solutions posted in stackoverflow, problems remains. finally created new project. in project same original - target api, min api, admob sdk version, analytics sdk version. same code banners , analytics. test project works fine. tried clear , rebuild lot of times - nothing. in project different. try copy whole code in project, not solution, because if happens again - whole procedure have repeated. please help! problem id because of intervals in strings sendview , sendevent. didn't see recommendation in avoid spaces!

objective c - Popover resigning first responder for touch events to view controller that called the popover -

i have popover should disappear when user touches uiimageview in it. create uiimageview user drags original viewcontroller. i'm pretty sure has first responder. how make touchesbegan, touchesmoved, , touchesended directly called original viewcontroller? this have far: initializing popover: popovercreatenewboardviewcontroller *content = [popovercreatenewboardviewcontroller new]; content.delegate = self; showpiecespopover = [[uipopovercontroller alloc] initwithcontentviewcontroller:content]; showpiecespopover.popovercontentsize = cgsizemake(150.0, 500.0); showpiecespopover.delegate = self; popover.m -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { uitouch *objecttouched = [touches anyobject]; if ([objecttouched.view iskindofclass:[uiimageview class]]) { uiimageview *imageviewtouched = (uiimageview*)objecttouched.view; [delegate pieceselectedtype:imageviewtouched.tag color:piecescolor]; [self resignfirstres

c++ - How to get a set of words with spaces as one input in C? -

in program created need customer information array. below codes regarding question. struct customertype { string fname; string lname; char gender; string address; string contactno; }; customertype customer[1000]; i have following code input user. here i index of customer i'm getting information about. string add=""; cout<<left<<"\n"<<setw(29)<<"\t\t name"<<": "; cin>>customer[i].fname>>customer[i].lname; cout<<left<<"\n"<<setw(29)<<"\t\t gender"<<": "; cin>>customer[i].gender; cout<<left<<"\n"<<setw(29)<<"\t\t address"<<": "; getline(cin,add); customer[i].address=add; cout<<left<<"\n"<<setw(29)<<"\t\t contact no."<<": "; cin>>customer[i].contactno; but when run pr

node.js - Nodejs asset management -

evaluating nodejs , trying see if fit our needs. coming rails world, have few unanswered questions despite searching long time. whats best way manage assets nodejs (expressjs)? in rails, static assets a) fingerprinted caching forever b) js , css minified 3) scss compiled down css whats best way handled uploaded images users such avatars? does grunt minifying , gzipping html/css/javascript? how can avoid mutliple http requests server node. don't want make multiple http requests every javascript asset need. rails helps here combining js , css files. also, mongodb preferred solution projects? hear lot of bad things mongodb , things it. having difficult time deciding if mongo can more reads writes 400-500 gb data in long run. any or pointers? taking time point me right places. for each of point mentioned give few module examples might fit need. remember @ every point there more modules serving same purpose: node-static (as static file server), node-uglify (f

c++ - Pointers to automatically null when object is deleted -

say have object , 10 pointers in several other objects of varying class types. if object gets deleted, pointers have set null. interconnect object's class classes have pointers can notify them being deleted, , can set pointers null. has burden classes must notify object when deleted since object need pointer them well. way object doesn't call dereference dangling pointer when destructs , attempts notify others. i don't confusing web of crap , i'm looking better method. please note auto pointers , shared pointers not i'm looking - auto pointers delete object when destruct, , shared pointers same when no more shared pointers pointing it. i'm looking slick method setting pointers object null when object destructs. "all problems in computer science can solved level of indirection" -- david wheeler in case, work is std::shared_ptr<object*> pp. when delete object, set shared object* null (e.g. *pp = 0; ). other users shari

asp.net mvc - MVC 4 - RoleProvider to manage authenticated users permissions with different scopes -

here problem mvc 4 internet project using forms authentication. lets have hotels , want authorized users accessing each under different roles. so user logs in. dropdownlist selects target hotel , application´s security responds accordingly. i need [authorize(roles = "administrator")] in hotel scope. my first aproach inheriting authorizeattribute , override authorizecore shown in thread from there httpcontext.session["hotelid"] , query userrolesinhotel table. said, should have own roles table structure similiar userid, roleid, hotelid. simpleroleprivider comes short task , forced create customeroleprovider. roleprovider methods don´t handle params need hotelid when adding new role user. for clarification: user logs in user/password ->ok (simplemembershipprovider) authenticated user selects hotel 1 -> user "administrator" hotel 1. authenticated user change hotel 2 -> user "user" in hotel 2 i can have number of hotels

objective c - Redefinition error when pulling GitHub -

i've been using github while source control on singular developer project trying set across multiple machines. seems pushed correctly when clone other mac , try run have ton of redefinition errors. ex) "redefinition of enumerator", "property has previous declaration" , on. has had experience issue , can fix it. used simple git clone on target machine retrieve it. it ios project in objective c. this has nothing github. may git. it's possible did 'git pull' , had merge problem. if run "git status", items red? if so, in files lines "<<<<<" , ">>>>>". lines telling merge conflict. need fix conflict , delete lines, git add file , commit + push file github. alternately, can git checkout <file> throw away changes. (and maybe git merge --abort )

php - PHPSpec loads file but not directory -

this commands works (specify file): ./vendor/bin/phpspec.php spec/model/entity/describecustomer.php -f d -c --bootstrap module/application/tests/bootstrap.php but using directory not: ./vendor/bin/phpspec.php spec/ -f d -c --bootstrap module/application/tests/bootstrap.php composer file "require-dev": { "phpspec/phpspec": "*" } version ./vendor/bin/phpspec.php --version 1.4.2

javascript - jQuery - Scrolling to a location calculated by a var -

this question has answer here: animate scroll id on page load 5 answers i have following script: $('.how-we-do-it .items div').on('click', function () { var $matchingdiv = $('.how-we-do-it .sections .section .content div.' + $(this).attr('class')); $matchingdiv.toggle('fast'); }); i have been trying add in additional code page automatically scrolls down $matchingdiv gets toggled. i have been trying use scrolltop , smooth scroll plugin accomplish this, cannot work $matchingdiv output. what easiest way accomplish this? try animating scrolltop property of html , body : $("html, body").animate({ scrolltop: $matchingdiv.offset().top }, delay);

php - create dynamic link from Mysql table -

im trying create dynamic links post inside database table, cant figure out how create link, when user logged in. i think this. <?php $articles = new articles(); foreach($articles->fetch_user_article($_get['uid']) $article) :?> <a href="edit_articles.php?uid=<?php echo $_session['id']?>&article=<?php echo $article['id'];?>"><?php echo $article['title'];?></a> <?php endforeach ?> this gives me link looks this edit_articles.php?uid=5&article=213 the article id:s correct db table. now edit_articles.php file $articles = new articles(); $article = $articles->fetch_user_article($_get['uid']); echo $article['text']; but when im reach edit_articles.php file undefined index: text and function function fetch_user_article($uid){ $uid = (int)$uid; $query = $this->link->query ("select id, title,text blog user_id = '{$

knockout.js - knockoutjs - javascript array to observableArray to template - how to? -

i have page contains information subscriber, spouse, , n number of dependents. for each one, we're asking name, dob, address, etc. basically, it's same fields on , over. can create model subscriber , spouse. i'll have subscriber, , i'm not worried creating empty spouse node in model, kids, i'm unsure how proceed... my page long page lots of sections hidden until it's time deal section- wizard. each section in current page starts outer div: <div data-bind="with: submodelname"> // i.e. subscriberinfo, spouseinfo i don't know how proceed n number of children. i can stuff entire <div><form></form><div> section <script> tag , make template, how bind different model each item? i.e. how simulate "with:" part? my current model set have large wrapping model i'm creating many submodels (4 + 1 each child) , calling single applybindings(): var masterpagemodel = new pageviewmodel(); // p

regex - Find text between key phrases -

i have var have text in: <cfsavecontent variable="foo"> element.password_input= <div class="holder"> <label for="$${input_id}" > $${label_text}</label> <input name="$${input_name}" id="$${input_id}" value="$${input_value}" type="password" /> </div> # end element.password_input element.text_input= <div class="ctrlholder"> <label for="$${element_id}" > $${element_label_text}</label> <input name="$${element_name}" id="$${element_id}" value="$${element_value}" type="text" class="textinput" /> </div> # end element.text_input </cfsavecontent> and trying parse through var of different element type(s) here have far: ar = rematch( "element\.+(.*=)(.*?)*", foo ) but giving me part: element.text_input= element.password_input= any appreciated. your im

vbscript - Extract text between HTML tags -

i have many html files need extract text. if it's on 1 line, can quite if tag wraps around or on multiple lines can't figure how this. here's mean: <section id="mysection"> text here line here <br> last line of text. </section> i'm not concerned <br> text, unless wrap text around. area want begins "mysection" , ended </section> . i'd end this: some text here line here last line of text. i'd prefer vbscript or command line option (sed?) i'm not sure begin. help? normally you'd use internet explorer com object this: root = "c:\base\dir" set ie = createobject("internetexplorer.application") each f in fso.getfolder(root).files ie.navigate "file:///" & f.path while ie.busy : wscript.sleep 100 : wend text = ie.document.getelementbyid("mysection").innertext wscript.echo replace(text, vbnewline, "") next however, <sec

css - Center larger div to smaller div? -

Image
i know how can align 2 divs. first div smaller second 1 , want center second 1 first 1 (like if in photoshop focal point of object gets aligned focal point of other object on 1 level) just quick sketch i hope understand mean :d thanks in advance if you're using display:inline-block (as opposed float:left ), can use vertical-align:middle vertically align 2 elements middle line.

xcode - iOS - Push Segue not working even with NavController -

Image
i'm trying set basic "newsfeed" function ios app, headlines in tableviewcontroller segueing simple viewcontroller display text of selected story. i'm using storyboards set segues, , can't work... what i've done - started ctrl+dragging cell of tableview onto secondary viewcontroller , choosing "selection segue - push." clicked on segue , gave identifier "newsarticlesegue," , embedded tableview in navigation controller. i've got tableview data source hooked plist file well, although don't think have effect on segue, right? all happens when run app , click on row of tableview gets highlighted blue. segue isn't working, tutorials i've found list steps, though that's that's needed... can tell me missing? , thank in advance! when create segue ib, can drag view controller (which did) or from table view cell , call segue if table view cell selected.

Back Button closes the Application in Android -

i have application.suppose there 3 activities a,b,c. a->b(sub-activity)->c(sub-activity). i have set these kind code switch next activity. setcontentview(r.layout.b); and problem when click button on emulator or phone while on activity b or c,closes application window come home. want if press button on activity c firstly move activity b , a,afterwards if i'll click again button comes home-screen or closes application window. any methods or wrong in code or have edit ? you can override default press , tell reset content view have keep track of stack yourself. @override public boolean onkeydown(int keycode, keyevent event) { if (keycode == keyevent.keycode_back) { //code reset view return true; } return super.onkeydown(keycode, event); } this said recommend @ allow android handle stack in default manner. method end causing headaches in future.

ruby on rails - Redirect to previous page wherever it is directed to the login page -

i'm using rails 3.2 , authlogic. have following code: class applicationcontroller < actioncontroller::base private def store_location session[:return_to] = request.url end def redirect_back_or_default(default) redirect_to(session[:return_to] || default) session[:return_to] = nil end end class usersessionscontroller < applicationcontroller before_filter :require_no_user, :only => [:new, :create] before_filter :require_user, :only => :destroy def new @user_session = usersession.new @header_title = "login" end def create @user_session = usersession.new(params[:user_session]) if @user_session.save flash[:success] = "login successful!" redirect_back_or_default root_url else render 'new' end end def destroy current_user_session.destroy flash[:success] = "logout successful!" redirect_back_or_default root_url end end this code quite g

javascript - Facebook Graph API won't return email address -

edit: not duplicate, because: i have permission debugged token code works test user please don't mark duplicate without reading. i'm trying user e-mail address, don't it. on graph api explorer, when hit send, email field becomes grayed , says that: field empty or disallowed access token but when debug token has email permission granted my profile has e-mail address. update: tried https://developers.facebook.com/tools/console/ . profile returns nothing, on computer. same code returns email, name , uid of account. code: <fb:login-button scope="email"> grant permissions make more examples work </fb:login-button> <button onclick="dopost()">post stream</button> <script> function userdata() { fb.api('/me?fields=name,email', log.info.bind('/me callback')); }; fb.getloginstatus(function(response) { if (response.status === 'connected') { userdata(); } }); </

html - Navigation Bar with centered Logo -

i have searched through similar questions found no solutions looking specifically. trying navigation bar around centered logo, number of links on either side of logo. however, if window smaller, links should appear below logo. trying achieve effect of page: http://www.colbowdesign.com/index.html here code far: html <header> <img src="assets/ck-square.png" class="logo"> <ul> <li><a href="#">work</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> <li><a href="#">social</a></li> </ul> </header> css .logo { margin-left: auto; margin-right: auto; display: block; } header li{ display: inline; } header { width: 100% height: auto;

java - ProGuard and HoloEverywhere: Export Signed Application Errors -

i'm using actionbarsherlock , holoeverywhere in project. works perfectly, except when try export signed application, proguard gives me grief: [2013-05-19 00:13:53 - ] proguard returned error code 1. see console [2013-05-19 00:13:53 - ] warning: com.actionbarsherlock.widget.suggestionsadapter: can't find referenced field 'android.content.context mcontext' in class com.actionbarsherlock.widget.suggestionsadapter [2013-05-19 00:13:53 - ] warning: com.actionbarsherlock.widget.suggestionsadapter: can't find referenced method 'android.database.cursor getcursor()' in class com.actionbarsherlock.widget.suggestionsadapter [2013-05-19 00:13:53 - ] warning: com.actionbarsherlock.widget.suggestionsadapter: can't find referenced field 'android.database.cursor mcursor' in class com.actionbarsherlock.widget.suggestionsadapter [2013-05-19 00:13:53 - ] warning: org.holoeverywhere.chooseractivity: can't find referenced method 'android.content.intent

android - Get image width and height before loading them -

i'm using universal image loader library download images internet. is possible images size before loading them set layout prams desired values? something injustdecodebounds property, ideas? quoting documentation @ https://github.com/nostra13/android-universal-image-loader how uil define bitmap size needed exact imageview? searches defined parameters? get actual measured width , height of imageview. get android:layout_width , android:layout_height parameters. get android:maxwidth and/or android:maxheight parameters. get maximum width and/or height parameters configuration (memorycacheextraoptions(int, int) option). get width and/or height of device screen. so try set android:layout_width|android:layout_height or android:maxwidth|android:maxheight parameters imageview if know approximate maximum size of it . correctly compute bitmap size needed view , save memory. you cannot image height , width before image downloaded. can set imageview height , widt

apache - Why is this [L] flag failing to prevent application of the next rewrite rule? -

i thought "l" flag supposed prevent subsequent rules being applied. yet in example: rewriterule foo bar [l] rewriterule bar qux i http://mysite/foo rewritten http://mysite/qux . expected http://mysite/bar . missing here? the behavior of [l] flag quite poorly described in apache docs. in order understand how works first need know how apache handles rewriterules. let's take simple example rewriterule ^something /somethingelse #1 rewriterule ^somewhere /somewhereelse #2 rewriterule ^someplace /anotherplace #3 in situation multiple rules , no [l] flags, if request /something , apache rewrite /somethingelse (as per #1), try rules #2 , #3. after rules processed checks if url came out of rewriterules same url went in. if it's not, apache starts processing rules again, until input===output (or maximum number of redirects met, prevent infinite loops). now, if change rule #1 , add [l] it, , request /something again, apache rewrite /somethingels

C++ - OOP implementation of linked list, I not sure why adding to end is not working for me, please advise -

i refreshing knowledge of c++ oop not sure why can traversal , adding end of list , running. advice on context highly appreciated. #include "stdafx.h" #include "linkedlist.h" linkedlist::linkedlist(void) { } linkedlist::~linkedlist(void) { } void linkedlist::add(node* node) { node* root = this->getroot(); if(root !=null) { //with 2 nodes commented code worked //while(root->getnextnode() != null){} //root->setnextnode(node); //this part culprit node* newnode = root->getnextnode(); while(newnode!=null) { newnode = newnode->getnextnode(); } //i thinking reaching last node using traversal newnode = new node(node->getdata(),node->getnextnode());

html - Have button with custom image and link -

Image
i've looked around internet, none of answers have helped me in way. i'm beginner , wondering how make button (that looks facebook logo) link facebook page once clicked? i've used code below no avail. <input type="button" src="images/facebook.png" width="175" height="60" > </section> </header> this keeps showing me , have no idea why an alternative can be, add link image. <a href="http://example.com"><img src="images/facebook.png" /></a>

c# - Reuse context menu -

i have created context menu (at moment) use items in treeview. have created treeitem class holds relevant information header, icon, children, execute target, etc. looks like: <contextmenu datacontext="{binding placementtarget.datacontext, relativesource={relativesource self}}" visibility="{binding showcontextmenu}" itemssource="{binding contextmenu}"> <contextmenu.itemtemplate> <hierarchicaldatatemplate itemssource="{binding children}"> <textblock text="{binding header}" /> <hierarchicaldatatemplate.itemcontainerstyle> <style targettype="menuitem"> <setter property="command" value="{binding execute}" /> <setter property="icon" value="{staticresource cmicon}" /> <setter property="tooltip"

javascript - openlayers heatmap shows red lines on map -

i got problems using heatmap-openlayers.js, loaded page default points shows heatmap gradient, when dragged image (map) or moved gradient bottom of image found out have red line on map, it's seems replication of gradient's set of points couldn't figure out why it's happening.. i uploaded sample to: http://hightech-library.com/heatmap and added bit css see problem on go, if drag image left red line disappear blocking it, , when dragging reappear.. check out source of page , you'll see sample code. can tell me if i'm doing wrong or how fix it.. i figured out red line were, when drawing heatmap draws points max gradient color offset of 1000 position requested , makes shadow on canvas of these points instead, shadow heatmap see gradient's colors. when drawing on image fixed color offset of 1000 wasn't enough , when dragged map saw source of shadow "red lines".my solution increase offset , push "red lines" outside ca

PHP equivalent of Python's `str.format` method? -

is there equivalent of python str.format in php? in python: "my {} {} cat".format("red", "fat") all see can in php natively naming entries , using str_replace : str_replace(array('{attr1}', '{attr2}'), array('red', 'fat'), 'my {attr1} {attr2} cat') is there other php's native alternatives? sprintf closest thing. it's old-style python string formatting: sprintf("my %s %s cat", "red", "fat")

image processing - Fastest Sobel Edge Detection C# -

i want make program implements sobel edge detection. code : private bitmap sobeledgedetect(bitmap ori) { bitmap b = original; bitmap bb = original; int width = b.width; int height = b.height; int[,] gx = new int[,] { { -1, 0, 1 }, { -2, 0, 2 }, { -1, 0, 1 } }; int[,] gy = new int[,] { { 1, 2, 1 }, { 0, 0, 0 }, { -1, -2, -1 } }; int[,] allpixr = new int[width, height]; int[,] allpixg = new int[width, height]; int[,] allpixb = new int[width, height]; int limit = 128 * 128; (int = 0; < width; i++) { (int j = 0; j < height; j++) { allpixr[i, j] = b.getpixel(i, j).r; allpixg[i, j] = b.getpixel(i, j).g; allpixb[i, j] = b.getpixel(i, j).b; } } int new_rx = 0, new_ry = 0; int new_gx = 0, new_gy = 0; int new_bx = 0, new_by = 0; int rc, gc, bc; (int = 1; &

Update multiple views and multiple clients in ASP.NET MVC (Razor) -

i using asp.net mvc 4 razor viewmodel. want implement signalr knockout. here code working perfectly. i have requirement when task created should display clients, , should display client message on different view. @model taskmanager.models.tasklist @{ viewbag.title = "create"; } <h2>create</h2> @using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true) <fieldset> <legend>tasklist</legend> <div class="editor-label"> @html.labelfor(model => model.taskname) </div> <div class="editor-field"> @html.editorfor(model => model.taskname) @html.validationmessagefor(model => model.taskname) </div> <div class="editor-label"> @html.labelfor(model => model.taskdesc) </div> <div class="editor-field"> @html.textareafor(model => model.taskdesc) @html.

elisp - Ascii graphic interface library (ncurses-like) for emacs scripts? -

is there interface library emacs scripts, allowing draw various gui in emacs buffers? as far know, emacs extensions interface limited key-bindings , dialogues in message buffer. @ same time, can draw in buffer (artist-mode), , can react on user action (keyboard , mouse-clicks) surely possibly, implement such library entirely in elisp. there emacs widget library . has editable fields, buttons, menus, etc - in text mode. instance (widget-create 'editable-field :size 13 :format "name: %v " ; text after field! "my name")

java - print binary file on browser -

i developing project in jsp/servlet. have audio tag in html <audio src=" player.jsp "/> player.jsp needed play custom starting duration 01:24 want player.jsp read file , print html audio can read/play it. i wrote code. not working. response.setheader("content-type","audio/mpeg"); string path1 = "c:\\1.mp3"; file filefilename = new file(path1); inputstream in = new fileinputstream(path1); long length = filefilename.length(); byte[] bytes = new byte[(int) length]; int offset = 0; int numread = 0; while (offset < bytes.length && (numread = in.read(bytes, offset, bytes.length - offset)) >= 0) { offset += numread; } string file = new string(bytes); out.println(file); please me: make code work? how find duration of mp3 file? how start custom duration? the easiest way make audio play custom start time use javascript api: <audio id="player" src="player.jsp" type=&q

c# - Can this be done entirely via linq? -

i have process identity rows in list (unmatchedclient) call separate method delete them (pingtree.removenodes). seems little long winded , acheive same thing merely setting value of property "deleteflag" true. how set value using linq? var unmatchedclient = pingtree.nodes.where(x => _application.loanamount < x.lender.minloanamount || _application.loanamount > x.lender.maxloanamount || _application.loanterm < x.lender.minloanterm || _application.loanterm > x.lender.maxloanterm) .select(x => x.treenode) .tolist(); pingtree.removenodes(unmatchedclient); thanks in advance. like this? pingtree.nodes.where(x => _application.loanamount < x.lender.minloanamount || _application.loanamount > x.lender.maxloanamount || _application.loanterm < x.lender.minloanterm || _application.loanterm > x.lender.maxloanterm) .select(x => x.treenode) .tolist() .foreach(n=>

Is it possible to play music during calls so that the partner can hear it ? Android -

i'm trying make , app call cheater (originally developed symbian os) is possible play music during phone conversation receiver , caller should hear same sound or music? if yes how can implement this? you failed find app because it not possible . the documentation states ( here ): note : can play audio data standard output device. currently, mobile device speaker or bluetooth headset. cannot play sound files in conversation audio during call. the reason behind decision has security: there several scenarios capability used cons. (the op highly similar this , hence i'm giving same answer)

In C how is this parameter declared in the function? -

i trying learn basics of c using the c programming language - brian kernighan , dennis ritchie in program below, don't understand value 'maxlinelength ' comes from? the loop set run while ' i ' smaller maxlinelength-1 , value of maxlinelength , come from? from understand, when parameters declared in function value being passed them, must surely declared somewhere else have value passed in? #include <stdio.h> #define maximumlinelength 1000 #define longline 20 main() { int stringlength; char line[maximumlinelength]; while((stringlength = getlinelength(line, maximumlinelength)) > 0) if(stringlength < longline){ printf("the line under minimum length\n"); } else if (stringlength > longline){ printf("%s", line); } return 0; } int getlinelength(char line[], int maxlinelength){ int i, c; for(i = 0; i< maxlinelength-1 && ((c = getchar())!= eof) && c != '\n'; i+

asp.net mvc 4 - Add/get value from Database MVC4 C# -

i'm creating feature allows user add amount of money 'swiss bank'. balance of swiss bank stored in db ( id and balance ) each user. i'm stuck on how display current balance of user , how add or witdraw amount of money. i'm new on c# and mvc4 appreciated (just push in right direction awesome). controller: using system; using system.collections.generic; using system.data; using system.data.entity; using system.linq; using system.web; using system.web.mvc; using fivegangs.models; namespace fivegangs.controllers { public class bankcontroller : controller { private fgentities db = new fgentities(); // // get: /swissbank/ [httpget] public actionresult index() { var gangster = db.usergangster.firstordefault(g => g.userprofile.username == user.identity.name && g.health > 0); } public actionresult index() { return view(db.swissbank); } } } model: using system; using system.collect