Posts

Showing posts from February, 2011

amazon web services - aws s3 sdk for iOS putObjectRegquest to "new" region not working -

first let me new ios/xcode aws. i creating app writes data aws s3 bucket. app works when creating bucket , putting objects standard region. however, when change region singapore, app creates bucket - but, cannot put objects bucket , aws not produce error or exception of kind. here code in question. commented code in createbucket method creates bucket in singapore. processgrandcentraldispatchupload method works standard region, not put objects singapore bucket. - (void)createbucket { // create bucket. @try { //s3region *region = [[s3region alloc] initwithstringvalue:ks3regionapsoutheast1]; //s3createbucketrequest *createbucketrequest = [[s3createbucketrequest alloc] initwithname:[constants s3bucket] andregion:region]; s3createbucketrequest *createbucketrequest = [[s3createbucketrequest alloc] initwithname:[constants s3bucket]]; s3createbucketresponse *createbucketresponse = [self.s3 createbucket:createbucketrequest]; nslog(@"create bucket response: ...

CSS position absolute and scroll issue -

im working on website template , want make photo on top. used position absolute set top -50px , left -50px. work have 1 issue scroll bar appear on bottom. css div : #moon { background-image:url('img/moon.png'); width:289px; height:289px; position:absolute; top:-150px; left:-160px; overflow:hidden; } give body overflow-x: hidden also notice on small screens there no horizontal scrollbar(!), unless you'll handle responsive css.

sql server - SSIS prevent warnings from propagating -

Image
i've got script running in foreach loop container, inside package's control flow. in script, throwing warning, exiting success dts.events.firewarning(-1, "", "warning message here", "", 0); dts.taskresult = (int)scriptresults.success; i've set system propagate variables false. also tried setting package property disableeventhandlers true. however, duplicate warning messages still being thrown in order of: script foreach loop container package i possibly log each incident information instead of warning... dont want log information. logging warnings more realistic. create onwarning event handler script task. event handler not need tasks of own, need system variable propagate set false.

java - Can I change the implementation class injected by spring in runtime? -

i have class has injected spring on applicationcontext.xml , need change implementation without change applicationcontext.xml. i heard aop "introductioninterceptor" don't found many useful results. anyone can me? ps. sorry bad english, hope give understand. you can in several ways, here few: write xml file, override configuration adding same bean id , implementation class want use, import new xml existing application context. through code, base on need can set new implementation before calling code. there more have used '1' in number of projects. if have multiple beans same id, spring pickup latest one, e.g. <beans> <import resource="a.xml"/> <import resource="b.xml"/> </beans> now if both a.xml , b.xml have bean defined same id, spring use bean defined in b.xml . cheers !!

keyboard - "Listening" for media key press events -

i'm writing application in c++ needs able listen key presses occur in linux, namely media next, media previous, , media play/pause. what apis exist enable me listen keypresses? assume enduser running x, if they're not, there "guaranteed™" way catch media key presses no matter what? i'm bit new writing c++ , relates linux, i'm in no way new linux (just getting used living on bare metal). i not sure extent globally under x using xlib event handlers . sans x, believe require kernelspace component, if really wanted this, might best bet. however, it's not idea. did not trying do, think falls 1 of 2 categories: either want use keys operate app (case a) or want app monitor use of application uses keys (case b). in case a , it's not idea because associating global keystrokes actions domain of window managers/desktop environments (the associations should dynamic, not hard-coded), , when decide make own rules ignoring fact, users , other ...

Error Querying Active Directory Linked Server from SQL Server 2008 R2 -

i'm developing part of application requires sql server 2008 r2 query active directory. i've done far create linked server doing exec sp_addlinkedserver 'adsi_link', 'active directory service interface', 'adsdsoobject', 'adsdatasource' exec sp_configure 'show advanced options',1 go reconfigure go exec sp_configure 'ad hoc distributed queries',1 go reconfigure go doing exec sp_linkedservers shows linked server active directory created. next step users active directory database. doing open query following returns users should no errors or issue whatsoever. basically, works following query. select * openquery (adsi_link, 'select cn, givenname, sn, objectcategory, samaccountname, mail, department, manager, ou, useraccountcontrol, lockouttime ''ldap://dc=domain,dc=local'' objectcategory = ''person'' , objectcategory = ''user'' ...

database - Inserting a Matlab Float Array into postgresql float[] column -

Image
i using jdbc access postgresql database through matlab, , have gotten hung when trying insert array of values rather store array instead of individual values. matlab code i'm using follows: insertcommand = 'insert neuron (classifier_id, threshold, weights, neuron_num) values (?,?,?,?)'; statementobject = dbhandle.preparestatement(insertcommand); statementobject.setobject(1,1); statementobject.setobject(2,output_thresholds(1)); statementobject.setarray(3,dbhandle.createarrayof('"float8"',outputnodes(1,:))); statementobject.setobject(4,1); statementobject.execute; close(statementobject); everything functions except line dealing arrays. object outputnodes <5x23> double matrix, i'm attempting put first <1x23> table. i've tried several different combinations of names , quotes '"float8"' part of createarrayof call, error: ??? java exception occurred: org.postgresql.util.psqlexception: unable find server arr...

CSS transition bug inside anchor (Chrome and IE) -

take @ code: jsfiddle code i need wrap box div containing text , svg images link anchor < > : <a href="#"> <div id="block1"> <svg>...</svg> <div class="text">...</div> </div> </a> on hover event want smoothly change colors of svg image ( colors of < path > elements ) #block1:hover #path1 { fill: #color; -webkit-transition: 0.8s ease-in-out; ................................. transition: 0.8s ease-in-out; } it works fine on firefox (haven't tested opera or safari), doesn't work in ie10 , in chrome there seems strange loading bug: when open jsfiddle page seems work, if edit code , run again (without reloading whole page) block inside anchor flickering (no smooth color transition). if reload whole page again, works again. on project page anchor blocks flickering on first load. i've tried load project page locally ...

How to check if file exists in C++ in a portable way? -

currently use code check if file exists on windows , posix -compatible oses (linux, android, macos, ios, blackberry 10): bool fileexist( const std::string& name ) { #ifdef os_windows struct _stat buf; int result = _stat( name.c_str(), &buf ); #else struct stat buf; int result = stat( name.c_str(), &buf ); #endif return result == 0; } questions: does code have pitfalls? (maybe os cannot compiled) is possible in portable way using c/c++ standard library? how improve it? looking canonical example. because c++ tagged, use boost::filesystem : #include <boost/filesystem.hpp> bool fileexist( const std::string& name ) { return boost::filesystem::exists(name); } behind scenes apparently, boost using stat on posix , dword attr(::getfileattributesw(filename)); on windows (note: i've extracted relevant parts of code here, did wrong, should it). basically, besides return value, boost checking errno value in order ...

mysql - Update two columns in sql -

this table of data need change. select appid, categoryid, categoryname, classdesc apps join appscategories using(appid) join categories using (categoryid) join classes using (classid) classdesc = "auto" which returns this: appid categoryid categoryname classdesc 400 100 public auto 405 101 business auto 410 102 auto auto 415 102 auto auto i want update table data below updated have categoryname of auto categoryid of 102. need use select statement above somehow unsure how update both columns. appreciated! assuming wanting update these 2 columns every row in table, should work. update apps join appscategories b on a.appid = b.appid //whatever keys join categories c on b.categoryid = c.categoryid //whatever keys join classes d on c.classid = d.classid ...

Reverse a list in python -

this question has answer here: how can reverse list in python? 27 answers how reverse list in python? tried: a = ["abc", "def", "ijk", "lmn", "opq", "rst", "xyz"] print a = reversed(a) print but <listreverseiterator object @ 0x7fe38c0c> when print a 2nd time. use a[::-1] its pythonic way of doing it.

javascript - how to include js file in an html file? -

i want implement virtual keyboard in project. never included before referred link , tried below: <head> <script type="text/javascript" src="vkboards.js"></script> <script> // minimal callback function: function keyb_callback(char) { // bind vkeyboard <textarea> // id="textfield": var text = document.getelementbyid("textfield"), val = text.value; switch(ch) { case "backspace": var min=(val.charcodeat(val.length - 1) == 10) ? 2 : 1; text.value = val.substr(0, val.length - min); break; case "enter": text.value += "\n"; break; default: text.value += ch; } } </script> </head> in style: #keyboard { width:800px; height:400px; background-color:#f2f3f1; mar...

.htaccess - htaccess simplified and remove need for trailing a slash -

i writing first htaccess , cleaning , understanding it. first issue having mulitple parameters. current setup looks like: options +followsymlinks rewriteengine on rewritecond %{request_filename} !/(_modules|css|files|ico|img|js)/ rewriterule ^([^/]*)$ index.php?p1=$1 [l] rewritecond %{request_filename} !/(_modules|css|files|ico|img|js)/ rewriterule ^([^/]*)/([^/]*)$ index.php?p1=$1&p2=$2 [l] rewritecond %{request_filename} !/(_modules|css|files|ico|img|js)/ rewriterule ^([^/]*)/([^/]*)/([^/]*)$ index.php?p1=$1&p2=$2&p3=$3 [l] rewritecond %{request_filename} !/(_modules|css|files|ico|img|js)/ rewriterule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ index.php?p1=$1&p2=$2&p3=$3&p4=$4 [l] is there way simplify handle maximum of 4 parameters of them being optional? leads me me next problem seems if need have trailing slash after parameters unless using 4 parameters. in short urls this... http://www.example.com/home http://www.example.com/home/ http://www.example...

jquery - Highcharts IE8 - Error on page -

highcharts js version: 3.0.3 broswer: internet explorer 8 reference url: http://jsfiddle.net/adcxr/1/show/ problem: when cursor touches of bar graph charts (and assume charts) , on html page. (mouseout/off of highcharts), following error in ie 8. message: object doesn't support property or method line: 4 char: 8558 code: 0 uri: https://ajax.googleapis.com/ajax/libs/j ... ery.min.js from have read online bug inside highcharts js library. does know of fix ie8 not produce error? the code below stackoverflow requirements. $(function () { var chart; $(document).ready(function() { chart = new highcharts.chart({ chart: { renderto: 'container' }, title: { text: 'combination chart' }, xaxis: { categories: ['apples', 'oranges', 'pears', 'bananas', 'plums'] }, too...

excel - Should I have to have duplicate values in VBA class objects? -

i've been using vba class modules in excel while now, i'm not sure creating them correctly. create module level variables class , property let , functions. example: private msregion string property region() string region = msregion 'return region end property property let region(byval sregionname string) msregion = sregionname 'set region end property when @ objects in local window notice each property end module scoped variable , variable required let function. seems duplication of variable me. i'm concerned if instatiated large collection of objects several properties in each costly in terms of resources. i've tried modify code 1 variable in object class, far i've got error messages pains. does know of way create properties in class modules not lead duplicate variables? edit: i have had @ locals window , realised argument property let isn't there. 2 expressions appear privately stored variable , proprty value, in case msregion...

android - How do I refresh connected fragments accordingly? -

i'm making simple notepad app. in 1 fragment there's list view of added notes , when note selected other fragment shows details of note. if user clicks delete button note deleted, how refresh list view , detail view accordingly? for refreshing listview have refresh underlaying adapter . this workflow of scenario: remove selected item call notifydatasetchanged() set item current one, example previous note or first one. and that's it.

Can I detect the orientation of an image with text in c# - possibly using MODI? -

i have number of documents scanned png files. not know orientation of each scan. need know how rotate them when present them user; either 0, 90, 180 or 270 degrees. documents in english. i using modi extract text each image in .net 4.0 c# environment. there way read orientation of image using modi? or perhaps method accessible c# detect orientation of image? why use method? check sizes: if(img.width>img.height) //orientation=landscape else //orientation=portait

php - ModX Revo: Query Multiple TVs? -

i'm moving site modx revolution , have no experience xpdo. the site i'm moving has search feature looks through few tvs assigned resources , returns applicable pages. i'm having trouble incorporating using xpdo. i'm able return pages tv set given value, can't figure out how expand into: find resources tv1 == x, tv2 == y, tv3 == z . how can query multiple tvs @ once? $value = "mexico"; $c = $modx->newquery('modresource'); $c->innerjoin('modtemplatevarresource','templatevarresources'); $c->where(array( 'templatevarresources.tmplvarid' => 7, '"'.$value.'" in (templatevarresources.value)', )); $resources = $modx->getcollection('modresource',$c); hmmmmm think goes this: $c->where(array( 'tv1:=' => 'x' 'and:tv2:=' => 'y' 'and:tv3:=' => 'z' )); would check docs here: http://rtf...

version control - Moved a git repo - now every file has an unstaged change.. (permissions?) -

i've been working on repo making commits - went well. decided move repo in directory allow me use on local server. (i use virtual hosts still prefer keeping virtual-hosts linked specific sub directories) after moving files (plain mv on os x) had change permissions app work on system, good.. then went commit changes... every file has unstaged changes . when cloned remote in directory try , compare differences.. repo has unstaged changes on every file. the repo fine before moved it, , cloned new 1 displaying peculiar behaviour; .git file can't corrupt. thing can think of changing permissions, did new repo too. could changing permissions on directory have caused this? haven't had happen before, it's thing can think of. if so, there easy way of resolving this? it's bit of nightmare right now. i've seen 1 other similar question, doesn't appear same: sometimes git tells me every new file new , unstaged . answer question appeared users of different ...

jdbc - JdbcTemplate, MySQL error -

need help! have asked question here earlier - mysql/java error related 1 not identical (not sure of protocols @ such questions). working jdbc, mysql , encountering errors. first, code public user find(string login) { system.out.println("trying find user...." + login); user user = this.jdbctemplate.queryforobject( "select * xyz user_name = ?", new object[]{login}, new rowmapper<user>() { public user maprow(resultset rs, int rownum) throws sqlexception { user user = new user(); user.setid(long.valueof(rs.getint(1))); user.setusername(rs.getstring(2)); user.setpassword(rs.getstring(3)); return user; } }); system.out.println("found user..." + user); return user; } public void create(user user) { this.jdbctemplate.update("insert xyz (user_name,user_password) values (default, default, ?,...

http - Login to webpage from android app -

i'm quite new in android , today came across problem. want login website: http://pedidos.pizzeriabritannia.com/index.asp?opc=pedir and retrieve data source code, don't know start. give me advice or literature deal issue? thank mates! i've following code: public void postlogindata() { // create new httpclient , post header httpclient httpclient = new defaulthttpclient(); /* login.php returns true if username , password equal saranga */ httppost httppost = new httppost("http://pedidos.pizzeriabritannia.com/index.asp?opc=pedir"); try { // add user name , password list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(2); namevaluepairs.add(new basicnamevaluepair("username", "942037851")); namevaluepairs.add(new basicnamevaluepair("password", "xxxxxx")); httppost.setentity(new urlencodedformentity(namevaluepairs)); // ex...

ruby on rails - How do you test the expiration date on a cookie? -

how can access expiration time on cookie in functional test? example: assert cookies.signed[:cart_id].expires > time.now that throw error because cookies[:cart_id] returns integer. according answer , , many other pages found on web while looking solution this, not possible. it's not issue rails, it's issue how web (dom) works. you don't need test cookie expiry, web browser you. can poll cookie; if it's expired, won't exist, , value returned either nil or you'll exception, haven't tested myself.

python - Does using virtualenvwrapper with Python3.3 mean I cannot (or should not) be using pyvenv? -

virtualenvwrapper user-friendly shell around python's virtualenv. python 3.3 ships pyvenv built standard library, aims supercede virtualenv. but if install virtualenvwrapper on python3.3, still installs virtualenv, leading me believe doesn't use 'pyvenv' under covers. presumably doesn't matter - if wish use virtualenvwrapper on python3.3 should happily let use virtualenv instead of pyvenv, , (for moment) suffer no ill effects? sorry answer bit delayed. pyvenv not aim supersede virtualenv, in fact virtualenv in python 3 depends on standard library venv module. the pyvenv command creates absolutely minimal virtual environment other packages can installed. the python 3 version of virtualenv subclasses standard library's implementation , provides hooks automatically install setuptools , pip environment pyvenv doesn't on it's own. as far know virtualenvwrapper depends on virtualenv because mkvirtualenv or mkproject commands allow...

oracle - DBMS SCHEDULER Job with input -

hi have stored procedure in oracle run periodically. firstly got dbms_scheduler job compile (see below) , can see job created , drop though don't see result of stored procedure occur in table supposed effect , stored procedure has been tested. begin dbms_scheduler.create_job ( job_name => 'job_query', job_type => 'plsql_block', -- see oracle documentation on types -- job_action => 'begin runreport(''name'', ''version'', ''04-jun-13'', ''11-jun-13''); end;', start_date => to_date('2013-08-19 16:35:00', 'yyyy-mm-dd hh24:mi:ss' ), repeat_interval => 'freq=minutely;byminute=10', -- every 10 minutes. end_date => null, enabled => true, comments => 'daily jira query update'); end; i attempting make run every ten minutes though see no c...

postgresql - COPY command does not ignore sequence column -

i have database whereas first column labeled serial not null primary key . table creation , automatic sequence table creation successful. however, whenever do: copy <table_name> '/path/to/file' delimiter ',' csv header; postgresql tries read first column serial column, fails because first column in csv file contains characters (not integer). how can tell copy command populate using serial column first column? i determined if specified header names , named columns header names in csv file, import worked: copy <table_name>(column1, column2, etc) '/path/to/file' delimiter ',' csv header;

linux - Creating a file anyone can write to, but limiting who can read it -

running linux 2.6 kernel, there way create file write permission read owner , group. need update log file allow owner (usually root) , group read data in (security). this allowable in base unix permissions model. can have file can write not read it. file following permissions allow users write file. touch logfile.log chmod 662 logfile.log ls -al -rw-rw--w- 1 mmcgarrah mmcgarrah 0 aug 19 17:15 logfile.log permissions enter directory containing file other concern. make sure non-owners can traverse file or not able see file write it. write permission grants delete access file beware malicious users removing file.

c1 cms - Composite C1 Razor function - link to external URL -

i've got razor list-to-view function setup , render website url user inputs. problem @ moment clicking url causes anchor try , find page within website, when it's external link. how do this? my code rendered url: <div id="pagedetails"> <h2> @artist.artistname </h2> <p><strong>website:</strong> <a href="@artist.artistwebsite">@artist.artistwebsite</a></p> <p><strong>bio:</strong> @html.c1().body(artist.artistbio)</p> @if (!string.isnullorempty(artist.image)) { <img src="@html.c1().mediaurl(artist.image)" /><br /> } </div> the url in data type field should start http://: use ' http://www.xyz.com ' rather 'www.xyz.com'

sql - Row aggregation by time based distance -

cheers, working on postgres table create table my_table ( "id" serial, "sensorid" integer, "actorid" integer, "timestamp" timestamp without time zone, ) with example data id, sensorid, actorid, timestamp 1; 2267; 3023; "2013-07-09 12:20:06.446" 2; 2267; 3023; "2013-07-09 12:20:16.421" 3; 2267; 3023; "2013-07-09 12:20:30.661" 4; 2267; 3023; "2013-07-09 12:20:36.958" 5; 2267; 3023; "2013-07-09 12:20:49.508" 6; 2267; 3023; "2013-07-09 12:20:57.683" 7; 3301; 3023; "2013-08-15 06:03:03.428" 8; 2267; 3024; "2013-07-09 12:19:52.196" 9; 2267; 3024; "2013-07-09 12:20:16.515" 10; 2267; 3024; "2013-07-09 12:20:42.341" 11; 2267; 3025; "2013-07-09 12:21:05.98" 12; 2268; 3026; "2013-07-09 12:22:35.03" 13; 2268; 3026; "2013-07-09 12:22:45.066" 14; 3192; 3026; "2013-08-09 07:41:31.206" i want group record...

javascript - jQuery .hover only working on first li in my nav bar? -

in following code using id="nav-button" on hover create console.log can check if working. <ul> <!-- main navigation --> <li ><a id="nav-button" href="welcome/about">about</a></li> <li ><a id="nav-button" href="search-listings">search listings</a></li> <li ><a id="nav-button" href="featured">featured</a></li> <li ><a id="nav-button" href="sell-your-home">sell home</a></li> <li ><a id="nav-button" href="welcome/press">press</a></li> <li ><a id="nav-button" href="welcome/contact">contact</a></li> </ul> my javascript looks so: $( document ).ready(function() { $("#nav-button").hover( function(){ ...

css - Setting size of dialogue in angularjs -

folks using ui.bootstrap.dialog module. my question how set size of modal window. have tried following doesn't work intended: $scope.viewopts = { dialogclass: 'dialogsize', dialogopenclass:'dialogsize', templateurl: 'template/view-add-dialogue.tpl.html', controller: 'customviewmodalctrl', resolve: { headerlist: $scope.data } }; where class dialogsize defined in css file: .dialogsize { width: 800px; height: 600px } can assist me solve ? this shouldn't have angularjs, since leverages modal twitter bootstrap. need override default value of dialog's size in twitter bootsrap: https://github.com/twbs/bootstrap/blob/f95ab89fb1da85ff0fcb95c43d4fe4af359e302a/less/modals.less#l130 regarding question ask customized version of dialog, can api. can use our own dialog, means can add custom class css want. https://github.com/angular-ui/bootstrap/tree/master/src/dialog

Android App does not open alert dialog -

i'm making android application requires internet connection. when i'm connected internet, app works fine. want if i'm not connected internet, must display alert dialog notifying user needs internet connection. i'm using async task send data server. code async task : protected class sendcontacts extends asynctask<string,void,string> { @override protected string doinbackground(string... str) { string contactinfo; contactinfo=str[0]; inputstream = null; string result=new string(); httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://johnconnor.comuf.com/myphp.php"); try { list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(1); namevaluepairs.add(new basicnamevaluepair("fullinfo", contactinfo)); // namevaluepairs.add(new basicnamevaluepair("lat",latitude)); ...

iOS: method to create two views -

i want create 2 side side views add viewcontroller's view. keep repeating code, trying write generic method create 2 views me. however, code isn't working me. both view1 , view2 ivars. - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; [self makeview:view1]; [self makeview:view2]; } - (void)makeview:(uiview*)view { cgrect frame = self.view.bounds; frame.size.height = frame.size.height/2; if (view == view2) { frame.origin = cgpointmake(0, frame.size.height); } view = [[uiview alloc] initwithframe:frame]; [self.view addsubview:view]; } i think issue might deal line view == view2, sort of variable reference error. view == view2 evaluates true, view1 never shows up. , in later parts of code view1 , view2 nil. let's take step step find out answer. first, viewwillappear being called, , view1 , view2 both nil because have not set them yet. then, calling method on view1 , nil , parameter going value nil . you ...

xml - Removing leading 0 in XSLT -

i have ids coming through in xml files padded zeros, such as: <dog pet_id="00005"> when parsing this, i'd integer 5 . doing like: <xsl:value-of select="dog/@pet_id" /> retrieves "00005" what's best way 5 ? you can try: <xsl:value-of select="number(dog/@pet_id)" /> or if need convert string: <xsl:value-of select="string(number(dog/@pet_id))" />

css - Transitioning letter-spacing on Chrome -

i wondering if can confirm chrome doesn't support transitioning letter-spacing property. wasn't able find documentation on this, doesn't seem working: http://jsfiddle.net/gjjwz/ that example works expected me in firefox, in chrome 28.0.1500.95, change abrupt (no transition). i'm testing on windows 7. just increase `letter-spacing , you'll see it a:hover { letter-spacing: 50px; } http://jsfiddle.net/gjjwz/1/

python - Getting Windows error 32 process can not access file it is used by another process -

i download podcasts have long file names , i'm stripping them have city name, date , hour (meaning first, second or third hour). seems work except os.rename(file, new_name), tells me windows can't access file. import re, os, glob id3 import * files in glob.glob("f:\\download\*podcasts*"): os.chdir(files) file in os.listdir("."): if re.search("\a[1-3].",file): # original filenames begin 1.,2. or 3. tags=id3(file) date = re.search("\w*.-\w*.-\w*.",file) # filenames contain date in mmm-dd-yyyy date_clean = date.group(0).strip() hour = re.search("hr\d", file) # file names contain hr. 1,2 or 3 @ end hour_clean = hour.group(0).strip() tags['artist'] = "portland podcast" tags['title'] = date_clean + hour_clean new_name = "portland-" + date_clean + "-" + hour_clean +".mp3" print "changing",file,"to...

Is it possible to show if git branches have the same commits if the one of the branches has been rebased so they don't have the same SHA1 IDs? -

i'm trying same effect of running git branch --merged allow same commits (commit message + diff) have been rebased @ point. using git log --cherry-mark option work. specifically, can see set of commits same between branch a , branch b following: git log --cherry-mark --oneline --graph --decorate a...b example output: $ git log --cherry-mark --oneline --graph --decorate master...feature = 1e4f971 (head, feature) add greetings = 926857a add greetings = bfede5b add greetings = 14099b6 (master) add hellos = a0576fa add hellos = 8822553 add hellos in above output, see first 3 commits in output feature equivalent first 3 commits in output master , though sha ids , commit messages different. from official linux kernel git documentation git log : --cherry-mark like --cherry-pick (see below) mark equivalent commits = rather omitting them, , inequivalent ones + . --cherry-pick omit commit introduces same change commit on "other side" ...

ruby on rails - jQuery: Select2 Not disabling previously chosen values -

i have array using select2 on same values picked multiple times. there way enable functionality? code below: #home.js $(document).ready(function(){ $("#productdropdown").select2({ allowclear: true, placeholder: "select product..." }); }); then in view #index.html.erb <%= form_tag manuals_path, method: :post, remote: true %> <%= form_tag manuals_path, method: :post, remote: true %> <%= select_tag :device, options_from_collection_for_select(@products, :id, :full_name), id: "productdropdown", multiple: true %> <%= submit_tag 'create mymanual', class: 'submit', id: "generate" %> <% end %> and in controller def index @products = product.usable end

php - Variable value changes depending on domain using Laravel 4 -

in laravel 4, how can have $pathtofile = '/var/www/awesome' $mysqlserver = '111.111.111.0' when domain of site www.mysite.com , and $pathtofile = '/var/www/hackish' $mysqlserver = '111.111.111.1' when domain of site dev.mysite.com ? create different environment each domain, under bootstrap/start.php , , add specific file it, under app/start folder. in example, have: bootstrap/start.php // ... $env = $app->detectenvironment(array( 'production' => array('www.mysite.com'), 'development' => array('dev.mysite.com'), )); app/start/production.php $pathtofile = '/var/www/awesome'; $mysqlserver= '111.111.111.0'; app/start/development.php $pathtofile = '/var/www/hackish'; $mysqlserver= '111.111.111.1'; you should not though, if you're working default configuration files, same valid them. can read more on documentation .

rest - Service Stack Client for 3rd party needs a parameter called Public -

i have requirement call 3rd party rest api using service stack , working fine. but 1 of rest api's requires property called "public" is there attribute can specify give name in class use public name when calls service? so have definition in class public string public { get; set; } the error is member modifier 'public' must precede member type , name thanks ok found needed. i tried alias attribute servicestack.dataanotations.alias did nothing , not sure for? i found adding reference system.runtime.serialization needed , adorning class with [system.runtime.serialization.datacontract] now each public property needs following attribute or not pass parameter rest server. in case of property called public specifies name in datamember attribute constructor. [system.runtime.serialization.datamember] below example [system.runtime.serialization.datacontract] public class requestvoicebasesearch : voicebasebaseclass, ireturn<respon...

javascript - Why on earth is jack showing up in the sequence of alert boxes? -

object.prototype.jack = {}; var = [1,2,3]; for(var number in a){ alert(number); } could tell me why word "jack" jumped out of alert box? thank much! simple - arrays objects in javascript adding: object.prototype.jack={}; you've added enumerable property 'jack' objects (and arrays). once creating array "a" , looping through of properties for(var number in a) you sure 'jack' alert. avoid showing can use .hasownproperty() make sure alerted properties not inherited. or use regular for(var i=0; < a.length; i++) loop.

javascript - Create two functions to counts object properties/methods -

object.size = function(obj){ var size = 0, key = ""; for(key in obj){ if(obj.hasownproperty(key)){ size++; } } return size; } this first function created. mission create 2 functions, 1 counts properties , other 1 counts properties , methods. (limit counting original objec, need add functions object prototype each object create has 2 functions available automatically property.) so how do second function? (and please take @ first 1 , see if did wrong in first function?) thank much! number of properties , methods: object.keys(obj).length number of properties: #test used underscore.js function ismethod(obj, func) { return !!(obj.func && obj.func.constructor && obj.func.call && obj.func.apply); } function num_properties(obj){ var size = 0; for(key in obj){ if (!ismethod(obj, key)){ size++; } } return size; }

php - Building the web app with json only data with javascript and ORM -

i have given new project complete have separate components talk each other via services calls they not linked directly. the technical head wants build entire frontend in extjs or jquery , use json load data. mean forms , login etc json. now ahve not done that. mean have generated forms , data server side controllers , views. php or django python. i want know way or achievable because don't want chnage things after spending time initially. but way can start it i'm working on django project past 6 months, i'm using django backend service, returning json responses, , frontend code separate. jquery result in unmaintainable code, on smaller scale, need high level frontend framework. settled durandal.js , includes: knockout.js ui bindings sammy.js view routing require.js modularize code i think choice @ time, , feel productive tech stack. if start scratch again, similar stack. as extjs , it's component/widget based framework, philosoph...

I can not use EL <c:out value="${inquiryListID.id}"/> in my jsp, -

i use "working server: apache tomcat/6.0.36 servlet specification: 2.5 jsp version: 2.1" in jsp page, used el tag <c:out value="${inquirylistid.id}"/> . when renders page, displaying ${inquirylistid.id} only. its value not show. please explain me do? in page directive of jsp place attribute iselignored="false" example : <%@ page iselignored="false" %> this should display value of ${inquirylistid.id} check if works

multithreading - @Context HttpServletRequest scope in Jersey ContainerResponseFilter -

i writing jersey response filter. using jersey 1.17. want access attributes of httpservletrequest in filter api. way doing right below. safe inject servletrequest in snippet below or cause kind of concurrency issues? if there multiple requests coming in conncurrently, servletrequest in different requests overwrite each other? hlep. public class loggingfilter implements containerresponsefilter { @context private httpservletrequest servletrequest; @override public containerresponse filter(final containerrequest req, final containerresponse resp) { string s = this.servletrequest.getattribute("xxx"); .... } } section 9.1 (latest, 5.1 previously) concurrency of jax-rs specification states: context specific particular request instances of jax-rs components (providers , resource classes lifecycle other per-request) may need support multiple concurrent requests. when injecting instance of 1 of types listed in section 9.2, instance supplied must capabl...

android - Is onLoadFinished() asynchronous (background thread)? -

i looking @ using loader manager populate expandablelistview in drawerlayout. cannot find anywhere in documentation if callback function onloadfinished() running on ui thread or on background thread. on background thread? if have called init() ui thread, onloaderfinished() called on ui thread. in cases when call background example asynctaskloader thread notified outcome thread init loader. ...but still can following: @override public void onloadfinished(loader<string> arg0, string arg1) { runnable populate = new runnable(){ @override public void run() { //your code } }; if (looper.getmainlooper().getthread() == thread.currentthread()) { //on ui thread populate.run(); }else{ this.runonuithread(populate); //or use handler run runnable } } :)

flash - setInterval(); in AS -

i have 5 different images in 5 different frames, , need animate them slider. i build code: function playnextframe(){ if(_root._currentframe+1 == 7) { gotoandstop(2); }else{ gotoandstop(_currentframe+1); } } var mytimer = setinterval(playnextframe, 5000); but when click in navigations buttons (per example) but1.onrelease = function() { gotoandstop(2); }; it goes random frames @ random times :/ if can me fade effects, of great help. ^^ when click on button need clear interval no longer fires. causes random frame jumps probably. but1.onrelease = function() { clearinterval(mytimer) gotoandstop(2);};

sql - Proper Syntax for 3 table SELECT query -

i've got 3 tables: tblposts tblcomments tblusers i'm trying listing of posts along associated comments. tricky part seems getting posts , comments show proper author (user). closest posts authors incorrect. i'm grouping cfoutput on "pid", each post 1 time expect. select tblposts.pid , tblposts.title , tblposts.description , tblposts.price , tblposts.datecreated pdate , tblposts.image1 , tblcomments.comment , tblcomments.datecreated cdate , tblusers.fname , tblusers.lname tblposts left join tblcomments on tblposts.pid = tblcomments.pid left join tblusers on tblcomments.uid = tblusers.uid any thoughts? thanks! since both tables contain author id, must join tbluser twice: once posts , once comments. means must use table alias differentiate between two. along these lines, pa alias "post author" , ca alias "comment author". select p.pid ...

grouping - How to cluster images from a large dataset into groups -

i want cluster image dataset several groups using k-means, n-cut or other algorithm, don't know how process images in dataset first. these groups should have own special features. has suggestions? my suggestion go ahead , try number of features. which feature works best very dependent on use case . if hoping group photos mood, group faces users or group cad drawings type of gear on require different feature extraction approaches. have kiss few frogs find prince.

python - How to catch an exception in a decorator -

i have function cause exception , want decorator. code follow: def des(i): def new_func(func): if == 1: raise exception else: return func return new_func @des(1) def func(): print "!!" if __name__ == '__main__': try: func() except exception: print 'error' but output is: traceback (most recent call last): file "d:/des.py", line 10, in <module> @des(1) file "d:/des.py", line 4, in new_func raise exception exception so, how can catch exception? as other answers have explained, current issue you're getting exception raised when decorator applied function, not when function called. to fix this, need make decorator return function exception raising. here's how work: import functools def des(i): def decorator(func): if != 1: return func # no wrapper needed @functools.wraps(func) ...

javascript - How to find which script modifies css of selected attribute -

Image
is there way information scripts modified selected dom element, , in order? on website, modify width of div a. appears however, other script modifies width after that, not know script is. how can find it? edit: after searching bit more, fount in firebug can right click attribute in html view, , select "stop javascript on change" (or sth similar, firefox not in english), problem being resets after reloading page, makes useles me. i using chrome developer tools debug page. supports add breakpoints dom elements, when attributes of dom modified javascript, breaks rendering process immediately. think can try it.

javascript - How should I update user.profile on subsequent login (something similar to Accounts.onCreateUser)? -

i've been poking around in accounts packages, using modified version of ever-fabulous eventedmind customizing login screencast. i modified use facebook instead of github, , noticed when trying update user.profile information. specifically, i'm looking right way/place handle changes user.profile . let's say, example, authenticate fb user first time. when this, createuser event fire. using accounts.oncreateuser(...) , can populate additional information fb graph profile, so: accounts.oncreateuser(function(options,user){ var accesstoken = user.services.facebook.accesstoken, result; result = meteor.http.get("https://graph.facebook.com/"+user.services.facebook.username, { params: { access_token:accesstoken, fields: ['picture', 'name','first_name','last_name','username','link','location','bio','relationship_status','email','timezone','locale...

koala - How can I access email id's of my facebook friends -

i using koala(ruby gem/facebook api). i want access email list of facebook friend's. contacts (mac app) can access friend's email id , mobile phone no's. how can that??? i don't particularly program facebook api. wouldn't think provide direct access information not published. sights such google (gmail) , yahoo provide email addresses users associated username. facebook also. use public.username@facebook.com, person's username@yahoo.com or username@gmail.com.

c# - Create tab dynamically after some div in first tabs -

create tab dynamically after showing 20 div in first tab.actually generating div dynamically,there may 100 div generated dynamically.i want show 20 div in 1 tab , if there 100 div there automatically generate 5 tabs 20 div in each tabs. <div id="tabbedpanels1" class="tabbedpanels"> <ul class="tabbedpanelstabgroup"> <li class="tabbedpanelstab" tabindex="0">tab1</li> <li class="tabbedpanelstab" tabindex="0">tab2</li> </ul> <div class="tabbedpanelscontentgroup"> <div class="tabbedpanelscontent"> <div id="slider1" class="sliderwrapper"> <div class="contentdiv"> 12345 </div> <div class="contentdiv"> 12345 </div> </div> <div id="paginate-slider1" class="pagination"> </div> <div id="pagina...

c# - How to render anonymous model in Razor View? -

the main purpose use anonymous class pass data containing various values outside main model view without having create separate viewmodel. i found myself comfortable linq , expandoobject. however, since marked view @model ienumerable, no longer able use html helper because methods should resolved extension methods, not allowed , should throw runtime exception. @html.display("property") the problem have properties needing rendering textbox etc. editing making compulsory me make use of html helper methods editorfor(). therefore, think might return typed models. however, don't want mess project countless "temporary" viewmodels mixture of existing models. there way accomplish that? i'm wondering if there better solution composite class. you can use system.reflection class properties names. example: typeof(object).getproperties

c++ - Number to string with fixed length -

is there function in standard library work std::to_string , fixed length? std::cout << formatted_time_string << ":" << std::to_string(milliseconds) << " ... other stuff" << std::endl; in example above, milliseconds range 1 3 digits , therefore output improperly formatted. i know there lot of other options how (e.g. sprintf , calculating length etc.), inline option nice have. try use setw() format output. std::out << setw(3) << formatted_time_string << ":" << std::to_string(milliseconds)

c++ - C++11 user-defined literals -

this question has answer here: representing big numbers in source code readability? 5 answers i'm learning c++11, , interested in user-defined literals. decided play bit it. languages have syntax this: int n = 1000_000_000; i tried simulate feature in c++11. inline constexpr unsigned long long operator "" _000 (unsigned long long n)noexcept { return n * 1000; } inline constexpr unsigned long long operator "" _000_000 (unsigned long long n)noexcept { return n * 1000*1000; } inline constexpr unsigned long long operator "" _000_000_000 (unsigned long long n)noexcept { return n * 1000*1000*1000; } int main(){ constexpr auto = 100_000; // instead of 100000 constexpr auto j = 23_000_000; // instead of 23000000; } but general case couldn't simulate it, i.e. auto general_case = 123_456_789;...

java - build-impl.xml:1022: The module has not been deployed -

as first post in forum , if make mistake please forgive me. using netbeans ide 7.2.1 version , apache tomcat inbuilt in it. have web application project running nicely of sudden came error mentioned below : deploy? config=file%3a%2fc%3a%2fusers%2fsourya%2fappdata%2flocal%2ftemp%2fcontext2934387861047212056.xml&path=/employeeinformationsystem http://localhost:8084/manager/text/deploy?config=file%3a%2fc%3a%2fusers%2fsourya%2fappdata%2flocal%2ftemp%2fcontext2934387861047212056.xml&path=/employeeinformationsystem o:\netbeansproject\employeeinformationsystem\nbproject\build-impl.xml:1022: module has not been deployed. see server log details. there previous thread mentioning problem could'nt find proper solution among that. have tried build & clean several times still no solution. link in above mentioned error i.e in xml line 1022 codes : 1021 <target if="netbeans.home" name="-run-deploy-nb"> 1022 <nbdeploy clienturlpart="${cli...

jquery - Keydown Not Triggered Only on Button w/ "contenteditable" Tag -

i using contenteditable="true" tag make content in tags editable. can edit content in element tag, problem arises when try detect keydown event jquery. jsfiddle demo note "hello world", in paragraph element, editable. button text "i'm button" editable, inside button element. when type in paragraph element, keypresses incremented each key pressed. however, when type in button element, keypresses not incremented. problem. apparently, keydown event not being detected inside button element, though being detected inside paragraph element. to demonstrate not problem way js written, clicking either paragraph or button element increment clicks counter. so question is, why isn't keydown event being detected inside button element, , can detect it? how work-around? jsfiddle : http://jsfiddle.net/va74w/ putting button content in span contenteditable=true html <button>&nbsp;<span contenteditable='true...