Posts

Showing posts from August, 2010

sharepoint - Custom Web property to refresh a webpart for 60 secs -

i have visual web part in want refresh webpart every 60 secs. can 1 give me example of building custom webpart property . should similar oob webpart ajax options. thanks, sandy something suffice. http://mmman.itgroove.net/2011/05/adding-an-auto-refresh-content-editor-web-part/ you can register javascript on page several ways. personally put in content editor web part , update time , when need. the below code web part property. [webbrowsable(true)] [webdisplayname("message")] [webdescription("message display users")] [personalizable(personalizationscope.user)] [category("message configuration")] public string message { get; set; } you might want in updatepanel control. http://msdn.microsoft.com/en-us/library/bb386454(v=vs.100).aspx hope helps

c++ - Alternative to C++11's std::nextafter and std::nexttoward for C++03? -

as title says, functionality i'm after provided c++11's math libraries find next floating point value towards particular value. aside pulling code out of std library (which may have resort to), alternatives c++03 (using gcc 4.4.6)? platform dependently, assuming ieee754, , modulo endianness, can store data of floating point number in integer, increment one, , retrieve result: float input = 3.15; uint32_t tmp; unsigned char * p = reinterpret_cast<unsigned char *>(&tmp); unsigned char * q = reinterpret_cast<unsigned char *>(&input); p[0] = q[0]; p[1] = q[1]; p[2] = q[2]; p[3] = q[3]; // endianness?! ++tmp; q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; q[3] = p[3]; return input; beware of zeros, nans , infinities, of course.

Git - Merge vs rebase -

i have had @ when use git rebase instead of git merge? i'd sure solution choose in case : want implement new feature on master branch new feature branch. 10 commits on feature while else other commits on master. my question is, if want keep branch apart master testing purposes, need test new master commits integrated. so, should merge master feature (and not feature master apply modifications on master before testing) or rebase ? why not create new branch test merged version? example: git checkout -b test-merged-feature master git merge my-feature [... testing ..] there's no particularly reason rebase here, if haven't pushed feature branch, that'd fine well. these questions partly how want history - people don't seeing lots of merges; prefer way of keeping track of commits contributed particular feature.

java - No data available listview -

