Posts

Showing posts from September, 2011

php - PhpUnit @depends annotation and MockObject -

this code example: class testtest extends \phpunit_framework_testcase { public function testfirst() { $factory_mock = $this->getmockbuilder('factory') ->disableoriginalconstructor() ->disableoriginalclone() ->getmock(); $factory_mock ->expects($this->any()) ->method('getdata') ->will($this->returnvalue('123')); var_dump($factory_mock->getdata()); var_dump($factory_mock->getdata()); return $factory_mock; } /** * @depends testfirst */ public function testsecond(factory $factory) { var_dump($factory->getdata()); } } this result get: .string(3) "123" string(3) "123" .null i expect third "getdata" method invocation give me same result first two, won't happen. don't understand why. please, share knowled

typo3 - jquery dropdown hide when click inside -

i'm new jquery, maybe easy question, havent found answer till now. maybe havent found right keywords search for... i have dropdown login form. use in typo3. problem is: click inside loginform hides/toggle drobdownbox. here script: <script type="text/javascript"> $(function() { var button = $('#loginbutton'); var box = $('#loginbox'); var form = $('#loginform'); button.removeattr('href'); button.mouseup(function(login) { box.slidetoggle(); button.toggleclass('active'); }); form.mouseup(function() { return false; }); $(document).mouseup(function(login) { if(!($(login.target).parents('#loginbutton').length > 0)) { button.removeclass('active');

Django Form ImageField Submit Jquery Dialog Ajax- alternatives? -

i got django-form image field. load in jquery dialog-modal. have js-function submits form, populates fields, shows validation errors. understand it's not possible post/submit imagefields ajax? is there simple solution / work around post without total reconstruction of other functions? thank you!

android - Compare two JSONObject values and return the smaller between them -

for given json: { "month": { "days": { "day1": { "start": 13914323164815, "duration": 15 }, "day2": { "start": 13914123164815, "duration": 56 } } } } i want values duration (in case 15 , 56 ), compare them , return smaller value. first got month object , tried next: jsonobject days = mymonthobject.getjsonobject("days"); jsonarray daysarray = days.names(); (short r = 0; r<daysarray.length();r++){ string dayobject = daysarray.getstring(r); jsonobject alldaysobject = days.getjsonobject(dayobject); string duration = alldaysobject.getstring("duration"); log.w(tag, "the duration is: " + duration); } on first iteration got message: duration is: 15, , on second iteration: dura

html - @font-face Not Loading In Any Browser -

i rookie @font-face. i've gone through of posts here, several tutorials , can't figure out why fonts aren't loading. i'm activating , deactivating font see if loads via server no luck. weird thing when it's activated, works in browser not locally. i have css file in fonts folder , uploaded server. i've tested demo file came font , works fine. i'm sure i'm missing basic , i'll feel stupid. here @font-face css: @font-face { font-family: 'capsuularegular'; src: url('fonts/capsuula-webfont.eot'); src: url('fonts/capsuula-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/capsuula-webfont.woff') format('woff'), url('fonts/capsuula-webfont.ttf') format('truetype'), url('fonts/capsuula-webfont.svg#capsuularegular') format('svg'); font-weight: normal; font-style: normal; and here page i'm trying work on: h

jquery ajax get database results using php json encode -

i have php code call using jquery ajax queries database , gets results , json encode results //$rows query foreach($rows $row) { $sql = 'select field1, field2 table field1= :field'; $stmt = $db->prepare($sql); $stmt->bindvalue(':field', trim($row['field_1'])); $stmt->execute(); $array = $stmt->fetchall(pdo::fetch_assoc); echo json_encode($array); } the outputting json looks this [{"field1":"j1","field2":"0088","field3":"2928868"}][{"field1":"j2","field2":"0171","field3":"2928868"}][{"field1":"j2","field2":"0249","field3":"2928868"}] the problem i'm getting processing in ajax response. s loop through each of array/rows , display data responsetext shows error. i thought should don't know definite. [{"field1":"

sql server 2008 - How to subtract today's date (current date) from delivery date SQL Query? -

i have table has current date , delivery date. want minus due date current date , want save days left in dbtable select clientid, curentdate, deliverydate datediff(day,-(deliverydate) current_timestamp) days_left dbo.tblorder e.g: today date 12/1/2014 delivery date 20/1/2014 days left 8 did in the documentation examples on how use datediff ? select clientid, currentdate, deliverydate, days_left = datediff(day, current_timestamp, deliverydate) dbo.tblorder;

