Posts

Showing posts from May, 2011

java - is it possible to use apache mahout classification without hadoop dependency -

is possible use apache mahout classification without dependency hadoop. use mahout algorithm on single computer including mahout library inside java project dont want use hadoop @ since running on single node anyway, windows 7 operating system. is possible? if yes , algorithm run without hadoop dependency? thank in advanced yes, possible run mahout without having install hadoop cluster. need set environment variable mahout_local=true on seeing variable, mahout start interacting directly file system data, etc. without trying hadoop cluster or hdfs location.

c# - Button event not firing in javascript -

i've added jquery modal popup save upload files specific device. modal pops up, cancel button works, cant figure out how save button fire onclick event... this i've done: $(function () { $("#dialogcustuploads").dialog("destroy"); $("#dialogcustuploads").dialog({ title: "upload files", autoopen: false, modal: true, resizable: false, width: 'auto', buttons: { save: function () { $(document.getelementbyid('<%=btnsave.clientid %>')).click(); }, cancel: function () { $(this).dialog("close"); } } }); }); function showcustuploads() { $(function () { $("#dialogcustuploads").dialog("open"); }); $(".dialogcustupload...

javascript - Contact form using php inside phonegap gives success alert but cant find mail -

basically question mirror of previous 1 in stack overflow. form works after success alert, don't find mail sent designated email id. after click send button if success alert means mail has been sent successfully, when check name@example.com (dummy) should see mail in inbox cant find one. may problem. doing wrong? contact.html <html> <head> <link rel = "stylesheet" href="css/theme.min.css"/> <link rel="stylesheet" href="css/jquery.mobile-1.2.1.css"/> <script type="text/javascript" charset="utf-8" src="js/jquery-1.6.1.min.js"></script> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8" src="js/jquery.mobile-1.2.1.min.js"></script> <script type="text/javascript"> // when...

android - PopUp Activity starts again when it is started from "recent apps" -

i have popup activity starts when alarmmanager receives alarm. alarmreceiver extends wakefulbroadcastreceiver: @override public void onreceive(context context, intent intent) { intent service = new intent(context, alarmservice.class); service.putextras(intent); // start service, keeping device awake while launching. startwakefulservice(context, service); } alarmservice extends intentservice: @override protected void onhandleintent(intent intent) { intent = new intent(); i.setclass(this, popupactivity.class); startactivity(i); alarmreceiver.completewakefulintent(intent); } popupactivity: @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); getwindow().setflags(layoutparams.flag_not_touch_modal, layoutparams.flag_not_touch_modal); getwindow().setflags(layoutparams.flag_watch_outside_touch, layoutparams.flag_watch_outside_touch); setcontentview(r.layout.layout_dialog); ...

how to create view of field collection in drupal 7 -

when creating view of field collection give error when add fields in view error that: an ajax http error occurred. http result code: 500 debugging information follows. path: /en/admin/structure/views/view/new_page/preview/page/ajax statustext: error responsetext: exception: invalid field name given: field_translations not field collection field. in fieldcollectionitementity->__construct() (line 210 of /home) how handle problem to create field collection view need add relationship field collection first , can use it. above error seems you're using wrong field.

linux - BASH - Comparing two files and redirecting the output to something readable -

i need run comparison on 2 files on server , have output include headers, or other indication, difference is. the script runs list of commands , creates file based on output. output similar this: device 1 register value1 register b value2 register c value4 ... register h value5 device 2 register value1 register b value2 register c value4 ... register h value5 every night @ midnight, cron run script , create second file current devices , register settings, can compare previous days registers - using: diff -u file1.txt file2.txt > filediff.txt if filediff.txt empty, deletes diff, , moves file1.txt file2.txt , deletes file1.txt, i'm left file1.txt. if filediff.txt file not empty, output similar following: -register b value2 +register b value3 the problem this: due length of diff output, lose device name has differences, unless difference close device name. there flag can add diff command, or different way check differences between 2 files, include more, or all, ...

apache zookeeper - main:ZooKeeperServerMain@54 - Invalid arguments, exiting abnormally -

i new using zookeeper , trying learn using zookeeper book. start server in standalone mode given in book use command bin/zkserver.sh start . i using windows ran command bin/zkserver.cmd start , strange error : d:\zoo\zookeeper-3.4.6>bin\zkserver.cmd start d:\zoo\zookeeper-3.4.6>java "-dzookeeper.log.dir=d:\zoo\zookeeper-3.4.6\bin\.." "-dzookeeper.root.logger=info,console" -cp "d:\zoo\zookeeper-3.4.6\bin\..\build\classes;d:\zoo\zookeeper-3.4.6\bin\..\b ild\lib\*;d:\zoo\zookeeper-3.4.6\bin\..\*;d:\zoo\zookeeper-3.4.6\bin\..\lib\*;d:\zoo\zookeeper-3.4.6\bin\..\conf" org.apache.zookeeper.server.quorum.quorumpeermain "d:\zoo\zookeeper-3.4.6\bin\..\conf zoo.cfg" start 2014-04-04 21:00:06,573 [myid:] - info [main:datadircleanupmanager@78] - autopurge.snapretaincount set 3 2014-04-04 21:00:06,576 [myid:] - info [main:datadircleanupmanager@79] - autopurge.purgeinterval set 0 2014-04-04 21:00:06,576 [myid:] - info [main:datadircleanupma...

c++ - AIX: malloc in _snw(unsigned long)? -

i'm trying track malloc allocations in test program in aix. such, i've substituted malloc new_malloc calls old system malloc, prints out call stack using call system("procstack pid"). curiously, in of calls this: 0x09000000000ae23c waitpid(??, ??, ??) + 0x190 0x090000000018d8e0 system(??) + 0x1fc 0x0000000100011a34 printcallstack__()() + 0x34 0x000000010000167c malloc(0x80) + 0x3c 0x0000000100011acc __snw(unsigned long)(0x80) + 0x4c 0x0000000100011eac __svn(unsigned long)(0x80) + 0x4c 0x000000010000ac84 main(0x100000001, 0xffffffffffff568) + 0xc4 0x00000001000002d8 __start() + 0x98 what __snw(unsigned long) , __svn(unsigned long) calls coming from, calling malloc (unexpectedly)? appear occur after malloc before printf. my test code: char* y = (char*) malloc(128); memset(y, 0, 128); memset(y, 'z', 15); printf("y=%s %p\n", y, y); free(y); this doesn't answer question (i hope) teach few techniques. i did: ls /usr/lib...

android - Open different activities from listview -

i open activity each of listview items. done research around onitemclicklistener don't know quite how fit in current code. my activities called: bhutaninfo.java columbiainfo.java my listview set in xml file: <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="country_names"> <item>bhutan</item> <item>colombia</item> </string-array> <array name="country_icons"> <item>@drawable/bhutan</item> <item>@drawable/colombia</item> </array> </resources> in class file have following: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); context ctx = getapplicationcontext(); resources res = ctx.getresources(); string[] options = res.getstringarray(r.array.country_names); typedarray icons = res.obtaintypedarray(r.array.count...

windows - avast blocks joomla web-site because of "JS:HideMe-H" -

i new boy joomla. have created web site using joomla works in linux o.s , others. website blocked appears on windows avast. thank in advance advice. you have element in code id=hideme . generated ad or embedded there. if sure website false positive. otherwise find , remove code generates snippet. can find more info on here or here .

vb.net - why Tostring doesnot convert int to string -

consider code: dim integer = 4 dim c integer = 3 console.writeline(a.tostring + c) console.readline() it should return 43 being converted string still return 7 because need convert both operands string, and/or use string concatenation operator & . as stands, evaluating expression: "4" + 3 and vb decides convert first operand integer match second operand. vb perform string concatenation + if both operands strings. prefers arithmetic + . some useful links: http://msdn.microsoft.com/en-us/library/te2585xw.aspx http://msdn.microsoft.com/en-us/library/9c5t70w2.aspx http://msdn.microsoft.com/en-us/library/wfx50zyk.aspx as can see these links, setting of option strict plays role. have set off frankly setting on prudent. personally i'd write this a.tostring & c.tostring the bottom line if know want concatenate strings, clearer use dedicated string concatenation operator & .

JAVA regarding a particular method -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 74 answers i got java test paper , there 1 question has been bugging me. there question: what output of following program? public class swap { public static void swap(int[] a){ int temp = a[1]; a[1] = a[0]; a[0] = temp; } public static void main(string[] args){ int[] x = {5,3}; swap(x); system.out.println("x[0]:" + x[0] + " x[1]:" + x[1]); } } the thought first came mind trick question. since swap method return type void, thought had no effect on int[] x array. answer x[0]:5 x[1]:3. got correct answer , when saw had been marked wrong, got confused. went try out actual code on netbeans , realized values in array got swapped! went on test if case string. typed in similar different code: public c...

php - Simple MySQL select query one field and return value -

i want return , display value 1 column id matches. simple if knew doing. <?php if(isset($_get['cid'])) { $id = mysql_real_escape_string($_get['cid']); $query = "select c_t_o_r ctable c_id = '{$cid}'"; $results = mysql_query($query); $rows = mysql_fetch_assoc($results); $ctor = $rows; echo $ctor; } ?> you're close. mysql_fetch_assoc() fetches array results. need specify column (key) array: <?php if(isset($_get['cid'])) { $cid = mysql_real_escape_string($_get['cid']); $query = "select c_t_o_r ctable c_id = '{$cid}'"; $results = mysql_query($query); $rows = mysql_fetch_assoc($results); $ctor = $rows['c_t_o_r']; // <-- need echo $ctor; } ?>

.net - Accessing contacts using carddav protocol from yahoo or any other web mail server -

i wanted retrieve contacts yahoo or third party carddav supported mail servers using carddav protocol. found .net code retrieve contacts using carddav on link https://github.com/metric/carddavnet . trying yahoo , google contacts using uri: https://www.googleapis.com/carddav/v1/principals/useremail/lists/default i made requests using propfind getting empty address book. think quite close may missing something. any appreciated! looking @ code of carddavnet don't think implements oauth authentication parts. required connect google carddav ( google’s carddav requires oauth 2.0 ). i don't know whether can use basicauth yahoo's implementation, may work icloud.

minus row return for updating table sql -

i'm pretty new more complex sql , cannot code update properly $sql = "update bank_accounts set bank_accounts.balance = bank_accounts.balance - upgrades.cost upgrades inner join upgrades u u.id = :id , bank_accounts.uid = :uid" ; couple of things... where :id , :uid coming from? if alias upgrades 'u' have use 'u', can't type 'upgrades.cost'. should 'u.cost'. also listed 'upgrades' twice in clause. try maybe? $sql = "update bank_accounts set bank_accounts.balance = bank_accounts.balance - u.cost upgrades u inner join bank_accounts on u.id = back_accounts.id"; another thought... updates make me nervous, select on data before doing update. select bank_accounts.balance before, bank_accounts.balance - u.cost after bank_accounts, upgrades u on u.id = bank_accounts.id

c++ - Serializing Eigen::Matrix using Cereal library -

updated : managed work after googled around , read doxygen comments in code. problem missed cast before using resize() method , not using std::ios::binary streams. if want similar, better check answer azoth. i trying serialize eigen::matrix type using cereal. have (loosely based on https://gist.github.com/mtao/5798888 , the types in cereal/types ): #include <cereal/cereal.hpp> #include <cereal/archives/binary.hpp> #include <eigen/dense> #include <fstream> namespace cereal { template <class archive, class _scalar, int _rows, int _cols, int _options, int _maxrows, int _maxcols> inline typename std::enable_if<traits::is_output_serializable<binarydata<_scalar>, archive>::value, void>::type save(archive & ar, eigen::matrix<_scalar, _rows, _cols, _options, _maxrows, _maxcols> const & m) { int rows = m.rows(); int cols = m.cols(); ar(make_size_tag(static_cast...

html - Embed javascript in angular ui-router view -

i'm sorry if has been answered, have no idea how search since seems specific. i've got angularjs app using ui-router dynamically load multiple views same <ui-view> element. want use jquery ui's tooltip function on 1 of h3 elements loaded dynamically ui-router, don't know put initializer such runs after h3 in dom. things i've tried: embedding <script> tag in html partial calls $("h3").tooltip() putting script tag in main parent html template - , without document.ready wrapper putting tooltip() function call in 1 of angular js files that's loading partial (when changed line alert() , seemed code running right before partial rendered, there no <h3> s yet) i'm confused how can run arbitrary javascript code on dynamically loaded elements ... think first method should have worked. when make <script> tag contain simple alert() , nothing happens. any ideas? i'm happy provide more information, think can...

javascript - Ajax success function -

i using ajax post submit form data server, validated , return message based on whether or not data valid , stored. success function in ajax post doesn't run though. here ajax post , displaying of success message: jquery.ajax({ type:"post", datatype:"json", url: myajax.ajaxurl, data: {action: 'submit_data', info: info}, success: function(data) { successmessage = 'data succesfully captured'; } }); $("label#successmessage").text(successmessage); $(":input").val(''); return false; no message gets displayed on label though. tried setting successmessage variable set value in code , displayed fine, there must wrong success function, can't see what? tried setting error callback this: error: function(data) { successmessage = 'error'; }, but still no message gets displayed. it because ajax asynchronous, success or error function calle...

java - extending a class where a parameter of the parent class extends a class -

i trying extend version of treemap subclass index words more efficiently, unsure correct syntax is. class definition treemap looks this public class mytreemap<k extends comparable<? super k>,v> extends abstractmap<k,v> { extending class in straightforward way public class treemapindexer<k> extends mytreemap<k,linkedlist<integer>> { yields error "bound mismatch: type k not valid substitute bounded parameter > of type mytreemap". i tried public class treemapindexer<k> extends mytreemap<k extends comparable<? super k>, linkedlist<integer>> { instead, yields compiler error "syntax error on token "extends", , expected". erroneous extends in "". i found thread ( generic generics: "syntax error on token "extends", , expected" ) same error message. appears different situation mine, tried public class treemapindexer<k> extends mytreemap<k, k...

emacs - How to query syntax class constituents as string of char? -

using elisp trying convert emacs syntax class \s_ string of characters constitute class using syntax table. have not been able find reference code or example identify. does have reference or code snippet share? thanks, matt update 1 : after further reading, have found table can traversed map-char-table , accumulating required characters. some utilities in use here https://launchpad.net/s-x-emacs-werkstatt/ (defun ar-syntax-class-atpt (&optional pos) "return syntax class part of syntax @ point. " (interactive) (let* ((pos (or pos (point))) (erg (logand (car (syntax-after pos)) 65535))) (when (interactive-p) (message "%s" erg)) erg)) (defun syntax-class-bfpt () "return syntax class part of syntax @ point. " (interactive) (let ((erg (logand (car (syntax-after (1- (point)))) 65535))) (when (interactive-p) (message "%s" erg)) erg)) (defun ar-syntax-atpt (&optional docu pos) (interactive) (...

vba - Copying single cell value from different closed workbooks in a sharepoint -

i have 1 master workbook , 20 other workbooks in sharepoint. using following code retrive single cell value closed workbook working fine. sub example() dim wbpath string, wbname string dim wsname string, cellref string dim ret string wbpath = "http://*****/2014/" wbname = "overview 2014.xlsm" wsname = "sheet1" cellref = "e2" ret = "'" & wbpath & "[" & wbname & "]" & _ wsname & "'!" & range(cellref).address(true, true, -4150) activeworkbook.worksheets("sheet1").range("a4").value = executeexcel4macro(ret) end sub now wanted same cell value needs copied workbooks sharepoint master workbook ranges a5, a6, a7, a8.... etc. can 1 please me or give me hint on how copy same cell values different closed workbooks same sharepoint location? i have tried following code other workbooks , working fine, wanted know there other smarter way red...

scheme - Display elements in list with for-each -

i have 1 big list of smaller 3-element-lists like: ( ("001" "bob" 80) ("002" "sam" 85) ("003" "aaron" 94) etc . . .) i'm trying create like: no.1: id=001, name=’’bob’’, grade=80 no.2: id=002, name=’’sam’’, grade=85 no.3: id=003, name=’’aaron’’, grade=94 i have access display , for-each (no "for" or "printf" functions) i've been trying create for-each function takes list and: pseudo-code: for-each list in list display "id=(car list)" display "name ="(cadr list)" " etc any appreciated! so, interpreter doesn't have printf after all? that's shame. can desired output hand, it's bit cumbersome should work on scheme interpreters, notice procedure required keeping track of index: (define lst '(("001" "bob" 80) ("002" "sam" 85) ("003" "aaron" 94))) (define (add-index ls...

android - ListView not showing items -

Image
i trying display basic array of titles in list view using fragments. , not able list items show up. wondering if can shed light. there resources understand layouts well? here list_fragment.xml , listfragment source file <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <listview android:id="@id/android:list" android:drawselectorontop="false" android:layout_weight="1" android:layout_height="0dp" android:layout_width="fill_parent"> </listview> </linearlayout> public class publictradelistfragment extends listfragment { private string trades[]; public publictradelistfragment() { trades = new string [] { "trade ?", "give ?", ...

c# - Cannot marshal 'parameter #': Internal limitation: structure is too complex or too large -

i have dll developed in c++. need use c#. [structlayout(layoutkind.sequential, size = 205004, pack = 1)] private struct mylist { public uint32 count; [marshalas(unmanagedtype.byvalarray, sizeconst = 100)] public mystruct[] info; }; "mystruct" has of size 2050. calling dll method as [dllimport("dllname.dll" callingconvention = callingconvention.cdecl)] private static extern uint32 getmylist(out mylist list); i error when call dll method. "cannot marshal 'parameter #1': internal limitation: structure complex or large." do 1 have solution not changing c++ dll parts? as error says, structure large marshalled way. have find approach. it make more sense, in view, return structs 1 @ time. avoid needing hard code upper limit of there being no more 100 structs in list. so write this: c++ int getlistcount() { return count; } int getlistitem(int index, mystruct* item) { if (index <...

sql - Set text of text item dynamically from table in oracle forms -

i using oracle forms builder 6i. have created table stores names of items in form, example detail50.z1, detail50.z2 , on. column name 'detail'. now question is, in loop in 'when_new_record_instance' want give items new text value. example detail50.z1 := 'value 1' . i have created procedure declared cursor ( c_curs_det ) fetches item name table, , in loop, want set text other value. tried: for v_rec in c_curs_det loop set_item_property(v_rec.detail, xxx, 'some value'); end loop; but can't find can put on 'xxx'. can me? you use copy procedure: for v_rec in c_curs_det loop copy('some value', v_rec.detail); end loop;

php - Ajax and checkbox array -

im new in using ajax , following tutorial link http://ricochen.wordpress.com/2011/08/02/passing-array-of-checkbox-values-to-php-through-jquery-example/ wasnt able make work can pls me on this? html code : <html> <head> <script src="jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> function doit() { var p=[]; $('input.cb').each( function() { if($(this).attr('checked')) { p.push($(this).attr('rel')); } } ); $.ajax( { url:'/test2.php', type:'post', data: {list:p}, success: functio...

sql - Selectively retrieve data from tables when one record in first table is linked to multiple records in second table -

i have 2 tables: 1. tbl_master: columns: a. seq_id b. m_email_id c. m_location_id d. del_flag 2. tbl_user: columns a. u_email_id b. last_logged_date c. user_id first table master table has unique rows i.e. single record of users in system. each user can uniquely identified email_id in each table. one user can have multiple profile, means 1 us_email_id field in tbluser table, there can many user_id in tbl_user, i.e there can multiple entries in second table each user. now have select users have logged in last time before, lets '2012', i.e before 1-jan-2012. but if 1 user has 2 or more user_id , 1 user_id has last_logged_date less 2012 other user_id has greater 2012 such user should ignored. in last all result user marked deletion setting del_flag in master table ‘yes’ eg: record in tbl_master: a123 ram@abc.com d234 no a123 john@abc.com d256 no record in tbl_user can like: ram@abc.com '11-dec-2011...

javascript - How to Pass Media Queries With jQuery CSS Method -

having media query this: @media (min-width: 768px) { .navbar-nav > li > { padding-top: 25px; padding-bottom: 25px; } } i need change style $( "#heightset" ).change(function() { var choice = $(this).val(); if (choice == "50"){ $(".navbar-nav > li > a").css({"padding-top":"15px","padding-bottom":"15px"}); } if (choice == "60"){ $(".navbar-nav > li > a").css({"padding-top":"20px","padding-bottom":"20px"}); } }); now can please let me know how can take care of @media (min-width: 768px) on .css() code affected on specific view port? thanks .my-class-15 {padding-top: 15px; padding-bottom: 15px;} .my-class-20 {padding-top: 20px; padding-bottom: 20px;} $("#heightset").change(function () { var ...

sql - Trouble with having a subquery with INNER JOIN -

i'm having trouble trying use subquery inner join. in code below, average rating i'm trying compute needs average rating of player (a.player) . from looking @ script below, my questions are : 1) should nest subquery when using inner join? 2) there 20 names in table i'm pulling information (table 'college'). in subquery need 'b.rating' specific player. need clause in subquery, "where player=a.player"? $query = "select a.player,a.team,a.loc,a.pic,a.rank,b.rating college join (select avg(rating) rating college_rating) b on a.player=b.player order rank desc limit 20"; $run = mysqli_query($link,$query); while($row = mysqli_fetch_array($run)) { echo $row['player'] . ' ' . $row['rating'] . ' ' . $row['team'] . '<br>'; } you need find average rating each palyer in subquery shown below $query = "select a.player,a.team,a.loc,a.pic,a.rank,b.ra...

sql - Include a record only if it has more than 20 related records -

this statement i'm using: select country.code "country code", country.name country, count(countrycode) "number of cities" city, country city.countrycode = country.code group country.code, country.name; i need select countries have more 20 cities. create view query afterwards. use having clause aggregate functions: ... group country.code, country.name having count(countrycode) > 20;

osx - Problems linking FreeImage 3.16.0 using make and Clang on Mac OS X 10.8 -

i've modified makefile.osx file comes freeimage 3.16.0 compile using clang , use latest 10.8 mac os x sdk, has gotten rid of of problems, i'm stuck on small set of linker errors can't find information on. i modified makefile based off of recommendations of other post on stackoverflow: how compile freeimage on mac os x 10.8? and looks like: # -*- makefile -*- # mac osx makefile freeimage # file can generated ./gensrclist.sh include makefile.srcs # general configuration variables: cc_i386 = clang cc_x86_64 = clang cpp_i386 = clang++ cpp_x86_64 = clang++ compilerflags = -os -fexceptions -fvisibility=hidden -dno_lcms -d__ansi__ compilerflags_i386 = -arch i386 compilerflags_x86_64 = -arch x86_64 compilerppflags = -wno-ctor-dtor-privacy -d__ansi__ -stdlib=libc++ include += include_i386 = -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk include_x86_64 = -isysroot /applications/xcode.app/contents/developer/pla...

objective c - iOS - How do I perform an action when the user swipes the screen? -

i want shift position of uilabels when user swipes screen--specifically, move them same distance user swiped finger. how go detecting , implementing this? thanks override touchesbegan:withevent , touchesmoved:withevent: . keep track of starting location in touchesbegan:withevent . if repeated calls touchesdragged (it called while drag happening) show moving fast enough action swipe versus drag, use difference between starting location , current touch location animate changing uilabels.

javascript - dblclick, click and overlapping elements -

i have modal click event bound it, modal has position: absolute , highest z-index value. modal floating above element has dblclick event bound it. the issue when double click modal, click event fired , modal closed (that's fine), , second click on element modal floating above, , element has dblclick event fired, not wanted. simplified fiddle: http://jsfiddle.net/4h2bx/1/ edit: i want emphasize fact modal not aware of element floating above, cannot temper element's dblclick event

java - Will these LinkedList nodes be eligible for garbage collection? -

i implementing own linkedlist . right now, i'm on clear() function removes of elements list. here code far: public class linkedlist<e> { // first element of linkedlist private node start; // last element of linkedlist private node end; // number of elements constitute linkedlist private int length; private class node { private node last; private node next; private e data; // each node has reference previous node , // next node. first element of linkedlist // have null reference previous element // , last element have null reference // next element. each node stores piece of data // in data variable. } public void clear() { start = null; end = null; length = 0; } // other methods omitted } in clear() function, set start , end references null . unsure how affect nodes in middle of linked list (or start , end nodes). ...

ruby on rails - Testing subdomains in controller specs in Rspec -

i've got controller specs working subdomains using before filter so before request.host = "an_account.example.com" end when user tries access subdomain not part of, logged out , sent devise's sign in action isnt under subdomain i.e. www.example.com/users/sign_in everything works fine in browser, sneaky users redirected barred entering unrelated subdomains , instead redirected sign in form. however controller specs failing with "expected response redirect http://example.com/users/sign_in redirect http://an_account.example.com/users/sign_in " can on this? here before_filter authorizes users def authorize_account_subdomain! if current_account.subdomain != request.subdomain sign_out flash[:warning] = t('errors.unauthorized') redirect_to new_user_session_url(:subdomain => false) end end and test context 'when signed_in' let(:user) { create(:user_with_account) } le...

eclipse - While working with Selenium WebDriver and Java I am not able to use click() function of WebDriver (giving no exception) -

i have set following properties:- set environment variables java_home,path,ant_home,path (using jdk version --> jdk1.7.0_40) in eclipse set system library, added needed jars , select jars in order , export. install firefox version 24 , used selenium jar(selenium-server-standalone-2.41.0). giving no error while running java application, no exception while not able click on particular element. sendkeys(keys.enter) working fine, instead need use click() method. also code working fine on other systems, think missing something. click() method not giving valid response, makes me feel declared not defined. have tried on different websites, on different elements , different types(xpath, css selector, name, id) nothing worked me. took focus on element webdriver , highlighting element using javascript code, showing particular element present. have performed other operations entering username after clicking on element, performing well. have worked different browsers, different we...

permissions - EPERM error writing to file in node.js -

i'm trying update gpios on raspberrypi writing /sys/class/gpio folder , it's subfolders , files. when run command fs.readfilesync('/sys/class/gpio/gpio2/value', 'utf-8'); i correct response, no problem. when run fs.writefilesync('/sys/class/gpio/gpio2/value',0); i eperm error, if understand correctly, telling me don't have correct permissions write file. when list permissions on file, see both root , gpio group have read , write permissions, , current user 'pi' part of gpio group. should fine. if run sudo node, should have permission, still eperm error. it appears me '/sys/class/gpio' virtual path '/sys/devices/gpio', looking @ permissions on folder, gpio group has permissions there too, , of course, root. is specific gpio? see few node modules enable gpio control via fs.writefile, example, https://github.com/enotionz/gpio/blob/master/lib/gpio.js writes directly same directory.

xaml - Storyboard doesn't animate if by default the control is disabled when it is loaded -

i have issue in animating storyboard when control loads first time. once loaded if change isenabled true or false works. wonder if how works. same funda works fine in windows phone app. <button style="{staticresource syncbtnstyle}" tag="/assets/topicon_refresh.png" isenabled="false" /> <style x:key="syncbtnstyle" targettype="button"> <setter property="background" value="transparent"/> <setter property="fontfamily" value="segoe ui symbol"/> <setter property="fontweight" value="normal"/> <setter property="fontsize" value="56"/> <setter property="padding" value="10,5,10,6"/> <setter property="height" value="40"/> <setter property="width" value="40"/> ...

javascript - Creating a sticky bottom footer with internal wrapper which stretches from header to footer -

i have made main framework of webpage in html / css realise need sticky footer stuck @ bottom of screen position fixed , need internal segment webpage content goes called (wrapper) stretch bottom of header top of footer, when zoom out on web browser wight segment fits whole height of browser work on display height. here js fiddle http://jsfiddle.net/q8jpc/5/ if finds out how please write code in stack overflow reply jsfiddle test website , not using real thing. i have tried setting wrapper height:100vh;, this fill screens height not allow when add content not extend fit content off screen. thankyou ! didn't apply design use technique: see: modern sticky footers i suggest use html5 markup tags, created semantics right instead of using classes header, nag, footer, etc... edit. edited fiddle here: jsfiddle just add: html { position: relative; min-height: 100%; } besides that, change body position absolute instead of fixed , add margin-body bo...