Posts

Showing posts from February, 2010

Paypal IPN Broadcast to multiple websites -

this question has answer here: paypal multiple ipn setup 2 answers i've been trying find solution months couldn't... paypal allows me put 1 ipn address, need more 1 membership sites work , other scripts. how can paypal ipn message broadcast multiple locations instantly? please tell me in newbie way. thanks! how processing paypal payments? with paypal payments standard, can supply different notify_url each membership site used ipn endpoint transactions' notification.

python - ckanext-harvest 2.0: automatically add harvested records to an organization -

Image
https://github.com/okfn/ckanext-harvest/blob/release-v2.0/readme.rst#the-ckan-harvester mentions can specify "default_groups" config option in order have harvested records added group. does still work in ckan 2.0? there analogous "default_organizations" config parameter? i've tried use "default_groups" parameter putting json object form @ /harvest/edit/my-source { "default_groups": ["my-group"] } a group called "my-group" exists, i'm updating harvested packages, not creating new ones. fetch_consumer logs: 2013-04-17 15:34:07,707 debug [ckanext.spatial.harvesters.base.import] import stage harvest object: 66b01129-bcce-4bc8-9a67-1d7ece67b998 2013-04-17 15:34:07,708 debug [ckanext.spatial.harvesters.base] using config: {u'default_groups': [u'my-group']} 2013-04-17 15:34:07,713 debug [ckanext.spatial.validation.validation] starting validation against profile(s) iso19139 2013-04-17 15:34:07,

ios - Getting data from API, need to filter results -