progress 4gl - Dynamic array or resize extend? -

this superfluous question. there dynamic array or list in progress 10.2b? example: i create base class called "inventorytransaction". read mssql table progress , create instance of inventorytransaction class each record found add "list/array" can later process them. is there myarray:add(myitem) increase automatically array size +1 add instance of myitem array? i discovered function extent set size dynamically array not know count before reading transaction in mssql table. alternatively, execute "select count(*) mytable" before reading transaction retrieve count , extent array. thank you! happy friday! sebastien the short answer - no, 10.2b avm doesn't allow dynamically resize array. the long answer (a) add object linked list of objects, or (b) create temp-table progress.lang.object field, create new tt record each object instance want track, , assign object's pointer tt's plo field.

pci dss - Is PCI SAQ A sufficient for an eCommerce website with a custom payment page? -

the question - our payment flow follows: 1 - customer adds items basket. 2 - when viewing basket, customer can see products & has option of entering delivery address , billing address, no sensitive card details. 3 - customer proceeds new page, hosted on our website. customer enters sensitive card details here. 4 - crucially, on pressing "order", card details posted directly our payment processor. not sent our server first. i'm trying argue merchant bank fall under saq - is case? my reasoning: 1) our dedicated server managed third-party, pci compliant host. 2) never store card details. 3) while customer enters card data on webpage hosted ourselves, dynamically generated , exists in customer browser. on submitting order, details posted directly our payment processor. these details therefore never touch our server , a) not stored on server hdd or database session or b) not fleetingly held in server ram 4) have passed number of pci scans different

javascript - jquery drag/drop - activate dropzone with mouse not with center of dragged element -

i want drop elements element. problem dropzone gets activated when middle of dragged element entering dropzone. wished behaviour dropzone activated mouse enters/hovers dropzone. i'm pretty shure no brainer, not me... i tried different options example: cursorat: snap: handle: but none of them helped anything... i've created jsfiddle explain problem. http://jsfiddle.net/fxem7/3/ many , kind regards costal look @ tolerance option droppable , set value pointer , below: $("#drop1, #drop2, #drop3").droppable({ tolerance: "pointer", hoverclass: "ui-state-hover", handle: ".msghandler", drop: function(ev, ui) { console.log("msg_id = "+ui.helper[0].id); console.log("drop_id = "+this.id); } });

how to remove event.preventDefault()? -

