Posts

Showing posts from April, 2015

html - Hidden web hit counter -

html - Hidden web hit counter - i know how can implement hidden nail counter. want because want have raspberry pi project lite goes on every time website hit, don't want show counter on website. it website right? can have counter within div this: <div class="hitcounter"></div> and hide using css: .hitcounter {display: none;} this way, counter nowadays in dom , won't visible in viewport. :) html website hitcounter

javascript - Why is the id not changing? -

javascript - Why is the id not changing? - i'm trying alter colour of text. alter id on div tag ,using javascrip,t different css rules apply. home.html <html> <head> <link rel="stylesheet" type="text/css" href="style-original.css" /> <meta charset="utf-8" /> <title>test</title> <script type="text/javascript"> <!-- function change() { document.getelementbyid("part1").classname = "part2" } //--> </script> </head> <body> hello.<br /> <div id="part1">test test.</div><br /> <input type='button' onclick='change()' value='form checker' /> </body> </html> style-original.css #part1 { color: #ff0000; } #part2 { ...

Read Matlab matrix into Python -

Read Matlab matrix into Python - when i'm trying read matlab matrix python, next error >>> scipy.io.loadmat("dynamical.mat") traceback (most recent phone call last): file "<stdin>", line 1, in <module> file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 151, in loadmat mr = mat_reader_factory(file_name, appendmat, **kwargs) file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 105, in mat_reader_factory mjv, mnv = get_matfile_version(byte_stream) file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/miobase.py", line 221, in get_matfile_version % ret) valueerror: unknown mat file type, version 46, 48 the dynamical.mat file containing matrix % size = 30 30 % nonzeros = 252 zzz = zeros(252,3); zzz = [ 1 1 1.4019896354966477e+01 1 2 0.0000000000000000e+00 1 3 0.0000000000000000e+00 ... this question seems inactive while, allow 1 alte...

Basic Fluent NHibernate relationship issue -