i ran problem creating listview in android app. this code: public class mainactivity extends listactivity { private simpleadapter emadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // set layout view setcontentview(r.layout.main_ui_layout); final utility utility = new utility(this); utility.getfiles(); final listview filelistview = (listview) findviewbyid(android.r.id.list); filelistview.setemptyview(findviewbyid(r.id.progressbar)); // create hashmap items final arraylist<hashmap<string, string>> listitems = new arraylist<hashmap<string, string>>(); // using thread simulate download of data thread emthread = new thread(new runnable() { public void run() { // waiting 3s try { thread.sleep(2500); } catch (interruptedexception e) { // todo auto-generated catch block

reporting services - SQL Server Report Builder Page Details Format -

i have report done in ms access 2010 when opened displays data grouped 2 groups (items of type , items of type b). the items of type b exponentially more items of type , when print preview report, have made shows total of items of type b full list of items of type (in vba code of details_format prevented items of type b being displayed). this report has been moved on sql server 2008 reporting services, can same formatting behaviour on access (hiding detail on items of type b)? if you're displaying rows in table , want hide rows of type, set visibility of row like: =iif(fields!type.value = "b", true, false) edit after comment: i see you're accepted answer (thanks!) else might useful globals!renderformat.name report variable. in comment note you're using report builder 3.0 (ssrs 2008r2) possible. see details under render format . you can hide objects based on render format, in case might want show type b rows when exporting pdf, use row v

vb.net - wpf crystalreport viewer dissappear for no reason -

well problem easy explain , hard figure out, @ least me, have tabcontrol 3 tabitem, on 1 of tabitems have wpf reportviewer loads report of data, when change tabs, not matter each 1 when tab crystalreport in it, crystalreport viewer not there anytmore! have button on top refresh report , button still there crystal report control not there anymore! my xaml looks this <usercontrol x:class="uccvrfactuur" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:my="clr-namespace:sapbusinessobjects.wpf.viewer;assembly=sapbusinessobjects.wpf.viewer" mc:ignorable="d" d:designheight="300" d:designwidth="300&qu

html - Css attribute selector for inputs not working in IE8 -

i have following css code working in firefox/chrome not in ie8 input[type='text'] { float: right; width: 170px; } if remove attribute selector, works in ie applies inputs, dont want. input { float: right; width: 170px; } i thought attribute selectors supported in ie8, don't know problem is. not matter of code inside input, moment use attribute selector, css rule not work whatever code inside. edit: css rules input[type="button"] , input[type="submit"] work, input[type="text"] not work. i'm confused right now. ie7 , ie8 support attribute selectors if !doctype specified. attribute selection not supported in ie6 , lower.

java - ArrayList<String> Error -

hi having 1 error bugging me!! what trying split text file use ";" and after store arraylist, error keeps popping up!! package au.edu.canberra.g30813706; import java.io.bufferedreader; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.ioexception; import java.io.inputstreamreader; import java.util.arraylist; import android.app.activity; import android.os.environment; import android.widget.edittext; public class filereader extends activity{{ arraylist<string> sinfo = new arraylist<string>(); string txtname = "accomodationtxt.txt"; file root = environment.getexternalstoragedirectory(); file path = new file(root, "canberratourism/" + txtname); try { bufferedreader br = new bufferedreader ( new inputstreamreader( new fileinputstream(path))); string line; string[] salineelements;

svn - Automating TortoiseSVN and Not to show Log Windows? -

is there parameter automating tortoisesvn , not show log windows? tortoisesvn gui client , not meant used in way. if don't want gui, don't use gui - use command-line client (bundled tortoisesvn 1.7 , newer installers), or use client libraries/language bindings language/scripting environment of choice.

windows - Blocking a log off request with Python -

i have software logs me off automaticly. want block this, won't logged off (windows 7). there way block log off requests using python? if so, how , if not; there other solutions? looks if there's possible solution in msdn article . what you'd have write simple windows application handles wm_queryendsession event, , returns false , then, in theory, long application running, system won't log out. it's possible leaving open instance of notepad.exe unsaved file in achieve same thing. it, might, however, cause other applications terminate, so, if that's undesirable, you'd have intercept call exitwindows softxpand, more complicated. some security products comodo internet security allow run application in sandbox, such can intercept , deny system calls, might work. see also: this question .

Hadoop Mapper Context object -

how run() method of mapper or reducer class called hadoop framework? framework calling run() method, requires 1 context object how hadoop passing object? information resides in object? the run() method called using java run time polymorphism (i.e method overriding). can see line# 569 on link below, extended mapper/reducer instantiated using java reflection apis. maptask class gets name of extended mapper/reducer job configuration object client program have been configured extended mapper/reducer class using job.setmapperclass() the following code taken hadoop source maptask.java mappercontext = contextconstructor.newinstance(mapper, job, gettaskid(), input, output, committer, reporter, split); input.initialize(split, mappercontext); mapper.run(mappercontext); input.close();` the line# 621 example of run time polymorphism. on line, maptask calls run() metho

java - Unexpected result while dividing int by int and storing result into double -

this question has answer here: java program using int , double 7 answers i'm having weird problem. this code divides int int, stores result in double variable , prints it: int = 200; int b = 557; double divisionresult = / b; system.out.println("result: " + divisionresult); after executing code, output is: result: 0 this weird, because 200/557 0.3590664272890485 i noticed if cast a , b double in division line double divisionresult = (double) / (double) b; it works perfectly. why have cast variables double real division result? because in integer division, if answer not perfect integer, digits after decimal point removed (integer division yields integer value). note don't have cast both integers, can cast one, second implicitly converted. why after cast works? because cast has higher precedence / . first cast, di

Python - Creating a command line like interface for loading modules/functions -

in python project i'm trying make interface command prompt can type name of function , executed. example: prompt >>> run.check running function check.... prompt >>> run.get running function in above example when type run.check should run function named check , run.get should run function , on. right have prompt using raw_input , can execute commands using dictionary of function alias' , function names ie, commands = {'exit': sys.exit, 'hello': greet, 'option3': function3, 'option4': function4, } cmd = raw_input("prompt >>> ") commands.get(cmd, invalidfunction)() but lot of functions in programs needs arguments passed not know how method. thing that, main purpose of project modules (.py files) added folder , executed dynamically main python program using command prompt interface , minimum if possible no change main program. i'm not sure of using function exec has drawbacks concerning sec

android - MapView stopped showing the map (signed application) -

my application signed mapview, working perfectly, week google map stopped working (in debug mode runs fine), whenever generate signed application map dont display maps tiles (no error occurs, nothing shown in logcat). being caused fact api 1 obsolete? follow new google map v2 anf key generation process https://developers.google.com/maps/documentation/android/v1/hello-mapview

logging - Log all requests from the python-requests module -

i using python requests . need debug oauth activity, , log requests being performed. information ngrep , unfortunately not possible grep https connections (which needed oauth ) how can activate logging of urls (+ parameters) requests accessing? the underlying urllib3 library logs new connections , urls logging module , not post bodies. get requests should enough: import logging logging.basicconfig(level=logging.debug) which gives verbose logging option; see logging howto more details on how configure logging levels , destinations. short demo: >>> import requests >>> import logging >>> logging.basicconfig(level=logging.debug) >>> r = requests.get('http://httpbin.org/get?foo=bar&baz=python') info:requests.packages.urllib3.connectionpool:starting new http connection (1): httpbin.org debug:requests.packages.urllib3.connectionpool:"get /get?foo=bar&baz=python http/1.1" 200 353 the following messag

objective c - NSScanner scan a string from end -

i have filename wo.no 193 , task no 15146.jpg. want split out extension filename. can tell how nsscanner, there other way using scanner. if please let me know solution. there methods in nsstring that: nsstring *fn = @"wo.no 193 , task no 15146.jpg"; nsstring *basename = [fn stringbydeletingpathextension]; nsstring *extension= [fn pathextension]; so no need use scanner, unless have other requirements.

Android How to add clickable button in listview? -

i displaying listview movie , right side display button download when scroll listview button event interchange(repaint) every time,i have set button text cancel when user press download button , downloading started when scroll down list button text change initial name download , event interchange. static class listitemcontainers { //imageview imgicon; //textview txttitle; progressbar pb; textview progressval; button downloadbutton; textview title; imageview imageicon; linearlayout layout; } @override public view getview(int position, view convertview,final viewgroup parent) { // todo auto-generated method stub final listitemcontainers holder; log.d("game name in adapter",":"+gamelistname.get(position)); view vi=convertview; final listitemcontainers holdz; relativelayout rl; if(convertview==null) { convertview = inflater.inflate(r.layout.list_row, null);

Change div height when at top of page - long delay? - Jquery -

sorry if basic of questions - i'm total novice when comes jquery/javascript! i've had around answer dont know search! i want have fixed navigation bar shortens if user not @ top of page, working fine me: http://jsfiddle.net/2nw6u/ $(document).ready(function(){ $(function () { $(window).scroll(function () { if ($(this).scrolltop() < 10) { $('#headercontent').animate({paddingtop: '18px', paddingbottom:'18px'}, 300); } else { $('#headercontent').animate({padding: '0px'}, 300); } }); }); }); ...but there considerable delay when scroll top of page, causing , how can around it? this happens because scroll event fired multiple times , each time fires queue new animation.. you need clear queue each time ( by using .stop() ).. if ($(this).scrolltop() < 10) { $('#headercontent').stop(true, false).animate({ paddingtop: '18px',

java - read/write internal storage android -

i have question regarding internal files in android.. tried write data file , read however, seems can't write data file unless cast integer first.. there anyway can save double or float values.. added code i'm trying use below: formatcluster formatcluster = ((formatcluster)objectcluster.returnformatcluster(offormats,"calibrated")); if (formatcluster != null) { //obtain data text view calibrateddataarray[0] = formatcluster.mdata; calibratedunits = formatcluster.munits; a.settext("data: " + formatcluster.mdata); string filename = "myfile"; //string string = "hello world!"; fileoutputstream outputstream; try { outputstream = openfileoutput(filename, context.mode_private); outputstream.write((int)formatcluster.mdata);//here don't want cast value integer outputstream.close(); } catch (exception e) { e.printstacktrace(); } //testing.settext) double ch; stringbuffer filecontent = new stringbuffer(""); fileinputst

css - webkit transitions not working in chrome and safari -

i'm having trouble getting transition work in webkit browsers, while works in firefox. code below html <div class="dropdown" data-id="new-houses"> <h3>new houses</h3> <img src="/local/images/down-arrow.png" /> </div> <div id="new-houses" style="display:none;"> <!--content of div--> </div> css .dropdown{ width:100%; cursor:pointer; height:50px; clear:both; } .dropdown img{ width:20px; height:17px; float:right; margin-right:20px; margin-top:17px; -webkit-transition:transform 1s; -moz-transition:transform 1s; -ms-transition:transform 1s; -o-transition:transform 1s; transition:transform 1s; } .point_down{ transform:rotate(180deg); -webkit-transform:rotate(180deg); -moz-transform:rotate(180deg); -ms-transform:rotate(180deg); -o-transform:rotate(180deg); } jquery $('.dropdown').click(function(){ var

c# - How do I add a background image to LayoutDocumentPane? -

i have created resource imagebrush , see below, not know how add avalondock layoutdocumentpane . want add pane because want have logo in background, layoutdocumentpane covers window background. <bitmapimage x:key="logobitmap" urisource="pack://application:,,,/mylibrary;component/myimages/mybiglogo.png"/> <imagebrush x:key="logoimage" imagesource="{staticresource logobitmap}"/> right now, have following: <ad:dockingmanager x:name="dockmanager" > <ad:layoutroot> <ad:layoutpanel x:name="mylayoutpanel" orientation="horizontal"> <ad:layoutanchorablepane x:name="mylayoutanchorablepane" dockwidth="400"/> <ad:layoutdocumentpane x:name="mydocumentpane"/> </ad:layoutpanel> </ad:layoutroot> </ad:dockingmanager> i able find method of setting background image works use case, using simple

svm - How to get the predicted values in training data set for Least Squares Support Vector Regression -

Image
i make prediction using least squares support vector machine regression, proposed suykens et al. using ls-svmlab, can find matlab toolbox here . let's consider have independent variable x , dependent variable y, both simulated. following instructions in tutorial. >>x = linspace(-1,1,50)’; >>y = (15*(x.^2-1).^2.*x.^4).*exp(-x)+normrnd(0,0.1,length(x),1); >>type = ’function estimation’; >>[gam,sig2] = tunelssvm({x,y,type,[], [],’rbf_kernel’},’simplex’,...’leaveoneoutlssvm’,’mse’}); >>[alpha,b] = trainlssvm({x,y,type,gam,sig2,’rbf_kernel’}); >>plotlssvm({x,y,type,gam,sig2,’rbf_kernel’},{alpha,b}); the code above finds best parameters using simplex method , leave-one-out cross validation , trains model , give me alphas (support vector values data points in training set) , b coefficients. however, not give me predictions of variable y. draws plot. in articles, saw plots 1 below, as said before, ls-svm toolbox not give me p

php - Mvc Method name must be a string -

i have problem , dont have idea how slove this. problem on line code: public function executeaction() { return $this->{$this->action}(); } all other work fine controller success loaded have fatal error this. fatal error: method name must string in d:\xampp\htdocs\workplace\mvc\lib\basecontroller.php on line 27 check code: index.php $fcontroller = new fcontroller($_get); $controller = $fcontroller->createcontroller(); $controller->executeaction(); fcontorler public function createcontroller() { if(class_exists($this->controller)) { $parent = class_parents($this->controller); if(in_array('basecontroller', $parent)) { if(method_exists($this->controller, $this->action)) { return new $this->controller($this->action, $this->url); }else { echo "method no exists"; }

python bindings for selenium returns in exception when initiating a Firefox webdriver object -

when on windows want give try webdriver extension selenium, error. installed python bindings on installation page. , try to following: from selenium import webdriver browser = webdriver.firefox() firefox (15.0) opened , after exception occurs: traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\selenium-2.32.0-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 62, in __init__ desired_capabilities=capabilities) file "c:\python27\lib\site-packages\selenium-2.32.0-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 72, in __init__ self.start_session(desired_capabilities, browser_profile) file "c:\python27\lib\site-packages\selenium-2.32.0-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 114, in start_session 'desiredcapabilities': desired_capabilities, file "c:\python27\lib\site-packages\selenium-2.32.0-py2.7.egg\selenium\

perl - How to find modules dependency & install it but without cpan/cpanm? -

the problem don't have access write $home directory. (i have access create new directory on $home/app-root/data/) because cpan/cpanm need create new directory $home/.cpan/ don't have idea how find modules dependency hand (one-by-one). do guys know other method install module (and find dependency) without create ~/.cpan/ directory ? or maybe how override ~/.cpan/ ~/app-root/data/.cpan ? p.s: sorry english bad, english isn't native language just (temporarily) change $home directory do have write access to: home=$home/app-root/data/ cpanm module

.net - asp.net handler not picking up case sensitive -

i have handler in web.config: <add name="handler1" path="*.jpg" verb="*" type="imagehandler" resourcetype="unspecified" precondition="integratedmode" /> problem path case sensitive. want handler pickup path *.jpg. there way make above line case insensitive? as quick fix, can have copy of handler path="*.jpg"

Creating Dynamic Facets in Elasticsearch -

i want dynamically create facetts nested type has dynamic attributes. suppose these articles in index , i'm searching name , brand: { name: iphone 16gb brand: apple type: smartphone attributes: { color: white } } { name: ipad brand: apple type: tablet attributes: { color: black } } { name: cruzer usb 16gb brand: sandisk type: usb-stick attributes: { color: black capacity: 16gb usb-standard: usb 2.0 } } { name: cruzer usb 16gb brand: sandisk type: usb-stick attributes: { color: red capacity: 16gb usb-standard: usb 3.0 } } now, if i'm searching 'apple' want have search result has following facets: brand: apple 2 type: smartphone 1 tablet 1 color: black 1 white 1 a search '16gb' should include facets: brand: apple 1 sandisk 2 type: smartphone 1 usb-stick 2 color: blac

jquery - How to loop through WCF using Ajax -

this bit black magic me i've created wcf service online tutorial display sql data (running asp.net solution locally produces results service presume it's running correctly). what i'm trying connect service html page, script i've created. <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(function () { // send ajax request alert("running"); $.ajax({ type: "get", url: "http://localhost:15021/service1.svc/getallcustomers", datatype: "json", success: alert("success"), error: alert("failure") }); }); </script> i no errors 2 alerts (the success , failure), question how start work data wcf returning? any advice great. thanks, craig success: function(response){ //do things want response data getting. //and yes getting json

c# - Open New Tab in ASP.NET web page -

after clicking on asp.net button, redirects correct website on same tab, not in new tab, need do. after clicking button twice, redirects website in new tab. don't know what's wrong code! the asp.net button control looks this: <asp:imagebutton id="imagebutton1" runat="server" imageurl="../images/neu.png" onclick="new_btn_click" /> and code run this: protected void new_btn_click(object sender, eventargs e) { imagebutton1.attributes.add("onclick", "window.open('new_model_epk.aspx');return false;"); } what you're describing expect. javascript isn't run until second time because hasn't been added until after click button first time. don't use c#; use this: <asp:imagebutton id="imagebutton1" runat="server" imageurl="../images/neu.png" onclientclick="window.open('new_model_epk.aspx');return false;" /> any javasc

python - How do I get a line of the what the console returns (string) and place in a variable? -

i have code using telnet , requires login. if login incorrect, returns "incorrect login" console. want catch exception , skip doesn't stop program. tried below: try: session.write("username".encode('ascii') + b"\r") session.write("password".encode('ascii') + b"\r") ***this point console return "incorrect login"*** except sys.stdout == "incorrect login": print(sys.stdout) pass else: **rest of code** it seems never catches output, continues on code , ends in index error (from not having data need logging in). tried searching had no luck. appreciated. i'm running python 3.3 , still learning. thanks! edit: here telnet shows login: badusername password: **blank b/c pw field** login incorrect login: edit2: code else (edited confidentiality) import telnetlib, time import sys, string, socket import cx_oracle sql = "select column table" con = cx_ora

c# - MVC 4 and lazy loading: "Collection was modified" error when deleting multiple records -

in asp.net mvc 4 project, have model leaguemember : public class leaguemember { [key, column(order = 0)] public int memberid { get; set; } [key, column(order = 1)] public int leagueid { get; set; } public bool? isactive { get; set; } public virtual league league { get; set; } public virtual member member { get; set; } } in league model, have: public virtual icollection<leaguemember> leaguemembers { get; set; } in edit view of league controller, have dropdown leaguemembers , in edit action trying delete existing leaguemembers , creating new ones: [httppost] public actionresult edit(leaguemembersviewmodel leaguememberviewmodel) { if (modelstate.isvalid) { var league = leaguememberviewmodel.league; context.entry(league).state = entitystate.modified; /* without line next foreach statement complain league.leaguemembers null due lazy loading..*/ context.entry(league).collection("

applescript: buttons variables and properties -

i use 2 simple button clicks generate variables "department" , "suite". 1 button click should create set of button options based on returned value "department" why not working? --set departments , suites property departments : {"audio", "video", "digital"} property suites_audio : {"a1","a2", "a3", "txfr"} property suites_video : {"vfx1", "vfx2", "fcp1", "fcp2", "flame1", "flame2"} property suites_digital : {"mcr", "encoding", "store"} --get suite location display dialog "enter department" buttons departments set department button returned of result set suites "suites_" & department display dialog "enter suite" buttons {suites} set suite button returned of result i have feeling in syntax of these 2 lines: set suites "suites_" & department

tsql - Converting varchar to XML and parsing the XML failing -

i trying design query search though audit logs in emr database. problem audit information stored in varchar column text description of happened (which don't care about) , other times contains valid xml (i know design flaw can't change because didn't create emr) i created table valued function parses xml , returns data select statement fails execute because xml conversion in function fails. can't try/catch on conversion in function , can's call stored procedure function conversion try/catch either i'm not sure go this. select top 1 * audit with(nolock) outer apply dbo.cus_getdeletedattachmentinfo(audit.audituid) detail error xml parsing: line 1, character 136, illegal xml character you have illegal character in markup need have catch potentially when trying convert xml. did this: declare @text varchar(max); select @text = '<root><stuff>&</stuff></root>' begin try select cast(@text xml) end try beg

c++ - Adjusting glRotate, using dot product -

introducing: i'm developing little tower defense game in opengl, i'm despairing of little problem.... i want projectiles tower aim head facing unit. problem more mathmatical 1 belongs opengl :) i had following idea; use dot product angle rotating around x axis head depending on distance straight down or flat ground , after additional angle rotate around y axis head of arrow everytime adjusted unit it's aiming on. my code angle of rotation around x axis (i called m_fyneigung because height(y) of head changes rotating around x axis) looks this: plocaltowerarray[(sizemapindexy * 12) + sizemapindexx].projektils[byteprojectilindex].m_fyneigung = radians_to_degrees (acos ((float) ( (fatowerposition[0]) * (plocaltowerarray[(sizemapindexy * 12) + sizemapindexx].projektils[byteprojectilindex].m_faprodirectionvector[0]) + (fatowerposition[1] - 1) * (plocaltowerarray[(sizemapindexy * 12) + sizemapindexx].projektils[byteprojectilindex].m_fap

Ember.js: How to refresh parent route templates in a nested route scenario? -

Image
my page layout (application template) looks (simplified): i use different routes (offer list + offer detail, customer list + customer detail). lists shown in sub-navigation outlet. my router's code: app.router.map(function () { //... this.resource('offers', function () { this.resource('offer', { path: '/:offer_id' }); }); } my routes: app.offersroute = ember.route.extend({ model: function () { return app.offer.find(); }, rendertemplate: function (controller, model) { this.render('offer-list', { into: 'application', outlet: 'sub-navigation', controller: 'offers' }); this.render('offer-list-title', { into: 'application', outlet: 'page-title' }); this.render('offer-list-content', { into: 'application' }); } }); app.offerroute = ember.route.extend({ model: function (params) { return app.offer.fi

editor - How do I uninstall a language module in Textwrangler? -

i'd remove .m mapping objective-c in textwrangler may have matlab syntax highlighting support in app. read users manual , searched online, , both point me ~/library/application support/textwrangler/language module folder delete said language module. however, when subfolder, empty , has nothing new language modules installed myself. tried unhiding files in finder via terminal commands , still cannot find language module want delete. textwrangler version 4.5.1 in 10.7.5. in advance help. it seems built-in languages not in directory , cannot removed. not problem because can remap .m extension matlab files doing this: go preferences -> languages. add new "custom extension mapping" , link suffix m language matlab . i've tested , seems override default extension mapping.

regex - In Python 2.7, how can i replace 't' with 'top' and 'h' with 'hop' only when 'th' is not visible -

i new here , python want give try! replace 't' 'top' , 'h' 'hop' in sentence , when 'th' not visible because 'th' become 'thop'. example : 'thi hi tea' has become 'thopi hopi topea'. have code: sentence = str(raw_input('give me sentence ')) start = 0 out = '' while true: = string.find( sentence, 'th', start ) if == -1: sentence = sentence.replace('t', 'top') sentence = sentence.replace('h', 'hop') break out = out + sentence[start:i] + 'thop' start = i+2 but not working...any ideas? import re str = 'thi hi tea' re.sub(r'(?i)h|t(?!h)', r'\g<0>op', str) yields 'thopi hopi topea' to break down, import re imports regular expression library use substitution, sub , function (?i) makes regex case-insesitive t(?!h) matches 't' not followed 

How do I get natural dimensions of an image using javascript or jquery? -

i have code far: var img = document.getelementbyid('draggable'); var width = img.clientwidth; var height = img.clientheight; however gets me html attributes - css styles. want dimensions of actual image resource, of file. i need because upon uploading image, it's width gets set 0px , have no idea why or happening. prevent want actual dimension , reset them. possible? edit: when try naturalwidth 0 result. i've added picture. weird thing happens when upload new files , upon refresh it's working should. http://oi39.tinypic.com/3582xq9.jpg you use naturalwidth , naturalheight , these properties contain actual, non-modified width , height of image, have wait until image has loaded them var img = document.getelementbyid('draggable'); img.onload = function() { var width = img.naturalwidth; var height = img.naturalheight; } this supported ie9 , up, if have support older browser create new image, set it's source same image, ,

asp.net - How can I dynamically add labels and checkboxes from a C# object or method to a fieldset using jQuery? -

i need populate fieldset on page pairs of labels/checkboxes differ user user. i've got hardcoded in html so: old html: <fieldset id="checkboxesfieldset" data-role="controlgroup" data-type="horizontal" id="groupedsites"> <legend class="labeltext">select duckbilled platypi want include in backyard menagerie</legend> <label for="duckbill1">1</label> <input type="checkbox" name="duckbill1" id="duckbill1" /> <label for="duckbill2">2</label> <input type="checkbox" name="duckbill2" id="duckbill2" /> . . . i reckon new html should this: <fieldset id="checkboxesfieldset" data-role="controlgroup" data-type="horizontal" id="groupedsites"> <legend class="labeltext">select duc

MongoDB : query collection based on Date -

i have collection in mongodb in format db.logins.find().pretty() { "cust_id" : "samueal", "created_at" : "2011-03-09 10:31:02.765" } { "cust_id" : "sade", "created_at" : "2011-03-09 10:33:11.157" } { "cust_id" : "sade", "created_at" : "2011-03-10 10:33:35.595" } { "cust_id" : "samueal", "created_at" : "2011-03-10 10:39:06.388" } this mapreduce function m = function() { emit(this.cust_id, 1); } r = function (k, vals) { var sum = 0; (var in vals) { sum += vals[i]; } return sum; } q = function() { var currentdate = new date(); currentdate.setdate(currentdate.getdate()-32); var month = (currentdate.getmonth() < 10 ? "0"+ (currentdate.getmonth()+1) : (currentdate.getmonth()+1)); var date = currentdate.g

java - ExecutionEngine not recognizing parameter -

i'm using neo4j 1.8.rc1, , trying generate clustering coefficient nodes in graph. i've got following code, far can tell working on linux system, not work on windows machine: map<string, object> params = new hashmap<string, object>(); string query; string typestring; if (type == <some type>) { typestring = "type1"; } else { typestring = "type2"; } params.put("myid", userid); query = "start a=node(*) match (a)-[:"+ typestring +"]-(b) a, count(distinct b) n " + "match (a)-[:" + typestring + "]-()-[r:"+ typestring+"]-()-[:"+typestring+"]-(a) a.thisid! = {myid} return n, count(distinct r) relcount"; executionengine engine = new executionengine(graphdb); executionresult result = engine.execute(query, params); when try access result, exception in thread "main" java.lang.runtimeexception: org.neo4j.cypher.parameternotfoundexception: e

.net - How to check programatically if an assembly reference exists in c#? -

i trying write small c#/.net library specific financial calculations. i have written several classes depend on standard assemblies of .net framework. is, library these classes require nothing other .net framework (4.0 client). now need additional class excel integration. class require additional assembly references related microsoft office , excel, respective object libraries. my problem is: of users of library may have office , excel, not. how can add additional class library both types of users can use library without getting errors? more precisely: if user not have office , excel, user must able run classes excluding excel-related 1 without getting errors. thanks help, selmar i doing this. assemblies probed if exist/will work. you can in many ways, of course, that's ended with: extracted functionality of class interface (let's call it: iexcel) , added isavailable property it implemented fake class implementing iexcel, , returning 'false'

Cassandra token encoding algorithm -

when make write cassandra, brings row key, calculates token , puts node 1 responsible token range. algoritm cassandra uses calculate token? in cassandra 1.2, default murmur (version 3) hash. in earlier versions, cassandra used md5.

c# - Is there UI inspector tool similar to hawkeye that works with .net 4.5? -

i'm working winforms application targeting .net 4.5 , need inspect ui elements. i've used snoop inspect wpf elements in past, , i've come across hawekeye well. however, appears hawkeye not compatible .net 4.5. there tools out there can give me similar results? seems old tools no longer work ui spy either. microsoft have inspect tool available here ( inspect tool ). it's part of win8 sdk. i'm looking @ same problem myself today, trying shortly.

vb.net - Skip is not a member of System.Data.EnumerableRowCollection(of System.Data.DataRow) -

Image
i working on jqgrid paging , working ok when working in separate application. moved existing project , keep getting error. and if try , add reference system.data.datasetextensions says doesn't contain public member or cannot found. this works me in project, table datatable, , code builds fine. table.asenumerable().skip(5).take(5) are missing necessary import statements , dll references reason? dtwordata datatable object directly, right? seems yes, because popup lists enumerablerowcollection, example shows when mouse on in visual studio.

wpf - Is it Possible to add Hide the one property based on other property? -

in custom control have 3 properties(state,value,count), state property enum(dock,float,tab), if enum value(float) means want hide(browsable false) value property in wpf. there possibility propertychanged of state. in setter state, check value is. if it's float hide, else unhide. private stateenum _state; public stateenum state { { return _state; } set { if (value == stateenum.float) { // hide stuff } else { // show stuff } name = value; } }

css - How to display FULL background image of a div no matter if contents in div is smaller -

i have header image located @ ink.talentosoft.com take if can. the header image 388 px in height. want background of div displayed. set div follows: background: url(http://ink.talentosoft.com/wp-content/uploads/2013/05/header.png) no-repeat 100% center; because contents of div smaller background, rest of image cut off. how may extend full height of image? background-size: 100%;//did not work obviously height:388px; div.

Calculating SVG bounding box using PHP with respect to curves -

i found amazing class located here , , tried using it. however, works of basic functions such move, horizontal line, , vertical line. -- i have tried extending existing class adding additional checks (and changing regex). public static function frompath($pathstring) { preg_match_all('/([mlvhzc][^mlvhzc]*)/i', $pathstring, $commands); $pt = array(0, 0); $bounds = new self(); foreach ($commands[0] $command) { preg_match_all('/((\+|-)?\d+(\.\d+)?(e(\+|-)?\d+)?)/i', $command, $matches); $i = 0; while ($i < count($matches[1])) { switch ($command[0]) { case 'm' : case 'l' : $pt[0] += $matches[1][$i++]; $pt[1] += $matches[1][$i++]; break; case 'm' : case 'l' : $pt[0] = $matches[1][$i++]; $pt[1] = $matches[1][$i++];

javascript - another way of using (calling?) <body onload="init()"> -

i working on ebay listing in using js powered tabber. i believe ebay automatically strips out tags such <body> <html> etc , in doing has stripped out <body onload="init()"> , bans use of ".cookie", "cookie(, "replace(".iframe, meta, or includes), cookies, or href." unfortunately javascript (html , css) skills pretty poor appreciate if tell me rename <body onload="init()"> to, work? here link how should - http://sweetvision.co.uk/ebayimages/camo/gilet.html here listing looks - http://www.ebay.co.uk/itm/330879734834?var=&sspagename=strk:meselx:it&_trksid=p3984.m1555.l2649 here code: <script type="text/javascript"> var tablinks = new array(); var contentdivs = new array(); function init() { // grab tab links , content divs page var tablistitems = document.getelementbyid('tabs').childnodes; ( var = 0; < tablistitems.length; i++ ) { if ( tablistitems[i].nodenam

String.Replace working in VB but not C# -

the following vb code works correctly , not flag errors. strline = strline.replace(strline.lastindexof(","), "") however same c# code doesn't: strline = strline.replace(strline.lastindexof(","), ""); this not compile says the best overloaded method 'string.replace(string,string)' has invalid arguements. how come works in vb not in c#? , how fix this? i thought might similar c# string.replace doesn't work implies that code infact complile. likewise other string.replace questions: string.replace (or other string modification) not working , appears infact compile, whereas mine not. lastindexof returns integer , not string. replace takes string, string parameters, you're passing int, string , hence exception the best overloaded method 'string.replace(string,string)' has invalid arguements. if you're looking remove , use this: strline = strline.replace(",", ""

java - Tables in Spring security -

i want group based security in application. don't understand how use it. looking @ 2 different database schemas appendix, got questions. supposed extend group_members table password, enabled, first name etc? or supposed have table named instance user hold info? if need, why need group_member table? http://static.springsource.org/spring-security/site/docs/3.0.x/reference/appendix-schema.html it not compulsory use group table. can use single or 2 table authentication. refer following link reference. http://www.mkyong.com/spring-security/spring-security-form-login-using-database/

sql - MySQL limit by count and return items with same date -

assuming have following table structure create table `calendar` ( `id` int(11) not null auto_increment, `title` varchar(255) not null, `date` date not null, primary key (`id`) ) and following data insert `calendar` (`title`, `date`) values ('day 1 - event 1', '2013-05-01'), ('day 2 - event 1', '2013-05-02'), ('day 2 - event 2', '2013-05-02'), ('day 3 - event 1', '2013-05-03'); i hoping limit result set 2 items not cut result in between items of same date. select * `calendar` `date` >= '2013-05-01' limit 2 yield ('day 1 - event 1', '2013-05-01'), ('day 2 - event 1', '2013-05-02'), ('day 2 - event 2', '2013-05-02') instead of just ('day 1 - event 1', '2013-05-01'), ('day 2 - event 1', '2013-05-02') any ideas? something should work putting desired dates in subquery: select distinct c.* `calend

actionscript 3 - Adding movie clips with for loop action script 3 -

hey wondering if can me, trying add load of move clips , make them clickable stage in action script 3,i can work out spacing of them later keep getting errors while trying add them using : for(var x:int = 1; x <= 10; x++) { var this["cardprint"+x] :movieclip = new this["card_"+x](); this.addchild(this["cardprint"+x]); this["cardprint"+x].addeventlistener(mouseevent.click, this["click_"+x]); } a point in right direction alot thank you this scope indicator indicates current class. this["cardprint"+x] trying find variable name, can't declare variable reference. the way want this: public dynamic class foobar { public function foobar() { for(var x:int = 1; x <= 10; x++) { this["cardprint"+x] = new this["card_"+x](); this.addchild(this["cardprint"+x]); this

forms - MS Access OpenForm acDialog option does not seem to work -

this docmd.openform fnew, , , , , acdialog doesn't seem stop code execution reason. because i'm calling function has method function , messing up? e.g. func1 <code> call func2 <func2 code> docmd.openform fnew, , , , , acdialog <back func1 code executes though dont want until form closes> with acdialog openform windowmode parameter, calling code should not continue until form closed. it should not matter openform takes place in procedure called code. in example, when running func1 , msgbox not displayed until form closes. public function func1() call func2 msgbox "form closed" end function public function func2() 'docmd.openform "form3", , , , , acdialog docmd.openform "form3", windowmode:=acdialog end function note code operates described long form not open. if it's open in design view, calling openform switches form view without applying acdialog . if open in fo

java - Validation Required Before Loading jsp -

i have 1 scenario want validation before welcome.jsp page loaded. validation have user id (using request.getremoteuser) want check in db whether there or not. if yes, want redirect page login.jsp. if not, redirect welcome.jsp. have declare 1 servlet (checkuser.java) calling dopost doget , included same servlet in welcome.jsp before loading doget invoke. **checkuser.java** package dbresource; import java.io.ioexception; import java.io.printwriter; import java.sql.connection; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; import java.util.logging.level; import java.util.logging.logger; import javax.servlet.requestdispatcher; import javax.servlet.servletconfig; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class checkuser extends dbconnection { string page="listprojects.jsp"; publ