$("#submit").on("click", function() { event.preventdefault(); var $data = $("#form"); $.post($("#form").attr("action"), $data.serializearray(), function(data) { var response = $.parsejson(data); if(response.error == 'yes') // code ok here $("#error").stop().empty().show().html('<div id="resp_message">'+response.message+'</div>').fadeout(5000); else // here wont work $("#form").submit(); }); }); all want display message or submit if query ok please me you need use jquery.off remove .on binding allow bind on click handler not have preventdefault in there http://api.jquery.com/off/

Numpy: boolean comparison on two vectors -

i have 2 vectors (or 2 1 dimensional numpy arrays same number of elements) a , b want find number of cases have that: a < 0 , b >0 but when type above (or similar) ipython get: valueerror: truth value of array more 1 element ambiguous. use a.any() or a.all() how supposed above operation? thank you i'm not understand you're trying do, might want ((a < 0) & (b > 0)).sum() >>> array([-1, 0, 2, 0]) >>> b array([4, 0, 5, 3]) >>> < 0 array([ true, false, false, false], dtype=bool) >>> b > 0 array([ true, false, true, true], dtype=bool) >>> ((a < 0) & (b > 0)).sum() 1

c# - Consuming Web Services - Confusion on Setup -

i added remote wsdl file web service app_webreferences folder. i can see objects in wsdl file - however, problem company i'm integrating sent me 2 urls. a wsdl: https://website.com/soap/queue?wsdl an endpoint: https://website.com/soap/queue?api_key=xxxxxx so - when added app_webreference used first url - worked, added project. i proceeded setup bindings such: <wshttpbinding> <binding name="queuewebservicebinding"> <security mode="transportwithmessagecredential"> <message clientcredentialtype="username" /> </security> </binding> </wshttpbinding> my client endpoint looks this: <endpoint address="https://website.com/soap/queue?wsdl" binding="wshttpbinding" bindingconfiguration="queuewebservicebinding" contract="mywebservice" name="queuewebserviceport" /> </client> the thing is, cannot life of me work. i

Disable function keys in Python curses -

i'm writing application using python curses , know if there way disable function keys. have set keypad(1) read 1 character @ time.. works insert, home, delete, pageup , pagedown keys not work function keys... i need disable function keys totally , want control keys behaviour. thanks you can use ascii codes: example 27 esc

git - Update remote repo from local repo after crash? -

my remote server crashed, fortunately had backup, backup 1 week old. since have committed , merged several changes. how re-commit changes local repo, or update remote repo local repo? when try push new commit, error: ! [remote rejected] head -> refs/for/master (missing change-id in commit message footer)

java - Oracle's function created via jdbc is in an invalid state -

when create oracle's function in sql developer ok, when create same function via jdbc in invalid state here function sample: create or replace function test_func return number begin return 100; end; java code: connection con = ...; statement stmt = con.createstatement(); stmt.execute(sql); when execute function: select test_func() dual; i error: ora-06575: package or function test_func in invalid state can explain i'm doing wrong? function needed complied use them. not compiled function gives exception. make sure not have terminating cr/lf in query. copy text editor (textpad) see if have any.

post - wordpress is_category of all subcategories of parent category -

i want show certien code inside posts (single.php) assosiated sub cats of 1 father cat. want code work post under sub cats (that under main cat) i have tryed this: <?php function get_child_cats( $catname ) { $parentcat = get_cat_id(8); $subcat = get_categories( array('child_of' => $parentcat ) ); $cat_array = array(); array_push($cat_array, $parentcat); // add parent cat array foreach ($subcat $sc) { array_push($cat_array, $sc->cat_id); } return $cat_array; }?> and this: <?php if (in_category(8) && !is_feed()) { ?> this how done: <?php $mycats = array(8); foreach (get_the_category() $childcat) { foreach ($mycats $mycat) { if (cat_is_ancestor_of($mycat, $childcat)) { ?> <ul> <?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=8'); ?></ul> <?php break 2; } } }

matlab fit a HeatMap into a subplot -

i tried fit heatmap subplot of plot. seems not compatible. every time using heatmap function, seems open heatmap 'canvas'. if save result of heatmap object , use plot or view put figure, open new figure window rather plot on existing one, hold on; command. there way make heatmap 1 of subplots? a heatmap example code: y = [1,2,3,4;5,6,7,8;4,3,2,1;8,7,6,5]; obj = heatmap(y,'symmetric','false','colormap','jet'); %this generate heatmap canvas plot(heatmap); %this display or render heatmap object figure window it seems should use imagesc rather heatmap function imagesc more compatible. using imagesc plot matrix, can set heatmap subplot.

vsto - Office.Interop.Excel How to get axis from series -

i using microsoft.office.interop.excel create chart. of series in chart series collection logarithmic, want hold of axis related particular series, set scale type logarithmic. here way it: xlaxisvalue = ctype(xlchart.axes(, excel.xlaxisgroup.xlprimary), excel.axes) xlaxisvalue.item(excel.xlaxistype.xlvalue).scaletype = excel.xlscaletype.xlscalelogarithmic it generic example, if not working plese post code.

service start mysql error libstdc++.so.6: wrong ELF class: ELFCLASS32 -

i having issue mysql installation , help when every try start mysql service error [valve@simple-vm2 ~]$ service mysql start /usr/bin/my_print_defaults: error while loading shared libraries: libstdc++.so.6: wrong elf class: elfclass32 starting mysql.the server quit without updating pid file (/var/lib/mysql/simple-vm2.servername.net.pid). [failed] (servername hidden) any suggestions appreciated!

multithreading - When, why, and how to call thread.join() in Python? -

Image
i have python threading code. import threading def sum(value): sum = 0 in range(value+1): sum += print "i'm done %d - %d\n" % (value, sum) return sum r = range(500001, 500000*2, 100) ts = [] u in r: t = threading.thread(target=sum, args = (u,)) ts.append(t) t.start() t in ts: t.join() executing this, have hundreds of threads working. however, when move t.join() right after t.start(), have 2 threads working. for u in r: t = threading.thread(target=sum, args = (u,)) ts.append(t) t.start() t.join() i tested code not invoke t.join(), seems work fine? then when, how, , how use thread.join()? short answer: one: for t in ts: t.join() is idiomatic way start small number of threads. doing .join means main thread waits until given thread finishes before proceeding in execution. after you've started of threads. longer answer: len(list(range(500001, 500000*2, 100))) out[1]: 500

How can I add reference to a variable defined in previous function in LLVM IR? -

i'm new llvm ir , i'm implementing pl0 language. http://en.wikipedia.org/wiki/pl/0 i'm generating testfile following: const = 10; var b, c; procedure check1; var dd; procedure check2; c := 2; begin dd := 1 end; begin b := -1024+53*(-514-766)/93+100; c := b end. and llvm ir generated this: ; moduleid = 'llvm module' define void @__global_main_entry__() { blockunitentry: %b = alloca i32 %c = alloca i32 store i32 -1653, i32* %b %b1 = load i32* %b store i32 %b1, i32* %c ret void } define void @check1() { procedureentry: %dd = alloca i32 store i32 1, i32* %dd ret void } define void @check2() { procedureentry: store i32 2, i32* %c ret void } i got painful error here (at destruction): while deleting: i32* %c use still stuck around after def destroyed: store i32 2, i32* %c test004_llvm_generate: /files/install/llvm_framework/llvm/lib/ir/value.cpp:79: virtual llvm::value::~value(): assertion `use_empty() &&

linux - The JAVA_HOME environment variable is not defined. How to fix in ubuntu 12.04? -

the java_home environment variable not defined environment variable needed run program. how fix in ubuntu 12.04? probably more question http://ubuntuforums.org/ that said, can do: export java_home='path/to/your/java/installation' and add same line .bashrc file have done every time log in. beware, if install java using apt-get, should not have set java_home environmnent variable.

ftp - Filezilla - need to copy items from server to desktop -

this , obvious, i'm not familiar filezilla , can't afford mistake. need copy file server desktop without removing server - live site needs remain live stands. there no "copy" option, i'm wondering if "download" option need use.. need ensure "downloading" files not remove them server. basically, need save copy of site without disturbing or disrupting online. open filezilla, connect server, see remote site , local site. navigate desktop on local site window( change location file downloaded). double click/(right click , select download) on file want download on remote site window.

linux - What is the point of magic value? -

what 'magic' value in tty_driver struct struct tty_driver { int magic; /* magic number structure */ struct kref kref; /* reference management */ struct cdev cdev; struct module *owner; const char *driver_name; .... .... /* tty driver magic number */ #define tty_driver_magic 0x5402 from tty_driver.h listing here .

xslt - Insert node into another XML, create new elements (or update existing ones) and reorder resulting document -

well, posting first question if i'm assiduously use site. i've been trying solution last 2 days without success. using of answers similar questions on site ( this , this , this , this , many, many others) i've been able make progress complete (and correct!) solution still escapes me. i have existing xml ( file1.xml ) have update based in 1 i'm generating ( file2.xml ): content of file2 has included on file1 respecting rules i'll state later, (content of files has been oversimplified show relevant elements) : file1.xml <?xml version="1.0" encoding="utf-8"?> <list> <decade lastyear="2012" firstyear="2011"> <year value="2012"> <issue year="2012" number="242" /> <issue year="2012" number="241" /> <issue year="2012" number="240" /> </year>

c# - Modify Regular Expression for "dd/MM/yyyy" -

i have regular expression "dd/mm/yyyy" works fine, "^([0]?[1-9]|[1][0-2])[./-]([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0-9]{4}|[0-9]{2})$" but want modify accepts 00/mm/2014. program interpret days in specific month. example 00/04/2014 means dates in month of april. can tell me kind of change need make above script make happen? here code using in : <asp:textbox id="textbox5" runat="server" maxlength="1" cssclass="maincontent" style="text-align:justify" validationgroup="mke" width="130px" /> <asp:imagebutton id="imgbntcalc" runat="server" causesvalidation="false" imageurl="images\calendar-schedulehs.png" /> <asp:maskededitextender id="maskededitextender2" runat="server"

mysql - database backup with cron jobs in cpanel -

i trying take in cpanel using cron jobs. my script this /usr/bin/mysqldump --user=username --password=password --host=localhost dbname | gzip > /home/username/backups/dbbackup_$date.sql.gz and in backup.sh #!/bin/bash date=`date +%y%m%d_%k%m`; /usr/bin/mysqldump --user=username --password=password --host=localhost dbname | gzip > /home/username/backups/dbbackup_$date.sql.gz and have set time every 5 mins. not happening. please suggest me doing wrong can give exact line of cron job? tried this: date=`date +%y%m%d_%k%m` mysqldump -uroot -p12345 -h127.0.0.1 db | gzip > /home/ubuntu/root/db_$date.sql.gz and worked me, may there problem cron!! to run every 5 minutes syntax: */5 * * * * sh /home/ubuntu/root/backupscript.sh

el - PropertyNotWritableException in JSF 1.2 - setter returning value -

i got troubles attribute binding in jsf 1.2 el 1.0 public class bean { private string name; public string getname() { return name; } public bean setname(string name) this.name = name; return this; } xhtml give me "property 'name' not writable" error on form submit: .. <h:inputtext value="#{bean.name}" /> .. why? 3rd party lib, there workaround solve case? change signature of setname method this public void setname(string name) this.name = name; } if want second constructor in bean class, should designed this public bean (string name) this.name = name; }

android - How to retrieve the position each view within a Gridlayout -

im new android , im wondering if there standard method used accomplish retrieval of views' positions in gridlayout. i'm dynamically adding , removing views gridlayout this addbutton.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { addbutton.setvisibility(view.invisible); button newbutton = new button(layoutanimationsbydefault.this); gridcontainer.getcolumncount(); newbutton.settext(string.valueof("position#"+"huh")); newbutton.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { gridcontainer.removeview(v); addbutton.setvisibility(view.visible); } }); gridcontainer.addview(newbutton, math.min(-1, gridcontainer.getchildcount())); } }); i've tried this.. addbutton.setonclicklistener(new view.onclicklis