Basic Fluent NHibernate relationship issue - the project working on @ moment using entity framework, there issues have come across , hence researching using nhibernate believe sort out bulk of issues have. anyway, have been replicating simple part of system, have ran assume simple problem one-to-many relationship giving unusual results. here entities: public class task : base.domain { private ilist<taskproperty> _taskproperties = new bindinglist<taskproperty>(); private string _name = string.empty; private string _description = string.empty; public virtual ilist<taskproperty> taskproperties { { homecoming _taskproperties; } set { if (_taskproperties == value) return; _taskproperties = value; onnotifiypropertychanged("taskproperties"); } } public virtual string name { { homecoming _name;...

osx - Using Git on Mac? I cant find git-svn -

osx - Using Git on Mac? I cant find git-svn - this question has reply here: can't find git-svn on mac os x leopard after installing via macports 3 answers i trying utilize git on mac os x , can't find git-svn like git-svn clone -s http://example.com/my_subversion_repo local_dir is git svn clone -s http://example.com/my_subversion_repo local_dir the same? though i've never used feature, believe 2 should equivalent. reasoning is: performing git svn results in error .git wasn't found, within script /usr/libexec/git-core/git-svn ; opening script in text edit reveals credit of author of git-svn: copyright (c) 2006, eric wong hence running git svn help gives: git-svn - bidirectional operations between single subversion tree , git osx git git-svn

android - ListView Not Working -

android - ListView Not Working - i have made simple listview , want buttons correspond new activity have used case statement happen heres code. bundle com.example.lookingatics; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.adapterview; import android.widget.adapterview.onitemclicklistener; import android.widget.arrayadapter; import android.widget.listview; import android.widget.textview; public class otheractivity extends activity{ @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.other_activity); listview listview = (listview) findviewbyid(r.id.mylist); final string[] values = new string[] { "science", "maths", "english", "history", "geography", "r.e", ...

php - Infinite redirect loop - rewriting URLs -

php - Infinite redirect loop - rewriting URLs - i getting infinite redirect loop when implementing rewrite of urls seo purposes. example url `<a><?php echo make_store_name_url($store_id); ?><?php echo $store_name; ?></a>` i have function rewrite dynamic urls - below example function make_store_name_url($store_id) { //build keyword rich url $url = site_url . '/store/' . $store_id .'/'; //return url homecoming $url; } //function redirect using 301 function fix_store_name_url() { $proper_url = get_proper_store_name_url(); if(site_url . $_server['request_uri'] != $proper_url) { header('http/1.1 301 moved permanently'); header('location: ' . $proper_url); exit(); } } function get_proper_store_name_url() { $store_id = $_get["store"]; $proper_url = make_store_name_url($store_id); homecoming $proper_url; } finally line in htaccess rewrite. ...

mysql - custom query in Magento to insert data to database -

mysql - custom query in Magento to insert data to database - this table construction of payment_customer table. create table if not exists `payment_customer` ( `id` int(11) not null auto_increment, `added_date` datetime not null, `merchant_reference_no` varchar(20) not null, `amount` int(10) not null, `order_desc` varchar(100) not null, primary key (`id`) ) engine=innodb default charset=utf8 auto_increment=5 ; above table stores info customers made payments. utilize below query insert info table in custom payment gateway module. $write = mage::getsingleton('core/resource')->getconnection('core_write'); $sql = " insert payment_customer ('id', 'added_date', 'merchant_reference_no', 'amount', 'order_desc') values (null, '2013-02-13 00:00:00', '233ax23', '200', 'test'); "; $write->query($sql); then tried $write = mage::getsingleton('core/resour...

How come command line isn't recognizing this java command? -

How come command line isn't recognizing this java command? - i come in java -classpath c:\blahblahblah\software_engineering\cs2.jar part of suggestion here: why ide find jar command line doesn't? . i'm pretty sure valid command, instead receive tired list: usage: java [-options] class [args...] (to execute class) or java [-options] -jar jarfile [args...] (to execute jar file) options include: -server select "server" vm -hotspot synonym "server" vm [deprecated] default vm server. -cp <class search path of directories , zip/jar files> -classpath <class search path of directories , zip/jar files> ; separated list of directories, jar archives, , zip archives search class files. -d<name>=<value> set scheme property -verbose[:class|gc|jni] enable verbose output -versio...

c# - Json Ajax Calls - The maximum message size quota for incoming messages (65536) has been exceeded -

c# - Json Ajax Calls - The maximum message size quota for incoming messages (65536) has been exceeded - we have phonegap app running on ios , android, calling wcf webservices (hosted on iis7 in development) , on azure (when in production). wcf calls made using json ajax requests. phonegap using "filetransfer" when upload big images, app sends image, webservice never recieves it. little images work fine. the message in webservice log files is: the maximum message size quota incoming messages (65536) has been exceeded we've searched , searched , we've increased maxsize on can lay our hands on in webservice web.config file - no avail. any help on much appreciated. c# json wcf iis cordova

Prevent CSS footer from scrolling -

Prevent CSS footer from scrolling - #bottom_fade { position: absolute; bottom: 0; width: 100%; background: url("bottom-fade.png"); background-repeat:repeat-x; height: 400px; z-index: 2; } .categories { position: absolute; left: 50%; color:black; word-wrap: break-word; font-family: 15px 'libre baskerville', serif; margin-left: -200px; z-index: 1; } .categories td { width: 200px; } you may see result of above code here. seek resize browser window you're forced scroll see whole text in table. as scroll, may see #bottom_fade not remain sticked bottom of page follow scrolling. don't want happen: how can bottom_fade stays attached bottom of browser window, no matter happens scrollbar? many thanks! change #bottom_f...

php - get_the_title() of some post and work with it's value -

php - get_the_title() of some post and work with it's value - i have standart loop with: <article class="somepost"> <?php $a = get_the_title(); echo $a; ?> </article> how value of post's title, when click on article (class="somepost") $('.somempost').click(function(){ ??? }); thanx. first, set title articles info attribute: <?php $a = get_the_title(); ?> <article class="somepost" data-title="<?php echo $a; ?>"> <?php echo $a; ?> </article> then in jquery, set title variable so: $('.somepost').click(function(){ var the_title = $(this).data('title'); }); php jquery wordpress

javascript - JQuery UI Dialog: Password inputs causing freezing -

javascript - JQuery UI Dialog: Password inputs causing freezing - this odd behavior seems happen in chrome , jquery ui. when entering characters password field @ first functions correctly. however, if effort backspace lastly letter in input, browser locks client side operations. also, if seek , highlight characters entered , backspace client side operations freeze. just reaching out see if has encountered same issue, , how resolved it. in order experience issue, have dialog auto opening on 2+ unique page home views. here listings page can triggered, apologize inconvenience can't remove counter. page: http://www.christineleeteam.com/area/eagleharbor i had same problem cache clearing didn't help. i'm sure isn't jquery ui bug. here solution: $('input[type="password"]').on('keydown', function(event){ if (event.which == 8) { //backspace event event.preventdefault(); $(this).val(''); } ...

javascript functions and this keyword, context -

javascript functions and this keyword, context - here code obj = { a: 'some value'; m: function(){ alert(this.a); } } obj.m(); the result 'some value' . i heard keyword refers owner of function obj . question owner of function in above code obj why of import utilize keyword when function has owner code above should working in next way obj = { a: 'some value'; m: function(){ alert(a); } } obj.m(); which not work know why? a not available in scope of function m . a property of object obj , available obj.a or this.a within context of obj . since obj.m() executes m in context of a , can access a using this.a within function m . in javascript, utilize of this mandatory. in other languages java or c++, utilize of this optional. x automatically resolves this.x if there's no local variable in java / c++, not in javascript. javascript keyword

ios - Data argument not used by format string -

ios - Data argument not used by format string - following videos on lynda's objective c i've ran intro little problem, #import <foundation/foundation.h> #import "player.h" int main(int argc, const char * argv[]) { @autoreleasepool { player *p = [[player alloc] init]; nslog(@"the score @i", [p score]); <-- info argument not used format string } homecoming 0; } you don't have valid format string. want %i , not @i . ios objective-c c xcode

facebook - How to get extended access token for perl app? -

facebook - How to get extended access token for perl app? - i found on facebook site, need extended access token? https://graph.facebook.com/oauth/access_token? client_id=app_id& client_secret=app_secret& grant_type=fb_exchange_token& fb_exchange_token=existing_access_token assuming have access token successful oauth interaction, invoke url, replacing existing_access_token token got initial oauth, , client_id , client_secret app id , app secret app (see https://developers.facebook.com/apps). json containing extended token. an oauth interaction in context prompts user give app permission access profile data, or deed permissions on behalf of user. in facebook, if redirect users browser https://www.facebook.com/dialog/oauth/? client_id=your_app_id &redirect_uri=your_redirect_url &state=your_state_value &scope=comma_separated_list_of_permission_names where scope publish_stream,read_friendlists,...

ios - Can I add UITabBarController in UITabBarController? -

ios - Can I add UITabBarController in UITabBarController? - i have 2 menu, first (it main)horizontal , second(click on sec button of first menu) vertical. want first menu utilize uitabbarcontroller , sec menu utilize uitabbarcontroller too. can it? how custom functionality alter controllers sec menu? can app store reject app functionality? can app store reject app functionality? maybe, pay attending 10.3 , 10.6: ios objective-c app-store xcode4.5

javascript - Facebook page like counts -

javascript - Facebook page like counts - how set <script> or javascript setup https://api.facebook.com/method/fql.query?format=json&query=select+fan_count+from+page+where+page_id%3d80177638103 that homecoming fan_count nos. page. <p> fan_count </p> if you want utilize plain javascript can use <script> function showcount(count){ if(count) document.getelementbyid('fb_fan_count').innerhtml = 'total fans : ' + count[0].fan_count; } </script> <p id="fb_fan_count"></p> <script type="text/javascript" src="https://api.facebook.com/method/fql.query?format=json&callback=showcount&query=select+fan_count+from+page+where+page_id%3d80177638103"></script> demo. javascript facebook-graph-api coding-style facebook-fql facebook-page

python - Show That User Is Logged Into iOS app -

python - Show That User Is Logged Into iOS app - the login works backend , goes home screen after login on ios. how do guarantee user beingness logged in? for example, have label user's username displayed in, don't know how user's username . i have thought can phone call server , homecoming username in json format, isn't kind of inefficient? improve way this? ps. first time ios programmer additional info: using flask , flask-login extension backend. using login_user(user) method. has worked in past web dev, how work ios dev. @app.route('/login/', methods=['post']) def login(): params = json.loads(request.data) username = params['username'] password = params['password'] u = user.query.filter_by(username=username).first() if u: if utils.check_password_hash(password, u.pw_hash): login_user(u) homecoming ('', 200) else: homecoming ('...

How to add a title bar in Android while sorting? -

How to add a title bar in Android while sorting? - here code: public class mainactivity extends activity { spinner spin; textview tex; string[] country = {"a", "afghanistan", "albania", "etc"};// z country names string[] code = {"+93", "+91", "etc"}; // z country code protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); spin = (spinner)findviewbyid(r.id.spinner1); tex = (textview)findviewbyid(r.id.tex); arrayadapter aa1 = new arrayadapter(this, android.r.layout.simple_spinner_item, country); aa1.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spin.setprompt("select country"); spin.setadapter(aa1); spin.setonitemselectedlistener(new onitemselectedlistener() { @override public void onite...

date - Error (?) in Day counting PHP -

date - Error (?) in Day counting PHP - <?php $date1 = "2002-1-1"; $date2 = "2021-12-31"; $deff = abs(strtotime($date2) - strtotime($date1)); $daycount = $deff / (60 * 60 * 24); echo $daycount; ?> why reply 7304 instead of 7300 trying calculate number of days 20 years? please help. use datetime this: $datetime1 = new datetime("2002-1-1"); $datetime2 = new datetime("2021-12-31"); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%a days'); echo $elapsed; see in action reference datetime dateinterval php date datetime date-math

java - Efficient way to count unique pairs in int array -

java - Efficient way to count unique pairs in int array - this first post, hope complies posting guidelines of site. first of generic community: reading months , learned lot :o) premise: i'm first years pupil of it. here's question: i'm looking efficient way count number of unique pairs (numbers appear twice) in given positive int array (that's know), e.g. if: int[] arr = {1,4,7,1,5,7,4,1,5}; the number of unique pairs in arr 3 (4,5,7). i have difficulties in... evaluating efficiency of proposals let's say. here's first code did: int numcouples( int[] v ) { int res = 0; int count = 0; (int = 0 ; < v.length; i++){ count = 0; (int j = 0; j < v.length; j++){ if (i != j && v[i] == v[j]){ count++; } } if (count == 1){ res++; } } homecoming res/2; } this shoudn't cause checks whole given array many times number of elements in given array... right me if i'm wrong. ...

wpf - How to customize default context menu -

wpf - How to customize default context menu - in wpf application want create textboxes cut, re-create , paste restricted. 1 way set contextmenu ="{x:null}" but doing loose spell check suggestions don't want loose. in application have 1000 textboxes want in more optimize way. any advice appreciated. if need menu items related spell checking, can refer msdn article: how to: utilize spell checking context menu. if want apply custom contextmenu multiple (but not all) textboxes: <window.resources> <contextmenu x:key="mycustomcontextmenu"> <menuitem header="ignore all" command="editingcommands.ignorespellingerror" /> </contextmenu> </window.resources> <grid> <textbox height="23" name="textbox1" width="120" spellcheck.isenabled="true" contextmenu="{staticresource mycustomcontextmenu}" /> </grid> ...

date - Not accessing the value using between statement in sql -

date - Not accessing the value using between statement in sql - i storing date varchar in database. when trying access info using between operator in sql, values between dates, not giving proper output because stored date varchar. date in format (01/12/2013)(dd/mm/yyyy) . any thought access right info using between statement out changing date varchar date format? thank you. don't confused datatype - has nil problem. see if remove / in dates - real numbers: 20/02/2013 more 21 1000000 higher 01/02/2014 20/02/2013 = 20022013 01/02/2014 = 1022014 if varchar has numbers in order of date, month, year - must reorder them in field or in query right values, if in year month day, have varchar sort datetime. solution 1: if must leave way in table, must this: database table: create table dates ( date_varchar varchar(15) default null, date_datetime datetime default null ) engine=myisam default charset=utf8 data: date_varchar date_datetime ...

.net - Inserting new lines between images C# Word -

.net - Inserting new lines between images C# Word - this question has reply here: how add together items 1 @ time to new line word document using word interop 1 reply i insert image, new line , image. process has repeated until images inserted. code of inserts images, not blank lines using system.io; using word = microsoft.office.interop.word; namespace snapper { class worddocumentgenerator { public void createworddocument(string filename) { string originalpath = directory.getcurrentdirectory(); string path = originalpath; path += @"\snapshots"; object omissing = system.reflection.missing.value; //create new word application word._application wordapp = new word.application(); wordapp.visible = false; seek { ...

c++ - Can C have objects? -

c++ - Can C have objects? - this question has reply here: can write object-oriented code in c? 33 answers i know 1 of major advantages of c++ programming languages fact can back upwards oop. example: #include <iostream> using namespace std; class crectangle { int x, y; public: void set_values (int,int); int area () {return (x*y);} }; void crectangle::set_values (int a, int b) { x = a; y = b; } int main () { crectangle rect; rect.set_values (3,4); cout << "area: " << rect.area(); homecoming 0; } i wondering if c supported oop , if how done. generally, utilize structs , pass context pointer around. direct conversion of example: #include <stdio.h> struct rectangle { int x, y; }; void rectangle_set_values (struct rectangle * rectangle, int a, int b) { rectangle->x = a; rectang...

version control - How to make git fill tags? keywords? -

version control - How to make git fill tags? keywords? - this question has reply here: git equivalent of subversion's $url$ keyword expansion 4 answers git keyword substitution in subversion? 3 answers in sourcecode set tags next , svn fill in lastchangedate, author, revision etc.. can done git? can please tell me how.. thanks /** * lastly changed: $lastchangeddate$ * @author $author$ * @version $revision$ * */ "clean" , "smudge" filters - "keyword expansion" section git version-control

c++ - equivalent for "ismember" of matlab in opencv? -

c++ - equivalent for "ismember" of matlab in opencv? - what equivalent of "ismember" of matlab in opencv? i trying convert matlab code opencv ( c/cpp ). need convert below step opencv. can 1 please guide me in regard? [lia locb1] = ismember(tl(:,1),ind3); mat tl = mat::ones(106, 3, cv_8u); , ind3 = find(sm(:,1) >= xm & sm(:,1) <= xm & sm(:,2) >= ym & sm(:,2) <= ym); it's not equivalent, if scalar ismember(a,b) can replaced any(a==b) . not sure if helps in opencv, otherwise can ofcourse replace ismember simple loop check equality of a elements in b . c++ c matlab opencv code-conversion

windows - Cannot specify a repository location -

windows - Cannot specify a repository location - i want add together partly-made project local repository. firstly, i've opened cmd.exe , prompted: svnadmin create e:\repo\gc then, in netbeans project window: [project name]->versioning->import subversion repository a 3 step wizard popped up. @ (1) i've specified path file:///e:\repo\gc , gave me non self-explanatory error: no information available for: file:///e:\repo\gc where wrong? urls require slashes, not backslashes. repository url should file:///e:/repo/gc . run svn info file:///e:/repo/gc create sure it's set before attempting commit/import it. windows svn netbeans version-control

algorithm - Find start and end position of "cover-all" path then connect them -

algorithm - Find start and end position of "cover-all" path then connect them - i have shape in 2darray (for example): it known points , b (i not know where) , path covers entire shape (must walk through each cell) must exist. can give me help on how determine points , b , "cover-all" path? maybe there known algorithms such case. or help pseudo-code algorithm. in advance. check nhahdth 's link see problem in general np-hard. this mathoverflow article cites paper establishing result graphs on grids holes - won't fare improve using brute forcefulness unless can come more constraints. you may lucky in identifying @ to the lowest degree 1 of start , end nodes searching vertices of grade 1 in underlying grid cell graph. algorithm path-finding

javascript - How to change Twitter follow button width? -

javascript - How to change Twitter follow button width? - i know has been asked in other threads answers didn't suit case. if embed twitter follow button here: https://twitter.com/about/resources/buttons <a href="https://twitter.com/share" class="twitter-share-button">tweet</a> <script>!function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0];if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs");</script> the js replaces link iframe: <iframe scrolling="no" frameborder="0" allowtransparency="true" src="http://platform.twitter.com/widgets/tweet_button.1360366574.html#_=1360791644346&amp;count=horizontal&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=http%3a%2f%2fwww.foo.com%2fsearch%2fcats&amp;size=m&amp;text...

Order by weekno and year in Mysql -

Order by weekno and year in Mysql - select abc.mnth mnth,sum(abc.info) info (select aaa.mnth mnth, aaa.info info ((select ontime.mnth mnth, ontime.info info (select ontimerecords.mnth mnth , round(((ontimerecords.count/completed.count)*100),2) info (select date_format(t.dtdelivery,'%v %x') mnth, count(*) count table1 t fcompleted = 1 , t.fstatus = 1 , t.dtdelivery >= '2013-01-01 00:00:00' , t.dtdelivery <= '2013-12-28 23:59:59' , find_in_set(t.sprojectcode,'all,pj1,pj2,hhfgh,tewrtert,dfgdgdf,project code,null,tyuire,dfgdfgdf,[select]') > 0 , t.dtdelivery <= t.dtdeliverydue grouping date_format(t.dtdelivery,'%v %x') order date_format(t.dtdelivery,'%v %x')) completed inner bring together (select date_format(t.dtdelivery,'%v %x') mnth, count(*) count table1 t fcompleted = 1 , t.fstatus = 1 , find_in_set(t.sprojectcode,'all,pj1,pj2,hhfgh,tewrtert,dfgdg...

web services - Run a Python Script from the Web -

web services - Run a Python Script from the Web - i've been stumbling along same problem year now. find way work around it, i'm tired of finding work arounds. what need create button on web page (preferable html, not php or asp) runs python script on server. i'd ability have button send info form script. i need on local host , through web service hosted on amazon cloud. won't able install on amazon cloud service, such php or cgi. i'd easy solution, i'm expert python , can write webpages whistle, can't find simple solution problem. my ideal solution mail service tag: <a href="mailto:someone@example.com?subject=hello%20again">send mail</a> except: <a href="myscript.py?subject=1234">run script</a> now highly uncertainty solution exists, can dream right. the script trying run: returns unique id user sends id gis programme creates map based on id (the id selects area of map) the map exp...

Matlab - How to save view configuration of matlab neural network -

Matlab - How to save view configuration of matlab neural network - i trying configure neural network using matlab , newff command. after that, trying visualize created configuration using view command. x = view(net); how can save displayed window .png file? have tried saveas(x, 'figure.png', 'png') won't work? know how can code? the created window pure java figure (not matlab handle graphics). seek capture it: %# neural net, , view net = feedforwardnet(5); jframe = view(net); %# create in matlab figure hfig = figure('menubar','none', 'position',[100 100 565 166]); jpanel = get(jframe,'contentpane'); [~,h] = javacomponent(jpanel); set(h, 'units','normalized', 'position',[0 0 1 1]) %# close java window jframe.setvisible(false); jframe.dispose(); %# print file set(hfig, 'paperpositionmode', 'auto') saveas(hfig, 'out.png') %# close figure close(hfig) ne...

exception - Extjs 4.1 remove from store after successfully removed from the server -

exception - Extjs 4.1 remove from store after successfully removed from the server - i have situation need delete items store, using remove(record) method , goal remove item store after server deletes , returns success message. store uses ajax proxy create delete phone call server , using both autoload , autosync. when remove(record) called first removes record store , proceeds create delete phone call server. i find behavior bit unusual because seems have manually reinsert model store based on server's response. makes situation more complex 'exception' event beingness handled proxy , not store. proxy store agnostic catching exception event generated server's response in proxy, not allow me perform operations rejectchanges on store. obviously there's wrong implementation's logic, need understand how alter store after server responds , based on server's response or if that's not possible how homecoming store previous state before operation...

Understanding Maven scoping better -

Understanding Maven scoping better - i have been struggling figure out what's utilize of scoping provided maven mentioned here. why should not have compile time scoping? real life examples appreciated. the compile scoped dependencies used during compilation. the test scoped ones -- during tests. have tests using junit, or easymock. not want final artifact have dependency on them, able depend on these libraries while running tests. those dependencies marked provided expected on classpath when you're running produced artifact. example: have webapp , have dependency on servlet library. obviously, should not bundle within war file, webapp container have , conflict may occur. one of reasons have different scopes dependencies different parts of build can depend on different dependencies. example, if compiling code , not executing tests, there no point in having maven downloading test dependencies (if they're not nowadays in local repository, of course)....

installer - Upgrading one product but not the other when both products have the same upgrade code -

installer - Upgrading one product but not the other when both products have the same upgrade code - i have 2 products installed. have same version number , upgrade code, different product code. major upgrade on 1 of these products, upgrade exe created ends removing both products, , installing new one. that beingness said, how can maintain 1 product installed when product has same upgrade code product upgrade? the upgrade table first drives findrelatedproducts. findrelatedproducts uses info perform msi product searches. if places productcode of found in property specified actionproperty column later, removeexistingproducts performs uninstall of productcodes found in actionproperty properties ( provided msidbupgradeattributesonlydetect not set ). so trick out of sticky situation author upgrade row cause findrelatedproducts not find either product. utilize custom action own searches , set properties needed ( 1 not other ). removeexistingproducts able perform ma...

python - pandas timestamp subtraction -

python - pandas timestamp subtraction - i have timestamp column this. in [493]: df_data['last_seen'][:5] out[493]: 1 1838-10-31 01:36:32.493180416 2 1826-08-10 09:38:02.493180416 3 1839-05-04 21:14:42.493180416 4 1831-06-11 17:44:24.493180416 5 1820-01-26 10:32:07.493180416 name: last_seen i want number of hours has passed since recent time stamp each row. write df['last_seen'] = df['last_seen'] - df['last_seen'].max() this throws error. attributeerror: 'timestamp' object has no attribute 'dtype' note when inquire : >>> type(df['last_seen']) >>> pandas.core.series.series >>> type(df_data['last_seen'][1]) >>> pandas.tslib.timestamp this bug fixed in pr https://github.com/pydata/pandas/pull/2899 python datetime pandas

c# - Do custom attribute classes inherit the "Inherited" AttributeUsage flag? -

c# - Do custom attribute classes inherit the "Inherited" AttributeUsage flag? - consider next scenario: a base of operations attribute class baseattribute has attributeusageattribute specifying not inheritable ( inherited = false ). a derived attribute class derivedattribute inherits base of operations attribute class. a base of operations domain class base has derived attribute applied. a domain class derived inheriting base of operations domain class asked custom attributes, including inherited attributes ( inherit: true ). here corresponding code: using system; using system.linq; namespace consoleapplication26 { class programme { static void main () { var attributes = typeof (derived).getcustomattributes (true); foreach (var attribute in attributes) { console.writeline ( "{0}: inherited = {1}", attribute.gettype().name, attribute.gettype().getcustomattributes (type...

excel sum all cells where another cell contains a string -

excel sum all cells where another cell contains a string - example table: | | b -------------------------- 1 | 26 | tom, jerry -------------------------- 2 | 12 | tom -------------------------- 3 | 6 | jerry, tom, dick suppose have table. trying sum total of cells in column cell of same row in column b contains name, illustration "tom". however, before cell in column added total, has divided number of names in column b. so example, if used name jerry, total of: (26/2) + (6/3) = 15 if used name tom, total of: (26/2) + 12 + (6/3) = 27 please help! thinking perhaps might complex , might need split up. assuming name in cell c1, formula job: =sum($a$1:$a$3*not(iserror(search(c1,$b$1:$b$3)))/(len($b$1:$b$3)-len(substitute($b$1:$b$3,",",""))+1)) you need come in array formula, i.e. press ctrl-shift-enter. string excel if-statement split sum

Install oracle and php oracle extension(OCI8) in Opensuse environment -

Install oracle and php oracle extension(OCI8) in Opensuse environment - i using oracle database server want install oracle in opensuse environment.it completelty work in ubuntu , windows.so please tell me steps install php,oci8 extension , oracle in opensuse. urgent. thank you. you need install next packages: php5-devel libxml2-devel zlib-devel readline-devel oracle-instantclient11.2-basic oracle-instantclient11.2-devel and compile oci8 php extension a howto suse website this can help you php oracle opensuse oci8

java - How can I add multiple signatures with PDFBox? -

java - How can I add multiple signatures with PDFBox? - i'm trying add together 2 different signatures (with 2 different certificates, obviously) in pdf document, using pdfbox. started code provided in answer whenever add together sec signature, invalidates first one. i managed itext, pdfstamper has possibility append elements, cannot utilize itext project, due new license. can point me in right direction? , if not, there other open source library has signing functionality? thanks! edit: problem isn't can't add together sec signature, it's first 1 becomes invalid 1 time sec 1 applied. created method sec signature , sign document this: pdfsigner signer = new pdfsigner(input, output); signer.sign(keystore1, password1); signer.signr(keystore2, password2); signer.document.saveincremental(.....); java digital-signature pdfbox

networking - Is it possible to push data from the server to the client (phone, computer) without OS integration -

networking - Is it possible to push data from the server to the client (phone, computer) without OS integration - is there way server force info client, wirelessly , seamlessly, may windows(phone), iphone, mac, or android device, without os integration? if so, what's best design pattern this, , best technologies go this? push technology methodology of server initiating transfer of data, rather client asking server it. apple makes force technology relatively easy utilize providing such functionality built-in on os. android through google cloud messaging android. windows, however, not. apple force notifications , google's messaging android seemingly magical and/or functionality os needs handle; however, isn't case. advantage of having "integrated" in os, same having framework handle functionality you. speaking in technical terms, force technology long-lived connection client server accepts messages. these messages considered pushed messa...

Pasting instead of typing text into input field with character limit javascript -

Pasting instead of typing text into input field with character limit javascript - i have code limits number of characters sort of "countdown" field works in real-time user types. everything works except when user "pastes" text. when click in field 1 time again reset , know there many characters entered. is there way create work on mouseup / out... or interact paste user? here current code: <script type="text/javascript"> function textcounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit); else cntfield.value = maxlimit - field.value.length; } </script> try maxlength property: <input type="text" maxlength="10"> javascript character limit paste

Php regex - remove anything between $ and line break but leave the break -

Php regex - remove anything between $ and line break but leave the break - okay, have php loop generates string this: $string = "1st fee - $500.00<br> 2nd fee - $500.00<br> 3rd fee - $750.00<br>" i'd remove dollar amount i'm not sure it's possible. i've been trying utilize preg_replace remove between $ , < including $ not < this: $string = "1st fee - <br> 2nd fee - <br> 3rd fee - <br>" unfortunately me, have leave - because there multiple instances of - on single line so: $string = "1st fee - brian - $500.00<br> 2nd fee - john - $500.00<br> 3rd fee - bob - $750.00<br>" any help appreciated, if it's telling me give up, not possible. in advance! so want match everyhing - $ until first left arrow in <br> . first part of pattern - \\$ (need escape $ since regex ...

how to set postgresql command timeout in rails -

how to set postgresql command timeout in rails - i'm using heroku , heroku postgresql. how set db command timeout exception when sql command takes longer 10 seconds? configure database.yml this, key bit beingness variables hash: defaults: &default adapter: postgresql encoding: unicode pool: 5 min_messages: warning variables: statement_timeout: 5000 ruby-on-rails postgresql heroku

three.js - Does anyone have a BSP example? -

three.js - Does anyone have a BSP example? - does have illustration of using bsp trees in threejs share or know about? looking @ creating terrain splatting illustration , utilize bsp (or perhaps octree...?) help speed rendering. many thanks have @ octree source: https://github.com/collinhover/threeoctree edit: there several three.js examples: http://threejs.org/examples/webgl_octree.html http://threejs.org/examples/webgl_octree_raycasting.html three.js r.60 three.js bsp

python - How can I detect user is inactive for 5 seconds in order to assign session key? -

python - How can I detect user is inactive for 5 seconds in order to assign session key? - i trying implement next scenario web-page. if user inactive 5 seconds, log-out user. have request.session['islogin'], want re-assing session key false after user inactive 5 seconds. have tried utilize decorators after few codes, have not figure out should write next code observe inactive users. therefore, have question "how can observe user inactive 5 seconds in order assign session key, islogin, false ? you can create middleware that middleware.py from datetime import datetime, timedelta django.conf import settings django.contrib import auth class autologout: def process_request(self, request): if not request.user.is_authenticated() : #can't log out if not logged in homecoming try: if datetime.now() - request.session['last_touch'] > timedelta( 0, settings.auto_logout_delay * 60, 0): auth.logout(request) ...

php - Get the_terms names for current post id -

php - Get the_terms names for current post id - this work me when want array includes names of taxonomy: get_terms( 'portfolio-skills', array( 'fields' => 'names' ) ); what if want terms names associated current post. tried it's not working: get_terms( 'portfolio-skills', array( 'fields' => 'names' ), 'include' => array( $post->id ) ); thank @pekka 웃, alter , it's working: wp_get_object_terms( $post->id, 'portfolio-skills', array( 'fields' => 'names' ) ); php wordpress custom-taxonomy

Ajax implementation with Django -

Ajax implementation with Django - i presently working on django project requires implementation of ajax. e.g adding model objects database, getting , updating model instances database etc without refreshing page @ all. have searched everywhere yet come across relevant material. i implore gurus in house point me in direction of materials know of help. thanks django ajax forms dajax project ajax , django views ajax django

javascript - How to open a URL with a hash using Selenium? -

javascript - How to open a URL with a hash using Selenium? - i'm trying test backbone.js web application selenium ide. selenium can open test case's initial url long it's in fresh browser window -- e.g. open /#/login -- times out whenever tries open subsequent urls. it seems selenium listening event isn't triggered when url hash changes. i imagine happens time you're using hashchange + selenium... in selenium ide utilize 'storeeval' command, illustration : command = storeeval target = window.location.hash='/search/events/birthdays/1' storeeval runs javascript snippet assigned "target". can do, have 1 test case opens start page using open(url) command, , rest of cases changing hash using storeeval command. javascript backbone.js selenium hashchange

sql server 2008 - How to enable Windows Authentication for DNN -

sql server 2008 - How to enable Windows Authentication for DNN - sorry question might duplicate dint find right solution.so im posting question again... first have deployed dnn website sql server authentication.site working fine. later re installed sql server 2008. im trying give windows authentication connect site. in web config connectionstring:i have removed username , password , gave integrated security="true" . in iis :site -> authentication -> windows authentication ->enabled , others disabled. once browse site redirecting dnn install wizard need help. in sql server did configure windows business relationship application pool (in iis) using have dbowner access database? also create sure alter both connection strings in database. depending on version of iis on, business relationship might differ. older versions utilize "network service" while newer versions might utilize "network service" or application pool...

java - How to replace fragment run time -

java - How to replace fragment run time - i want add together , replace frame layout fragment on fragment-1 , fragment-2 on item click of grid , list item. i had created main.xml class <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <linearlayout android:layout_width="0dp" android:layout_weight="1" android:orientation="vertical" android:layout_height="fill_parent" > <fragment android:id="@+id/fragment1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" class="com.example.fragment.fragment1" /> <view android:layout_width...

vba - SqlPassThough error? -

vba - SqlPassThough error? - i have vbscript didn’t write. trying pull cellphone number , won’t pull it. every time seek alter sql query sends me error telling me the “the specified filed ‘sqlpassthough.workphone’ refer more 1 table listed in clause of sql statement.” workphone isn’t selected? little confused. attribute vb_name = "module1" global const filedirectory string = "c:\users\0-\documents" global const filename string = "ortho.txt" global const filedirandname string = filedirectory & "\" & filename global runcount integer alternative compare database function main() on error goto main_err dim dbs database set dbs = currentdb 'dim outmail outlook.mailitem docmd.setwarnings (false) 'only run if not weekend if isweekend = true docmd.quit end if 'create query def addquerydef 'transfer file docmd.transfertext acexportdel...

How to store videos on Google App Engine, without forms? -

How to store videos on Google App Engine, without forms? - having stumbled across gae, understand videos uploaded using form, , stored blob. is there way without forms? i want utilize gae end android application, videos android uploaded gae. as long have way of transferring bytes mobile client server, can utilize blobstore write api write bytes blobstore. google-app-engine video store

c++ - Deleting a node from a linked list without getting an error? -

c++ - Deleting a node from a linked list without getting an error? - simply, programme create linked list of chars string. (say "hello" head->h->e->l->l->o->null) whenever seek delete head using erase function, programme stop working giving "application.exe has stopped working... windows checking solution..". think might have problem memory allocation can't tell. suggestions appreciated. this works void stringadt::append(string s) { (int = 0; < s.length(); i++) { node* nodeptr; node* newnode; newnode = new node; newnode->data = s.at(i); newnode->next = null; if (!head) { head = newnode; } else { nodeptr = head; while (nodeptr->next) { nodeptr = nodeptr->next; } nodeptr->next = newnode; } } } void stringadt::erase(int pos) //pos = position erase { if (!head || pos < 0 || pos > length() - 1) return; else ...