i'm working data foursquare api. i want list of coffee shops, , getting correctly (i'm using restkit)... once list, on end need filter out coffee shop "starbucks". so right know how pull in coffee shops, don't know how parse data once have before serve app table view there no starbucks coffee shops listed. any ideas how that? let me know if need of code snippets posted might help. thanks! edit normal response type api be: "venue": [{ "name": "abc coffee shop", { so need take "name" , filter out name "starbucks" . if foursquare doesn't let apply filter request, filter on name "starbucks" following. i start deserializing response json object, in case dictionary. nserror *error = nil; nsdictionary *responsedict = [[nsjsonserialization jsonobjectwithdata:foursquareresponse options:0 error: &error]; nsarray *starbucks = nil; if (!error) { nsarray *coffeeshops =

Can't read an uploaded file with Ruby's Framework Padrino -

i have form uploading files: -# coding: utf-8 - content_for(:body_classes, "body3") .content - form_tag url(:images, :create), :method => :post, :multipart => true = file_field_tag :file = submit_tag "upload" and controller handle it: fbapp.controllers :images :new render 'images/new' end post :create require 'net/ftp' file = params[:file] ftp = net::ftp.new('xxx.xxx.xxx.xxx') ftp.passive = true ftp.login('user','pass') ftp.storbinary("stor " + "original_filename", stringio.new(file.read), net::ftp::default_blocksize) ftp.quit end end and every time try upload file "internal server error". , log has this: nomethoderror - undefined method `read' #<hash:0x00000003697780>: i'm trying on heroku way. can't figure out what's problem... seems work lot of people me. you should use: file = params[:fil

php - Posting several vars via JavaScript -

i want post via javascript several vars can't, doesn't anything. after script done running, want send vars via post can read them "$_post" , use them in php script here example of script function finish() { var cnt1 = 50; var tim = 60; var hecho = 1; $.post("index.php", { t:tim }, { m:cnt1 }, { e:hecho } ); } i this: top.location.href="index.php?e="+hecho+"&t="+tim+"&m="+cnt1; but don't want use because users see variables, want use post bit harder hack. what doing wrong? you put variables single object: $.post("index.php", { t:tim, m:cnt1, e:hecho } );

MYSQL query using Left Join and Where IN clause -

i have 3 tables b c , i'm trying retrieve information three. a has columnns userid avatar username , b has column postid, dateshared , c has column commenter postid datecommented. i'm trying run query select c.comment, c.commenter, c.datecommented, b.postid, b.dateshared a.username a.avatar b left join c left join on c.postid = b.postid , a.userid = c.commenter b.postid in ('1','2','3') order c.dateshared desc but gives following error: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'where b.postid in ('1', '2', '3') order c.dateshared ' can point out i'm doing wrong or suggest how go it? each left join requires own on condition: select c.comment, c.commenter, c.datecommented, b.postid, b.dateshared, a.username a.avatar b left join c on c.postid = b.postid left join on a.userid = c.commenter b.postid in (

Specifying a FilterSet for Django-rest-framework -

the tutorial said: class productfilter(django_filters.filterset): min_price = django_filters.numberfilter(lookup_type='gte') max_price = django_filters.numberfilter(lookup_type='lte') class meta: model = product fields = ['category', 'in_stock', 'min_price', 'max_price'] but when try this, error: fielderror: cannot resolve keyword u'min_price' field. choices are: cantidad, datetime, enlace, id, id_fila, nivel min_price not in models, need create new parameter. (it example) need filter dates. see django-filter documentation . since min_price , max_price filters don't have same name model field refer too, need provide name argument. class productfilter(django_filters.filterset): min_price = django_filters.numberfilter(name='price', lookup_type='gte') max_price = django_filters.numberfilter(name='price', lookup_type='lte') class m

javascript - What does the exclamation mark do before the function? -

!function () {}(); javascript syntax 101. here function declaration : function foo() {} note there's no semicolon: function declaration . need invocation, foo() , run function. now, when add seemingly innocuous exclamation mark: !function foo() {} turns expression . function expression . the ! alone doesn't invoke function, of course, can put () @ end: !function foo() {}() has higher precedence ! , instantly calls function. so author doing saving byte per function expression; more readable way of writing this: (function(){})(); lastly, ! makes expression return true. because default iife return undefined , leaves !undefined true . not particularly useful.

How can I use jQuery file upload in webmatrix (ASP.NET Web Pages)? -

i use jquery file upload website https://github.com/blueimp/jquery-file-upload , according documentation need create own file upload handler , wondering if has had experience using jquery file upload in webmatrix site? and also, can't find info need create own file upload handler. if can that, awesome. blueimp painful plugin......i advice use this plugin form , file upload. simpler configure , flexible. problem blueimp isnt getting plugin ready use. painful on server side both on asp.net mvc , asp.net webmatrix.

javascript - Carousel not working on jQuery Galleria -

i using galleria jquery slideshow , i'm having issue carousel of thumbnails on bottom. know within code, if 'carousel' present (too many thumbnails display on main page) thumbnails-container div has class of .carousel added it. not happening on mine, it's showing overflowed thumbnails. right , left nav items have .disabled class added them on load. is there known issue of why happen? can't seem figure out issue is. error in console on load "uncaught error: fatal error: not extract stage height css. traced height: 0px." don't believe related (it though). slideshow loads alright error , works except carousel. help! you have set option carousel:false somewhere. (http://jsfiddle.net/fgbn7/4/)

oracle - SQL script not executing in bash -

i running sql script bash. 1 of scripts seems running fine, other script fails. can please advise might cause same? #!/bin/bash sqlplus -s user/password@database << eof whenever sqlerror exit sql.sqlcode; set echo off set heading off @myscript1 @myscript2 exit; eof error: sp2-0310: unable open file "myscript2.sql" in unix access level both is: -rwxrwxrwx myscript1.sql -rwxrwxrwx myscript2.sql the error give indication not able access file myscript2.sql . curious how come can access myscript1.sql present in same folder, not myscript2.sql ? also if run file in unix (using sql*plus) folder files present works fine. if run same different folder doesn't. below example explain better /folder/having/the/files both myscript1.sql , myscript2.sql run fine /some/random/folder myscript1.sql runs fine , myscript2.sql errors out you said: if run file in unix (using sql*plus) folder files present works fine. if run same differe

Implementing virtual concepts in rails -

my question more of general nature. i know scopes in rails running concept not able wrap my head around i have few tables in db - customers, products, sales etc. , have various sales persons logging in view sales, etc. want implement concept of "my" when sales person comes in able see sales, customers, products sold etc. my.customers or my.sales or my.territories etc. how can implement this? how can prefix "my" onto customers, sales etc achieve elegantly ? guidance appreciated. thanks, you should take at: http://guides.rubyonrails.org/active_record_querying.html this use associate , manage user sees, , how access in controllers/views. example: class client < activerecord::base has_many :sales end class sale < activerecord::base belongs_to :client end this make client has many sales, , can access using client.first.sales... example. to make my instead of user.first , can use: private def user.first end

c# - How do I add the user ID To authenticate a cookie in mvc4 -

how add user id ti authenticated cookie using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; using system.web.security; using system.security.cryptography; using system.text; namespace project.controllers { public class logincontroller : controller { // get: /login/ private datacontext db = new datacontext(); public actionresult index() { return view(); } [httppost] public actionresult index(loginmodel model) { if (modelstate.isvalid) { string username = model.username; user login = db.users.where(m => m.name == username).first(); string pass = convert.tobase64string(new md5cryptoserviceprovider().computehash(new utf8encoding().getbytes(model.password))); if (login != null && pass == login.password) { formsa

java - Painting a visual of Selection Sort -

Image
i doing program creates array of 50 numbers, paints them in panel rectangles, size based on number. when panel clicked, array sorted , panel redrawn show sort of animation of numbers being sorted. here's it's supposed before , after clicking panel: picture http://oi47.tinypic.com/o57scm.jpg and here code have: public class animatedselectionsortpanel extends javax.swing.jpanel { int[] numbers = new int[50]; int min = 20; int max = 100; private void loadarray() { int num; (int = 0; < numbers.length; i++) { numbers[i] = min + (int) math.random() * ((max - min) + 1); } } public static void selectionsort(int[] x) { (int = 0; < x.length - 1; i++) { int minindex = i; // index of smallest remaining value. (int j = + 1; j < x.length; j++) { if (x[minindex] > x[j]) { minindex = j; // remember index of new minimum } } if (minindex != i) { //... exchang

How to kill a PostDelayed Method in Android -

this question has answer here: post delay method - android 3 answers i used posteddelayed method refresh activity, works fine. problem when press button postdelayed method call previous activity.. //handler 30000 milli-secs post delay refreshment of activity mhandler.postdelayed(new runnable() { public void run() { dostuff(); } }, 30000); } protected void dostuff() { intent intent = getintent(); finish();startactivity(intent); toast.maketext(getapplicationcontext(), "refreshed", toast.length_long).show(); } public void onbackpressed() { super.onbackpressed(); finish(); mhandler.removecallbacks(null); } protected void onstop() { mhandler.removecallbacks(null); super.onstop(); } you use may you runnable runobj=new runnable() { public void run

html - div aligned to the right: incorrect scrollbar -

i have markup this: <div id="maindiv" style="position: fixed; width: 100%; height: 100%;"> <div id="log" style="float: right; max-height:100%; overflow: scroll;"> (some filling text) </div> </div> it works ok, except fact half of log's vertical scrollbar shown (ff, chrome). ideas how fix this? this because body has margin. remove , should work. body { margin:0; } here's js bin: http://jsbin.com/ajicox/1/

android - Implicit intent call scan -

i new android development. , trying build app scans installed apps implicit intend calls. if application has implicit call app shows name of apps. can provide me concept on how it? if not possible, possible notify when application gets called implicitly? you can list of installed apps querying packagemanager , launch intent each package. (that packages category intent.category_launcher final packagemanager pm = getpackagemanager(); //get list of installed packages. list<applicationinfo> packages = pm.getinstalledapplications(packagemanager.get_meta_data); (applicationinfo packageinfo : packages) { log.d(tag, "installed package :" + packageinfo.packagename); log.d(tag, "launcher activity :" + pm.getlaunchintentforpackage(packageinfo.packagename)); }

Extract outlook message body text with VBA from Excel -

i have huge number of outlook .msg , outlook .eml files saved shared network folder (ie outside of outlook). trying write vba in excel extracts subjects,sender, cc, receiver, senttime, sentdate, message body text each file , import these info excel cells orderly subject sender cc receiver senttime sentdate re:.. mike jane tom 12:00:00 23 jan 2013 i've done similar thing word documents i'm struggling 'get at' text in .msg files. so far have code below. think i'm on right track @ least, i'm stuck @ line i'm trying set reference msg file. advice appreciated... dim myoutlook outlook.application dim mymail outlook.mailitem set myoutlook = new outlook.application set mymail = dim filecontents string filecontents = mymail.body regards so i've been able working .msg files saved outside of outlook. however, don't have access outlook express have no way of saving .eml files @ moment. here's sub i

c - macro to check if the return value of a function is being checked -

i have function void *custom_get_value(objectptr) this function traditionally never used return null.it can return of following values uint32_t int32_t uint64_t int64_t uint8_t since function never used return null have lot of code *(uint32_t*)custom_get_value(objectptr) or *(uint64_t*)custom_get_value(objectptr) recently have decided modify behaviour of void *custom_get_value(objectptr) in such way can return null.so occourances of above scenario (de-referencing specific types without checking return value) can result in segmentation fault. can use macro idendify places in code return value of void *custom_get_value(objectptr) is not being checked.if yes how do that? you can't write macro can track happens value after it's been returned, because data flow analysis beyond preprocessor's abilities. however, there useful technique designed situations such this, define function want check self-referential

Android development, retrieving values from a string array -

i have array in xml <string-array name = "locations"> <item value = "kdlh">duluth international airport</item> <item value = "kbji">bemidji</item> <item value = "kaum">austin municipal</item> <item value = "kbde">baudette international airport</item> <item value = "kbbb">benson municipal</item> <item value = "kcbg">cambridge municipal</item> <item value = "kcqm">cook municipal airport </item> <item value = "kcoq">cloquet</item> <item value = "ktob">dodge center airport </item> <item value = "kevm">eveleth</item> <item value = "klxl">little falls</item> <item value = "kmml">marshall</item> <item value = "kane">minneapolis / blaine <

javascript - How to create .XAP extension file for windows phone -

i have created new windows 8 javascript project using phonegap, my question how can .xap extension file in bin folder mandatory run application on windows device. and tell me 1 thing there other solution make .xap extension file. because of using javascript not getting .xap extension file. first of need check configured windows 8 or windows phone 8 . if compile windows phone project can xap project. bin>>debug>>your project.xap

c++ - Qt QPainterpath.h errors -

i working on qt application many #include files qt library. project quite large , have encountered strange problem when building. errors displayed inside qpainterpath.h file, has nothing calls project. errors this: c:\qt\4.8.4\include\qtgui../../src/gui/painting/qpainterpath.h(397) : error c2143: syntax error : missing ';' before '::' c:\qt\4.8.4\include\qtgui../../src/gui/painting/qpainterpath.h(397) : error c2059: syntax error : '::' c:\qt\4.8.4\include\qtgui../../src/gui/painting/qpainterpath.h(398) : error c2143: syntax error : missing ';' before '{' c:\qt\4.8.4\include\qtgui../../src/gui/painting/qpainterpath.h(398) : error c2447: '{' : missing function header (old-style formal list?) c:\qt\4.8.4\include\qtgui../../src/gui/painting/qpainterpath.h(405) : warning c4003: not enough actual parameters macro 'elementcount' i encountered once before , able solve moving qt #include statement

mysql - Whats wrong with this python sql statement -

i have db schema in mysql id int(11) pk ai apt_id varchar(200) checkin_date date checkout_date date price decimal(10,0) deposit decimal(10,0) adults int(11) source_id int(11) confirmationcode varchar(100) client_id int(11) booking_date datetime note mediumtext related tables:property (apt_id → apt_id) booking_source (source_id → id) i trying insert value in db using following query self.start_at = datetime.strptime(self.start_at[0:10] + ' ' + self.start_at[11:19], "%y-%m-%d %h:%m:%s") self.end_at = datetime.strptime(self.end_at[0:10] + ' ' + self.end_at[11:19], "%y-%m-%d %h:%m:%s") x = db.cursor() sql = """insert `nycaptbs`.`booking` (`apt_id`, `checkin_date`, `checkout_date`, `price`,`deposite` `adults`, `source_id`, `confirmationcode`, `client_id`, `booking_date`) values ('%s','%s','%s','%s','%s','%s','%s','%s','%s',

browser history - Which one should I use? Backbone.js Router.navigate and window.location.hash -

i began learning backbonejs recently, reading book. , feel little bit confuse issue.here router: define(['views/index', 'views/login'], function(indexview, loginview) { var selinkrouter = backbone.router.extend({ currentview: null, routes: { 'home': 'home', 'login': 'login' }, changeview: function(view) { if(null != this.currentview) this.currentview.undelegateevents(); this.currentview = view; this.currentview.render(); }, home: function() { this.changeview(indexview); }, login: function() { this.changeview(loginview); } }); return new selinkrouter(); }); and boot method of application: define(['router'], function(router) { var initialize = function() { // require home page server $.ajax({ url: '

Android developing - Making a wireless (Bluetooth/Wi-fi) Keyboard for Computers -

i ask studies needed me turn smartphone wireless keyboard , use desktop/laptop/etc...? how achieve step step? lot helping. you require app has keyboard layout (or use android softkey) , send key press code computer via bluetooth. you computer should have interface software can receive incoming keystroke signal , convert os signal. actually there app in market has same functionality https://play.google.com/store/apps/details?id=com.iandrobot.andromouse.lite&hl=en

javascript - What are "decorators" and how are they used? -

i'm curious decorators in angularjs. there isn't information online decorators save blurb in angularjs documentation , brief (albeit interesting) mention in youtube video . as angular guys put decorator is: decoration of service, allows decorator intercept service instance creation. returned instance may original instance, or new instance delegates original instance. i don't know means , , i'm not sure why separate logic service itself. example if wanted return different under different conditions pass different arguments relevant functions or use function sharing private state. i'm still kind of angularjs noob i'm sure it's ignorance and/or bad habits i've picked up. a use case of $provide.decorator when need minor "tweak" on third-party/upstream service, on module depends, while leaving service intact (because not owner/maintainer of service). here demonstration on plunkr.

How to mark common elements as checked in checkbox php array -

i have 2 arrays. elements of second array $array2 displayed through check boxes. want common elements of both lists marked checked , rest left unchecked. $array1 = array("a", "b"); $array2 = array("a", "b", "c", "d"); $common = array_intersect($array1, $array2); printf('<input type="checkbox" %s ...>', in_array('a', $common) ? 'checked' : null);

unix - Appending multiple files into one file -

i append multiple data files single data file using cat command. how can assign single file value new file? i using command: cat file1 file2 file3 > newfile.txt anotherfile=`cat newfile.txt` sort $anotherfile | uniq -c it showing error can not open anotherfile how assign newfile value file? original answer original question well, easiest way cp : cat file1 file2 file3 > newfile.txt cp newfile.txt anotherfile.txt failing that, can use: cat file1 file2 file3 > newfile.txt anotherfile=$(cat newfile.txt) echo "$anotherfile" > anotherfile.txt revised answer revised question the original question had echo "$anotherfile" third line; revised question has sort $anotherfile | uniq -c third line. assuming sort $anotherfile not sorting contents of files mentioned in list created concatenating original files (that is, assuming file1 , file2 , file3 not contain lists of file names), objective sort , count lines found in source fi

Quartz Document and Wiki - Contradict on Cron Expression for Day of Month field -

here in wiki http://en.wikipedia.org/wiki/cron_expression#cron_expression under subheading "predefined scheduling definitions" its mentioned "day of week (0 - 7) (0 or 7 sunday, or use names)" its referring 0 or 7 sunday and under subheading "cron expression" its referring "the last friday" ("5l") of given month. in day-of-month field, but quartz documentation here http://quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger contradicts things saying "day of week 1-7 or sun-sat" (its not 0-7 mentioned in wiki) and in special characters subheading its referring "6l" means "the last friday of month" (in wiki 5l) so question is which 1 correct ? are both of these correct in own context ? (meaning quartz quartz , in wiki unix based os) yes both correct. wikipedia article refers cron implemented in unix , derivatives. the quartz scheduler has i

java - Run AspectJ with load-time weaving on a RCP .exe application. How? -

i'm in desperate need run aspectj code (weaving @ load-time) application under consideration being deployed rcp executable. possible run aspectj against rcp application? if not, there sane ways circumvent issue? thanks instead of deleting question, i'll answer here believe useful in future. it possible so. you'll have run rcp application, open jvisualvm , jvm arguments, java arguments, main class. that, we're set launch rcp application through java command standard way.

apache - Openfire + Candychat 500 Internal error -

hi new xmpp protocol , trying build simple web-based chat app using openfire , candychat. currently running webserver using xampp (c:\xampp). have openfire installed @ c:\openfire. i forked candychat via github , put inside xampp/htdocs. my .htaccess file looks this: adddefaultcharset utf-8 options +multiviews rewriteengine on rewriterule http-bind/ http://localhost:7070/http-bind/ [p] while index.html (under example folder of candychat) looks (i omitted of codes): <script type="text/javascript"> $(document).ready(function() { candy.init('http-bind/', { core: { debug: true }, view: { resources: 'res/' } }); candy.core.connect(); }); </script> when try access via apache (via web browser) went normal, proper login screen. enter username + password firebugs detects there 500 error ("networkerror: 500 server error"). looking openfire admin page (specifically event lo

mysql - Using max function, group by and join -

i have 3 tables: create table if not exists `disksinfo` ( `idx` int(10) not null auto_increment, `hostinfo_idx` int(10) default null, `id` char(30) default null, `name` char(30) default null, `size` bigint(20) default null, `freespace` bigint(20) default null, primary key (`idx`) ) create table if not exists `hostinfo` ( `idx` int(10) not null auto_increment, `host_idx` int(11) default null, `probetime` datetime default null, `processor_load` tinyint(4) default null, `memory_total` bigint(20) default null, `memory_free` bigint(20) default null, primary key (`idx`) ) create table if not exists `hosts` ( `idx` int(10) not null auto_increment, `name` char(30) default '0', primary key (`idx`) ) basicaly, hosts ist fixed list of hostnames used in hostinfo table (hostinfo.host_idx = hosts.idx) hostinfo table filled each few minutes data hosts , in addition, each hostinfo row @ least 1 diskinfo row created. each diskinfo row contains inform

java - running selenium webdriver test cases against multiple browsers -

i new selenium testing. want run selenium test cases on multiple browsers against internet explorer, firefox, opera , chrome. approach have follow. can people please suggest me best process. does selenium web driver supports multiple browsers or not??? we had written login script. runs successful firefox, chrome , internet explorer individually. want run multiple browsers sequentially. web driver supports multiple browsers of course, there support mobile chromedriver iediver firefoxdriver operadriver androiddriver here exemple run same tests in multiple browsers. package ma.glasnost.test; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; ......... desiredcapabilities[] browserlist = {desiredcapabilities.chrome(),desiredcapabilities.firefox(),desiredcapabilities.internetexplorer(), desiredcapabilities.opera()}; (desiredcapabilities browser : browserlist) { try { system.out.printl

linux - Gstreamer video output position tracking and seeking -

i using gstreamer (gst-launch) capture camera , save stream both video , image frame. problem of pipeline is, when pipeline finishes (by interrupt) video record, can not support position tracking , seeking. hence, video played in vlc player unknown lenght. think problem @ pipeline itself. how can achieve support position tracking , seeking. here below can see gstreamer pipeline code: gst-launch -v --gst-debug-level=0 \ v4l2src device=/dev/video0 \ ! videorate \ ! video/x-raw-yuv, width=320, height=240, framerate=5/1 \ ! tee name=tp tp. \ ! queue \ ! videobalance saturation=0.0 \ ! textoverlay halign=left valign=top text="(c)park on om " shaded-background=true \ ! clockoverlay halign=right valign=top time-format="%d %t " text="date:" shaded-background=true \ ! queue \ ! ffmpegcolorspace \ ! ffenc_mpeg4 \ ! avimux \ ! filesink location=/ram/pmc/recordca

ASP.NET AJAX Animation work fine in Localhost but not work in ip host -

if run on machine using localhost:56993/website7/default.aspx works fine if run using 192.168.1.3/website7/default.aspx address page opens when click click on textbox no fadein happens: <%@ page language="vb" autoeventwireup="false" codefile="default.aspx.vb" inherits="_default" %> <%@ register assembly="system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" namespace="system.web.ui" tagprefix="asp" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="asp" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>untitled page</title> </head> <body> <form id=

css - CSSinherit padding, then lessen the number -

i have class added various sections of site show section editable. class named .editable when user logged in, when hover on such section red dashed border shown around section. i so: .editable { /* add padding act clear border */ padding:1px; } .editable:hover { /* remove padding , add border */ padding:0px; border:1px dashed red } as shown in comments, add 1px padding when border shows on hover, section doesn't 'move'. the problem arises when section edited has padding. e.g. .sectiontobeedited { padding:10px; } when add .editable class <div class="sectiontobeedited editable">blah</div> padding overwritten. question there way inherit padding setting , add 1px it? on hover reduce whatever padding 1px. i know way wrap editable sections in separate divs , apply padding there involves rewriting , adding lot of classes , divs. or there way this? css can override values, there no support mathematical oper

rrule - Express alternative recurring times in iCalendar -

is there way express following in icalendar? (possibly using rrules?) between 9am , 5pm every day except sundays when between 10am , 4pm. can create multiple rrules? ones have precedence? icalendar not have notion of events hole in middle of duration. without talking recurring event, can not create single event 9am 10am , 4pm 5 pm as consequence, need create 3 events: dtstart:2013xxxxt090000 duration:pt1h rrule:freq=daily dtstart:2013xxxxt100000 duration:pt6h rrule:freq=daily;byday=mo,tu,we,th,fr,sa dtstart:2013xxxxt160000 duration:pt1h rrule:freq=daily as far having multiple rrule, supported in rfc2445 has been deprecated in rfc5545 (just exrule) due lack of support , complexity.

android - Disable smooth animation when clicking on tabs using ViewPagerIndicator -

i'm using tabpageindicator viewpagerindicator lib viewpager display 6 fragments. suppose i'm on 1st page, if click 6th tab i'll see pages scrolled. possible disable animation? maybe can somehow disable in viewpager? here code of adapter: public class tabbarfragmentpageradapter extends fragmentpageradapter implements iconpageradapter { private final list<fragment> items; private static final string[] titles = new string[] { "home", "profile", "explore", "contacts", "beacon" }; private static final int[] icons = new int[] { r.drawable.icon_tabbar_home_bg, r.drawable.icon_tabbar_profile_bg, r.drawable.icon_tabbar_explore_bg, r.drawable.icon_tabbar_contacts_bg, r.drawable.icon_tabbar_beacon_bg }; public tabbarfragmentpageradapter(fragmentmanager fm, list<fragment> items) { super(fm); this.items = items; } @override public fragment getitem(int position) { r

delphi - Prevent XSLT transform from converting utf-8 XML into utf-16? -

in delphi xe2, i'm doing xslt transform on received xml file remove namespace information. problem: changes <?xml version="1.0" encoding="utf-8"?> into <?xml version="1.0" encoding="utf-16"?> this xml exchange server: <?xml version="1.0" encoding="utf-8"?> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:header> <h:serverversioninfo majorversion="14" minorversion="0" majorbuildnumber="722" minorbuildnumber="0" version="exchange2010" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"/> </s:header> <s:body xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" x

css - padding an <a> element inside a <div> to achieve a clickable box -

Image
on website: http://www.bestcastleintown.co.uk/pg/ i trying coloured area of each <div class="awards_square_home"> click-able link nesting <a> tag inside <div> , adding padding. using padding on <div> position <a> . padding in rule: .awards_square_home { border: 10px solid rgb(195, 195, 195); height: 90px; margin-bottom: 20px; padding: 90px 20px 20px; } now when add padding element not spreading padding in way desire, to make entire coloured area of div click-able. .awards_square_home { padding: 120px 0 20px; } i trying make <a> fill area of <div> : if did not misunderstand you, want div clickable rather text only. <a href="#" class="text220 centertext capitalise_text home_feature_turqoise ng"> <div class="awards_square_home turqoise podium"> <span>best</span> <span>university</span> <sp

php - Warning: move_uploaded_file() failed to open stream -

i trying upload file on ftp. here code $jname= "accounts of biotechnology research"; if (!is_dir('/trade/upload/ '.$jname)) { mkdir('/trade/upload/ '.$jname); // line 63 } move_uploaded_file($_files["submission_file"]["tmp_name"], "/trade/upload/$jname/" . $dup_name ); // line 67 trade folder inside public_html folder. when uploading file gives me warning like, warning: mkdir() [function.mkdir]: no such file or directory in /home/my_username/public_html/trade/upload.php on line 63 warning: move_uploaded_file(/trade/upload/accounts of biotechnology research/76164762-sm.pdf) [function.move-uploaded-file]: failed open stream: no such file or directory in /home/my_username/public_html/trade/upload.php on line 67 warning: move_uploaded_file() [function.move-uploaded-file]: unable move '/tmp/phphzxp0o' '/trade/upload/accounts of biotechnology research/76164762-sm.pdf' in /

c++ - static variable cpp do not want to change -

filea.hpp: static int a; void change(int); filea.cpp #include "filea.hpp" void change(int x) { = x; } main.cpp #include "filea.hpp" #include <cstdlib> #include <iostream> int main() { = 5; std::cout<<a<<std::endl; change(10); std::cout<<a<<std::endl; = 20; std::cout<<a<<std::endl; system("pause"); return 0; } my output is: 5 5 20 can me this? why variable 'a' don't want change in function in filea.cpp. how fix this. when make change(int x) inline in "filea.hpp" works fine. the static keyword on global variable gives variable internal linkage. means translation unit has definition have own copy of object. a object main.cpp sees , filea.cpp sees different objects. change modify 1 of them, main output other. if intending static mean object has static storage duration, global variables (or variables @ namespace scope in ge

Installing VCL component in Delphi & C++ Builder -

i created vcl component in delphi xe2 , want install in entire rad studio (both delphi & c++ builder). the problem is, if install component in delphi linker error "*.obj file cannot found" in c++ builder. solve manually adding component's lib file project avoid that. solution found uninstall component , install in c++ builder itself. but, have problem using component in delphi... my component project settings set "generate c++ builder files..". what have component installed in both ide's , work intended? don't forget have (or supposed have) 2 packages: runtime , design-time.

r - dividing a long column to many short ones by a condition -

i have long column of numbers. want r make new column every time value changes zero. example column: 90.1194354 87.94788274 80.34744843 64.06080347 30.40173724 0 0 0 0 0 16.28664495 23.88707926 29.31596091 48.85993485 13.02931596 0 0 0 7.600434311 20.62975027 29.31596091 32.5732899 for example want 3 columns. thanks! i don't know how expect have columns of different lengths. pad them na ? this solution uses rle , splits vector list : temp <- c(90.1194354, 87.94788274, 80.34744843, 64.06080347, 30.40173724, 0, 0, 0, 0, 0, 16.28664495, 23.88707926, 29.31596091, 48.85993485, 13.02931596, 0, 0, 0, 7.600434311, 20.62975027, 29.31596091, 32.5732899) x <- rle(temp == 0) split(temp, rep(seq_along(x$lengths), times = x$lengths))[c(true, false)] # $`1` # [1] 90.11944 87.94788 80.34745 64.06080 30.40174 # # $`3` # [1] 16.28664 23.88708 29.31596 48.85993 13.02932 # # $`5` # [1] 7.600434 20.629750 29.31596

c# - How to check whether the URL is valid or not -

this question has answer here: c# how can check if url exists/is valid? 10 answers i have 1 textbox in user enter url, if want check url while page rendering do? here code: protected void btnrender_click(object sender, eventargs e) { string strresult = string.empty; webresponse objresponse; webrequest objrequest = system.net.httpwebrequest.create(urltxt.text); objresponse = objrequest.getresponse(); using (streamreader sr = new streamreader(objresponse.getresponsestream())) { strresult = sr.readtoend(); sr.close(); } strresult = strresult.replace("<form id='form1' method='post' action=''>", ""); strresult = strresult.replace("</form>", ""); textbox1.text = strresult.trim(); div.innerhtml = strresult.trim(); } i have c

java - FOP - how to avoid high memory consumption with very high number of page-sequences? -

how can avoid fop consume growing amount of memory when pages not contain forward-references , < page-sequence> blocks small? here's test java program feeds fop hand made fo repeats on , on same basic page-sequence: fo2pdf.java import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.outputstream; import java.io.pipedinputstream; import javax.xml.transform.result; import javax.xml.transform.source; import javax.xml.transform.transformer; import javax.xml.transform.transformerfactory; import javax.xml.transform.sax.saxresult; import javax.xml.transform.stream.streamsource; import org.apache.fop.apps.fouseragent; import org.apache.fop.apps.fop; import org.apache.fop.apps.fopfactory; import org.apache.fop.apps.mimeconstants; import org.xml.sax.helpers.defaulthandler; public class fo2pdf implements runnable { private pipedinputstream in; public fo2pdf(pipedinputstream in) { this.in = in; } @override public void run() { // ins