Manipulating python stdout/stderr using subprocess -

i trying manipulate/strip output of 7zip command , intimate user progress of process. sample code trying use below: import subprocess proc = subprocess.popen(['7zip','arg', 'archive'],shell=true, stdin=none, stdout=subprocess.pipe, stderr=subprocess.pipe) while true: line = proc.stdout.readline() if line != '': #do striping , update pyqt label print "test:", line.rstrip() sys.stdout.flush() else: break however, real problem print statement print stdout after completion of process. there way capture stdout line line manipulate , print again? update updated script include sys.stdout.flush() yes, popen family of calls. you can see documentation here (child_stdin, child_stdout, child_stderr) = os.popen3("cmd", mode, bufsize) ==> p = popen("cmd", shell=true, bufsize=bufsize, stdin=pipe, stdout=pipe, stderr=pipe, close_fds=true) (child_stdin, child_stdout, child_st

awk to find overlaps -

i have file columns shown below. group start end chr1 117132092 118875009 chr1 117027758 119458215 chr1 103756473 104864582 chr1 105093795 106219211 chr1 103354114 104747251 chr1 102741437 105235140 chr1 100090254 101094139 chr1 100426977 101614730 chr2 86644663 87767193 chr2 82473711 83636545 chr2 83896702 85079032 chr2 83876122 85091910 chr2 82943211 84350917 chr3 89410051 90485635 chr3 89405753 90485635 chr3 86491492 87593215 chr3 82507157 83738004 chr3 85059618 86362254 i find overlap between coordinates in each group(grouped chr1,chr2,chr3..). the start , end coordinates has checked if there atleast 50% overlap others in same group. if there atleast 50% overlap, new start , end coordinates has reported in columns 3 , 4 (which range of overlap region). if don't overlap has report original start , end in columns 3 , 4. to make more clear, le

c# - How to: Single Selection with Multiple DataGridViews -

i pulling records sql database via linq , displaying entries in 2 separate datagridviews. i'm wondering best way allow 1 row selected between 2 components? for example: if a, b, , c stored in dgv1. , d, e, , f stored in dgv2. a, b, c, d, e, or f can selected @ time. what i've tried far: using selectionchanged event each dgv call clearselection() in other dgv. horrible idea since infinite loop. tried playing around cellclick event not account users changing selection via up/down keys. any appreciated , please let me know if info needed. don't call clearselection() other grid in selectionchanged event if nothing selected. i.e. if (changedgrid.selectedrows.count > 0) {othergrid.clearselection();}

ios - Connect iPhone to localhost -

i trying connect test device local server -- , while simulator works fine accessing localhost:8000, can't seem connect device. despite fact device , computer both connected same wifi network. so far, have tried work going system prefs -> network -> grabbing ip address says 'wi-fi connected mywifinetwork , has ip address 10.0.0.52'. then, go safari on device , type in http://10.0.0.52:8000 . however, gives me message being unable connect server. i've tried using 'name' of computer (which grab system prefs->sharing or more terminal window) , try typing in on device's browser so: http://mymac:8000 not work either. any ideas? thanks the way did use charles web proxy, , map production url localhost:8000. charles provides excellent documentation getting device , running purpose.

java - android hello world in idea on mac (AndroidDxRunner) -

have following error, when build hello world android app in idea using javac 1.7.0_45 compile java sources compilation completed 9 errors , 4 warnings in 3 sec android dex: [gpuinfo] exception in thread "main" android dex: [gpuinfo] java.lang.classnotfoundexception: org.jetbrains.android.compiler.tools.androiddxrunner android dex: [gpuinfo] @ java.net.urlclassloader$1.run(urlclassloader.java:366) android dex: [gpuinfo] @ java.net.urlclassloader$1.run(urlclassloader.java:355) android dex: [gpuinfo] @ java.security.accesscontroller.doprivileged(native method) android dex: [gpuinfo] @ java.net.urlclassloader.findclass(urlclassloader.java:354) android dex: [gpuinfo] @ java.lang.classloader.loadclass(classloader.java:425) android dex: [gpuinfo] @ java.lang.classloader.loadclass(classloader.java:358) android dex: [gpuinfo] @ com.intellij.rt.execution.commandlinewrapper.main(commandlinewrapper.java:115) didn't find solution yet, can help? code: package com.example.un

document - I need to delete a subdocument in MongoDB -

this structure: { "_id" : objectid("52ebf3ba71616b871600000c"), "components" : [ { "type" : "text", "text_type" : "subtitle", "pos_x" : 198.384521484375, "pos_y" : 114.43489074707031, "content" : "new subtitle", "font" : "", "font_size" : "", "color" : "", "bold" : false, "italic" : false, "underlined" : false, "rotation" : 0, "scale" : 0, "custom_css" : "", "_id" : objectid("52ebf3c171616b871600000d") }, { "type" : "text", "text_type" : "title",

php - Warning: include_once() [function.include]: Failed opening -

i have seen question asked haven't been able find answer. i made small change on 1 page of site. (changed link of icon in header) 1 page in ruins. there seems several files included page. db_conn_open.php languagefile.php includes.php 70and100mphclub.php metainfo.php prototype.php getminicart.php style.css em_popoutmenu_blue.css ac_runactive_content.js atleast these open in dreamweaver source code when open 70and100mph.php, 1 wanted in first place. now have warning on page looks this: warning: include_once(maxampsdigital/public_html/vsadmin/inc/languagefile.php) [function.include-once]: failed open stream: no such file or directory in /home/maxamps/public_html/70and100mphclub.php on line 7 it has 1 every php file connected. source code , 70and100mph.php both have @ beginning: <?php session_cache_limiter('none'); session_start(); ini_set('url_rewriter.tags', ''); include_once "maxamp

android - How to temporarily stop Crashlytics from auto-generating its files -

i attempting merge several branches within svn project in eclipse juno, crashlytics 1.1.0 integrated. however, eclipse telling me need clean workspace so. crashlytics likes regenerate com_crashlytics_export_strings.xml file, preventing me maintaining clean workspace. how can temporarily disable crashlytics can merge branches , reenable plugin? i've read did not help: temporarily disable eclipse plugin i've removed crashlytics.start() call in main activity i've tried "logging out" of plugin referenced here i've tried turning off "build automatically" project menu but these steps plugin still regenerates file immediately. please help. i have had same issue when merging branches crashlytics implemented. i found out accidentally commited com_crashlytics_export_strings.xml (res/values/) svn repository. my quick fix delete com_crashlytics_export_strings.xml file svn repository (as did not incorporate file svn:ignore right now)

html - Bootstrap - remove background from navbar link -

i'm trying work on coding website using bootstrap development kit. i've set navigation bar couple of links i'm having trouble custom links i've added. added css bootstrap.min.css file titled 'navbar-social', used house social media icons navigation bar. i added images fine , display great. problem i'm having when add link them go out of line , hovering on them gives them background box not want. i've attached screenshots , code used, cannot life of me work out background box coming from, because checking styles doesn't seem have there. i'm new css apologise if i'm missing obvious. none linked: http://prntscr.com/2ob9mj linkedin not linked, rest linked: http://prntscr.com/2ob2b2 css code added bootstrap.min.css. rest comes: .navbar-social{ float:right !important; padding:5px; font-size:18px; line-height:37px; height:20px } html: (a href removed in case) <nav class="navbar navbar-default navbar-static-top" role=

php - What should be the right API structure using CakePHP -

i've been working while on api-including project . have apiuserscontroller handles user's actions api , api controller. need ensure secure, i've created apikey() function detects if user sending request api has right credentials. my question should put apikey() function in order make use of in api controller? any api security recommendations welcomed. thank in advance! my question should put apikey() function in order make use of in api controller? easy answer, correct place authentication adapter . ceeram has created token (that's you're using) adapter cakephp. see link here . if want more secure way should go oauth suggested dave. instead of using specific oauth plugin go opauth cakephp , comes oauth strategy adapter. also instead of creating api controllers use prefix routing , share of code api actions normal actions in model. way can reused easy , no need duplicate work.

delphi - TAction.ShortCut not working in dynamically created TAction -

in delphi xe5: have tactionmanager (called actionmanager) , tribbon (called ribbon) on form. adding custom action this: actionbar := actionmanager.actionbars.add; newaction := taction.create(mainform.actionmanager); newaction.name := 'topics'; newaction.caption := 'topics'; newaction.onexecute := mainform.helptopicsitemclick; newmenu := actionbar.items.add; newmenu.action := newaction; newaction.shortcut := texttoshortcut('f1'); after place them on ribbon in page/tab , in group: rp := tribbonpage.create(actionmanager); rp.parent := ribbon; ribbon.addtab(rp).caption := 'help'; rg := tribbongroup.create(actionmanager); rg.parent := rp; rg.actionmanager := actionmanager; rg.caption := 'help'; rg.actionclient := actionbar; the action works fine when click it, when press 'f1' nothing happens. when add action manually using delphi editors shortcuts work fine. i tried: newmenu.shortcut := newaction.shortcut this doesn't help.

java - Get Spinner position and get it selected -

i need save in prefs value or position of spinner , when users access settings activity show selected. i'm having troubles.my prob in item position , use selected on list. spinner code spinner spinner = (spinner) findviewbyid(r.id.spinner1); arrayadapter<charsequence> adapter = arrayadapter.createfromresource( this, r.array.spinner, android.r.layout.simple_spinner_item); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spinner.setadapter(adapter); spinner.setonitemselectedlistener(new onitemselectedlistener() { public void onitemselected(adapterview<?> parent, view view, int position, long id) { item = parent.getselecteditem().tostring(); log.v("spinner", item); //save prefs spinner value sharedpreferences prefs; prefs = preferencemanager.getdefaultsharedpreferences(getbasecontext()); sha

css - Making shaped viewport for pictures -

Image
i'm trying make "skewed" shape viewport window pictures pic1 want make (i don't know how pictures have) pic2 picture use base (background) i'm using viewport window in css .town_window{ width:190px; height:165px; -webkit-transform: skew(20deg); -moz-transform: skew(20deg); -o-transform: skew(20deg); color: grey; opacity: 0.7; overflow: hidden; } #caluga{ background:url(images/caluga.jpg) no-repeat; width: 277px; height: 190px; } i'm getting scewed picture (i understand why), cannot figure out how accomplish task. please )) thanks in advance, alexei

html - Trouble with margins and borders -

i trying create 2 boxes 80% wide, including 8px border. (unless can create % border, not think can) now, when set 10% margin on right , left sides of boxes, off right few pixels. there way fix this? html: <div id="upcoming_show" class="front_page_item grid_8"> <div class="left front_block_headline"> <h2 class="upper_headline">upcoming show:</h2> <h1>the walrus</h1> </div> <p>the walrus show shows human spirit. main character, mickey, found lying face down on beach in middle of...</p> <p><a href="#" class="btn right">read more</a></p> </div> <div id="recent_post" class="front_page_item grid_8"> <div class="left front_block_headline"> <h2 class="upper_headline">recent post:</h2> &

Where do I manipulate and sanitize data from database in MVC PHP? -

let's have model user_model get_all_users() function: class user_model { function get_all_users() { $query = $this->db->query("select * users"); return $query->result(); // returns array data } } where in application sanitize data output? until have done in get_all_users() looping through result , returning array holding santizied , manipulated data. problem comes here: let's have date field in database table want me formatted in different ways depending on page user on. or have data need run htmlspecialchars() on. the first idea comes mind sanitizing , formatting data in views, doesn't feel right. should have kinda of layer between view , model job? how work in case? or should taken care of way else? i strongly disagree blaine. the view right place it. , explicitly only place it. only view knows data going. how transform data dependant on data going - , specifics of how different html (htmlspecialchars

java - Regex to replace all leading characters not a-Z -

i need replace non-letter characters appear @ start before letter example $ %5hello w8r^ld becomes hello w8r^ld this regex got works greate replacing none word characters not replace numbers s.replacefirst("^[\\w_]+", "") you using wrong character class. use s.replacefirst("^[^a-za-z]+", "") that is ^ start @ beginning of string [^ ]+ 1 or more (greedy - keep going until hit letter a-za-z ascii characters between a-z or a-z following comments @anubhava, changed * + . if have no match, there nothing needs replacing. it's cleaner.

jmeter - 'Unsupported Browser' response for DWR Ajax requests -

i have jmeter script has dwr ajax requests. when execute script, seeing below response dwr ajax requests: //<script type='text/javascript'> alert('error. may due unsupported browser.\nsee mailing lists @ http://www.getahead.ltd.uk/dwr/ more information.'); //</script> i appreciate if me in getting issue resolved. it looks don't provide "real-life" user-agent string header request. you need add http header manager config element send user-agent header correct line of 1 of supported browsers. for instance, mine firefox 26 follows: user-agent mozilla/5.0 (x11; linux x86_64; rv:26.0) gecko/20100101 firefox/26.0

c# - Set textbox fields with values inside jquery dialog -

we have simple asp.net grid view shows data , imagebutton edit data. upon clicking imagebutton call rowcommand event (server side event) allow edit of data. edit of data comes unfortunately in form of assigning values textbox controls inside jquery dialog. now code understand it: in grid view rowcommand event: protected void gvactions_rowcommand(object sender, gridviewcommandeventargs e) { var db = new dataclasses1datacontext(); gridviewrow row = (gridviewrow)((control)e.commandsource).namingcontainer; switch (e.commandname) { case "edit": //wants edit action item hdnopendialogactions.value = "1"; ////set fields inside grid label id = (label)row.findcontrol("lblissueactionid"); var rec = db.issueactions.single(x => x.issueactionid == convert.toint32(id.text));

iphone - IOS App switch views after login -

i'm learning develop ios in xcode 5. app uses master-detail template populates simple api i've written in php. i want users log app app can make requests api on behalf of user. i'll explain i've set (which entirely wrong): i've created login view , made initial view. login view controlled class named loginviewcontroller contains 'loguserin' method. when 'login' button in view pressed method sends post request api check user's credentials, app reads response see if valid. i'm stuck. after i've determined have valid set of credentials want 2 things: save credentials use on subsequent requests switch login view master-detail view if when app loads there valid credentials saved loginviewcontroller should switch straight master-detail view. here's loginviewcontroller.m: #import "ntfyloginviewcontroller.h" @interface ntfyloginviewcontroller () @end @implementation ntfyloginviewcontroller - (id)initwithnibn

vb.net - Jump out of code if a button is pressed -

is there way have 'listener' of sorts listen button click in middle of code? there scenarios won't have wait code complete before can exit functions cannot seem find way see if button clicked other throwing ton of if checks throughout function calls doesn't seem efficient me. this code runs on thread, different main application private function longrunningfunction() din canceled boolean = false ' make sure canceled while in loop ' long loop integer = 0 100000 if _cancelexecution canceled = true exit end if ' code runs here ......... next if canceled ' wrap thread, clean stuff, etc end if ....................... end function on main thread, when button clicked _cancelexecution set true the backgroundworker has mechanism built-in already

vb.net - Getting Specific Data from XML -

i 'm kind of new vb , .net, , i'm having trouble trying setup weather widget. i'm pulling yahoos rss feeds, storing xml file, , reading xml file. first couple of things pull in fine, yahoo's feed sends list of days/temps/highs/lows. (see below) <rss xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0"> <channel> <title>yahoo! weather - lincoln, ne</title> <link>...</link> <description>yahoo! weather lincoln, ne</description> <language>en-us</language> <lastbuilddate>fri, 31 jan 2014 12:53 pm cst</lastbuilddate> <ttl>60</ttl> <yweather:location city="lincoln" region="ne" country="us"/> <yweather:units temperature="f" distance="mi" pressure="in" speed="mph"/> <yweather:wind chill="13" direct