Posts

Showing posts from April, 2012

SQL - How to multiply a value in tandem with a range (EXCEL) -

i'm working excel's odbc sql driver gather data our erp system. end goal have query return stockcodes range of bom's, , multiply qtyrequired field forecast value. so, select bom#21, list of bom's stockcodes & qtyrequired fields, multiply unitqtyrequired field x , same next item in range. using command text can retrieve stockcodes range of bom's: "select bom, stockcode, description, qtyunitrequired dbo.invmaster invmaster, dbo.invwarehouse invwarehouse (bom in (" & strvals & "))" i can't seem find solution multiply qtyunitrequired result number next each bom. range looks similar this: ex. bom|qty bom21|100 bom66|150 bom12|75 i think may need change approach , loop query through each value instead i'm not sure how this. any suggestions?

linux - Weird Tomcat outage, possibly related to maxConnections -

in company experienced serious problem today: our production server went down. people accessing our software via browser unable connection, people had been using software able continue using it. our hot standby server unable communicate production server, using http, not going out broader internet. whole time server accessible via ping , ssh, , in fact quite underloaded - it's running @ 5% cpu load , lower @ time. no disk i/o. a few days after problem started have new variation: port 443 (https) responding port 80 stopped responding. server load low. after restarting tomcat, port 80 started responding again. we're using tomcat7, maxthreads="200", , using maxconnections=10000. serve data out of main memory, each http request completes quickly, have large number of users doing simple interactions (this high school subject selection). seems unlikely have 10,000 users browser open on our page @ same time. my question has several parts: is "maxconnectio

json - Spring MVC + AngularJS 415 Unsupported Media Type -

the question simple , know answered in many other question none worked me. using spring mvc , angularjs getting angularjs 415 unsupported media type ! i tried setting angular header application/json tried @consumes annotation on server side tried consumes ="application/json" tired consumes ="application/application/json;charset=utf-8' tried consumes ={"application/json","application/xml"} tried setup produces property. i tried explicitly setting hear content type on client match 1 on server but, nothing worked ! here related questions none helped ! 1 2 3 here controller /** * created adelin.ghanayem@gmail.com */ @controller @requestmapping(value = "/administration/places") public class placescontroller { private placesservice service; @autowired public placescontroller(placesservice service) { this.service = service; } @requestmapping(method = requestmethod.post,consumes = {&qu

java - OpenCV: What are the parameters for the WarpPerspective function? -

i'm building application in java uses opencv. haven't used library before, , java implementation bit lacking in documentation. need undo perspective warped image make squared up. need transform trapezoid rectangle. need stretch shorter of 2 parallel sides match length of longer parallel side. know need compute homographies , use warpperspective function, have no idea how structure command. know homography is, don't know how declare 1 , don't know feed warpperspective. let me emphasize, understand theory, need learn text syntax in code. for sake of example, let's source trapezoid has corners @ (0,20), (0,80), (200,0), , (200,100). want end rectangular "stretch" (0,0), (0,100),(200,0), , (200,200). can provide code example? images in mat form. source image destination image java code corners.add(new point(215,90)); corners.add(new point(470,90)); corners.add(new point(540,240)); corners.add(new point(150,240)); double maxwidth = 540 - 15

html - Targeting chrome not safari scss -

i looking way target chrome browsers within mixin in scss . @mixin { &:after { border-bottom:black; @media screen , (-webkit-min-device-pixel-ratio:0) { border-bottom: red; } } } this targets both safari , chrome @ moment. there no particular hack css alone whereas can override css of safari for webkit @media screen , (-webkit-min-device-pixel-ratio:0) { .class{color:red;} } safari override ::i-block-chrome,.class { color:blue; }}

javascript - Using jsPlumb with dynamic content -

ill try user jsplumb:flowchart within mysql based dynamic content. my code based on demo example flowchart:jquery im generating endpoints within database query $plumb .= '_addendpoints("drag'.$id_kurs.'", ["topcenter", "bottomcenter", "leftmiddle", "rightmiddle"]); and im adding content @ end of database content $vorschau .= ' </div> </div> <script> jsplumb.ready(function() { var instance = jsplumb.getinstance({ dragoptions : { cursor: "pointer", zindex:2000 }, connectionoverlays : [ [ "arrow", { location:1 } ], [ "label", { location:0.5,

linux - Experienced strange rdtsc behavior comparing physical hardware and kvm-based VMs -

i have following problem. run several stress tests on linux machine $ uname -a linux debian 3.14-2-686-pae #1 smp debian 3.14.15-2 (2014-08-09) i686 gnu/linux it's intel i5 intel(r) core(tm) i5-2400 cpu @ 3.10ghz, 8 g ram, 300 g hdd. these tests not i/o intensive, compute double arithmetic in following way: start = rdtsc(); do_arithmetic(); stop = rdtsc(); diff = stop - start; i repeat these tests many times, running benchmarking application on physical machine or on kvm based vm: qemu-system-i386 disk.img -m 2000 -device virtio-net-pci,netdev=net1,mac=52:54:00:12:34:03 -netdev type=tap,id=net1,ifname=tap0,script=no,downscript=no -cpu host,+vmx -enable-kvm -nographichere i collect data statistics (i.e., diffs) many trials. physical machine (not loaded), data distribution of processing delay narrow lognormal. when repeat experiment on virtual machine (physical , virtual machines not loaded), lognormal distribution still there (of little bit wider shape), however,

android - How to stretch ImageButton without the image getting blurred? -

i create new imagebutton via "resource chooser" , end code: <imagebutton android:id="@+id/imagebutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/textview1" android:layout_below="@+id/textview1" android:layout_marginleft="14dp" android:layout_margintop="94dp" android:src="@drawable/mybutton" /> now, want make button way bigger, following changes: <imagebutton android:id="@+id/imagebutton1" android:layout_width="120dp" android:layout_height="120dp" android:layout_alignleft="@+id/textview1" android:layout_below="@+id/textview1" android:layout_marginleft="14dp" android:layout_margintop="94dp" android:src="@drawable/aries" /> i change android:src="@drawable/mybutton&quo

ruby on rails - Regex that gets only initials -

is there way create regex initials without using references? example, want initials new.york and regex output n.y. (or n.y) so far have following: .\.[a-za-z]+ this outputs last initial of first word instead of first initial: w.y . update** i'm assigned regexp variable , using =~ test things. you remove lowercase letters using gsub function, irb(main):004:0> str = "new.york" => "new.york" irb(main):006:0> str.gsub(/[a-z]+/, "") => "n.y"

How do I concatenate the string elements of my array into a single string in C? -

i have array of strings , create new string concatenation of array elements. appreciated, thanks #include <stdio.h> #include <stdlib.h> #include <string.h> char *concatenate(size_t size, char *array[size], const char *joint){ size_t jlen, lens[size]; size_t i, total_size = (size-1) * (jlen=strlen(joint)) + 1; char *result, *p; for(i=0;i<size;++i){ total_size += (lens[i]=strlen(array[i])); } p = result = malloc(total_size); for(i=0;i<size;++i){ memcpy(p, array[i], lens[i]); p += lens[i]; if(i<size-1){ memcpy(p, joint, jlen); p += jlen; } } *p = '\0'; return result; } int main(){ char *ss[] = { "first", "second", "last" }; char *cat = concatenate(3, ss, ""); puts(cat); free(cat); cat = concatenate(3, ss, ", "); puts(cat); free(cat); return 0; }

Better option to "where to declare actions?(oop)" -

doubt where define actions going act on attributes of 1 class ? ex:- account class going define attributes of account account no,holder name. usual employee(class) of bank can add,update(crud) operation on customer's account. doubt in class have define (crud)actions either in employee class or in account class?. because these operations performed employee in real time.on other hand,actions need act on account attributes may define in account class itself,which better one? 'actions need performed on attributes ,defined in same class better' or 'actions defined in class respect actions they(actors) better' ? in understanding of problem describe, such "operations" go in service layer . you can see in link shared above martin fowler describes service layer as: defines application's boundary layer of services establishes set of available operations , coordinates application's response in each operation. so, in view o

jquery - Javascript DIV Movement on scroll -

nim creating animation moves div incrementally on scroll. i'm close don't think code efficient , don't know how adapt add more arguments. instance, hitting height on page move object right , stop moving down. below js , codepen can found at; http://codepen.io/anon/pen/kxhwu - original http://codepen.io/anon/pen/dlxqg - messing moving right var lastscrolltop = 0; var boxposition = $('#box').position(); var row2position = $('#row2').position(); var distance = $('#row2').offset().top, $window = $(window); console.log(distance); $window.scroll(function() { if ( $window.scrolltop() >= distance - 400 ) { var st = $(window).scrolltop(); console.log(st); $('#box').css({top: 0 + st}); //code not working if(st >= 270) { var boxpos = $('#box').position(); console.log(boxpos.left); $('#box').css({left: boxpos.left + st}); } // lastscroll

node.js - When there is a Javascript error, Socket.IO disconnect and prevent debugging -

so don't know if it's new thing in socket.io 1.1.0 whenever have javascript error, anywhere in code (even when doesn't involve socket.io @ all), socket.io disconnecting (it calls disconnect event , error event transporterror error) , then... nothing shows in firefox console nor chrome console, no debug info, nothing, , doesn't me find error... is there way prevent socket.io or thing websockets or ?

c# - small misunderstanding of example in msdn related to virtual/override -

while reading about polymorphism in msdn, saw example of virtual , overridden methods: public class baseclass { public virtual void dowork() { } public virtual int workproperty { { return 0; } } } public class derivedclass : baseclass { public override void dowork() { } public override int workproperty { { return 0; } } } derivedclass b = new derivedclass(); b.dowork(); // calls new method. baseclass = (baseclass)b; a.dowork(); // calls new method. what want know is, in scenario should this? can't see how useful in way. please give real-world example? this useful whenever want reference objects, , can't keep references of exact type. if example have list of objects of mixed types: list<baseclass> list = new list<baseclass>() { new baseclass(), new derivedclass(), new baseclass(), new baseclass(), new derivedclass(), new derivedclass() }; now have list of baseclass references, of

rest - Correct http error about missing or invalid field in json body -

my rest endpoint consumes json fields. best http status error notify user field incorrect or missing? i found info 422 unprocessable entity http://tools.ietf.org/html/rfc4918#section-11.2 the 422 (unprocessable entity) status code means server understands content type of request entity (hence 415(unsupported media type) status code inappropriate), , syntax of request entity correct (thus 400 (bad request) status code inappropriate) unable process contained instructions. example, error condition may occur if xml request body contains well-formed (i.e., syntactically correct), semantically erroneous, xml instructions. is need or prefer status error? based on description provide 422 code, sounds it's want. for example, error condition may occur if xml request body contains well-formed (i.e., syntactically correct), semantically erroneous, xml instructions. replace xml json in sentence, , there's answer!

c# - ActiveX registered as Media Type Player fails under IFrame -

i've written activex control registers player particular mime type ( application/pdf ) following instructions on msdn page . player works fine when browse directly content matches media type, fails load control if url resides inside of iframe. url iframe same file loading when browsed directly. the control signed valid code-signing cert. in other words, browsing http://localhost/test.pdf works. browsing http://localhost/pdfframe.html fails, , contains this: <html> <body> <iframe width="100%" height="100%" src="http://localhost/test.pdf"> </iframe> </body> </html> specifically, see constructor on control fire. i've implemented iobjectsafety , , see setinterfacesafetyoptions() fire, control goes silent after that. form_load() never called. could iobjectsafety implementation, or other issue? in ie, under internet options -> programs -> manage addons, addon approved run * .

opencv - Is it possible to receive a RTSP stream on the Raspberry Pi, and also resend it with a lower resolution and FPS? -

is possible receive , play rtsp stream on raspberry pi using gstreamer1.0 (with omx plugin in order use hardware acceleration) , resend rtsp stream lower resolution , lower fps rate? can process lowered rtsp stream using opencv?

swift - Currency formatting not working -

i have updated gm of xcode 6 , going through , fixing issues. i have issue particular part of code have been struggling fix. used have code: override func viewdidload() { currencyformatter.numberstyle = nsnumberformatterstyle.currencystyle currencyformatter.currencycode = nslocale.currentlocale().displaynameforkey(nslocalecurrencysymbol, value: nslocalecurrencycode)! } func textfielddidchangevalue(textfield: uitextfield) { //automatic formatting transaction value text field. target added above. var text = textfield.text.stringbyreplacingoccurrencesofstring(currencyformatter.currencysymbol, withstring: "").stringbyreplacingoccurrencesofstring(currencyformatter.groupingseparator, withstring: "").stringbyreplacingoccurrencesofstring(currencyformatter.decimalseparator, withstring: "").stringbyreplacingoccurrencesofstring(" ", withstring: "") // there special character here. line critical european/other currencies.

javascript - Openlayers errors with clone and setAnimation -

i working on web application, uses javascript , openlayers etc. i have block of code throws errors @ me time onselectrow: function(id) { if (id && id !== lastsel) { jquery(this).restorerow(lastsel); lastsel = id - 1; } submarkerarray[id - 1] = reportingavlmap.bringtofront(submarkerarray[id - 1]); latlonpoint.transform(fromprojection, reportingavlmap.map.baselayer.projection); reportingavlmap.map.setcenter(latlonpoint, reportingavlmap.map.zoom); submarkerarray[id - 1].setanimation(google.maps.animation.bounce); settimeout(function() { submarkerarray[id - 1].setanimation(null); }, 750); }, the following line var latlonpoint = submarkerarray[id - 1].attributes.lonlat.clone(); gives me error: uncaught typeerror: cannot read property 'clone' of undefined and following line submarkerarray[id - 1].setanimation(google.maps.animation.bounce); gives me error: uncaught typeerror

asp.net - Active directory module configuration with sitecore -

This summary is not available. Please click here to view the post.

c# - Dynamically changing coloration of TextBlock -

i have windows 8 application , trying create landing view it. it's still needs spupport windows 8, hub control unavailable. looks similar. first section contain darker picture , second 1 contain gridview elements on white background. , during scrolling application title should stay in place. but result have problem title textblock. while it's placed on image should white, after scrolling further should invert color of text part on white background. here sample markup: <grid background="{themeresource applicationpagebackgroundthemebrush}"> <scrollviewer zoommode="disabled" verticalscrollmode="disabled" verticalscrollbarvisibility="disabled" horizontalscrollbarvisibility="auto"> <stackpanel orientation="horizontal"> <rectangle width="500" fill="purple"/> <rectangle width="5000" height="500"

javascript - How To Break A Group of Words In A Line Into 5 lines of words -

the string example "this long sentence need break 5 lines no matter how hard try cannot seem work on website need thank you" result should be: 1 row - max 50 characters per row "this long sentence need break" 2 row - max 50 characters per row "into 5 lines no matter how hard try i" 3 row - max 50 characters per row "cannot seem work on website i" 4 row - max 50 characters per row "need thank you" 5 row - max 50 character it's blank hit finish string. ============= here script have now var string = "spand span spand span"; var arr = string.split(" "); var unique = []; var arrcount = []; $.each(arr, function (index,word) { if ($.inarray(word, unique) === -1) unique.push(word); arrcount.push(word.split(" ").length); }); alert(unique+arrcount); ====== cannot seem figure how able count total string of words , break string after hits 50 characters words , n

sql - Postgresql error: "failed to find conversion function from unknown to text" -

i have following postgresql query: ( select '201405mase04' testid, count(*) totq, count(distinct case when se1 = '' null else se1 end) totse, case when count(*)=0 7 else count(distinct rc) end totrc eivtestitems ti, eivtests t ti.test_id = t.test_id , t.test_type_id = 1 , t.test_id= '201405mase04' , ti.omit <> 1 ), b ( select '201405mase04' testid, count(*) totq eivtestitems ti, eivtests t ti.test_id = t.test_id , t.test_type_id = 1 , t.test_id= '201405mase04' , ti.omit = 1 ), c ( select '201405mase04' testid, count(*) totq eivtestitems ti, eivtests t ti.test_id = t.test_id , t.test_type_id = 1 , t.test_id= '201405mase04' , ti.

python - PLY thinks a mathematical expression is a syntax error after I implemented variables -

i've been playing around ply , after getting examples work decided should implement variables. working great mathematical expression not assigned variable seems throw syntax error (not python syntax error syntax error within language). example: calc> = 5 name: number: 5 assigning variable 5 {'a': 5} calc> 6 + 1 number: 6 syntactic error: line: 1 position: 0 syntax error: 6 number: 1 {'a': 5} i noticed put number grammar function above of variable assignments variables break , calculations work. lexer: #!/usr/bin/env python ### lexical analysis ### import ply.lex lex import colorama colorama.init() tokens = ( "number", "plus", "minus", "multiply", "divide", "lbracket", "rbracket", "name", "equals" ) t_plus = r"\+" t_minus = r"-" t_multiply = r"\*" t_divide = r"/" t_lbracket = r&qu

How to consider empty answers in Google form using Google Apps Script? -

Image
i made google form , script sends mail content of form. there 3 fields: a, b, c not mandatory. example: if enter 1, 5, , 8 script writing: a=1, b=5, c=8 the problem if b not given value (1 , 3 c), output: a=1, b=3, c= there shift of values! can ? function sendresponses() { var form = formapp.getactiveform(); var responses = form.getresponses(); var lastrow = responses.length - 1; var itemresponses = responses[lastrow].getitemresponses(); var total = "a=" + itemresponses[0].getresponse() + ", b=" + itemresponses[1].getresponse() + ", c=" + itemresponses[2].getresponse(), } thank you, frédéric when use code, it's giving me results want: function sendresponses(e) { var thisresponse = e.response; logger.log('thisresponse: ' + thisresponse); var itemresponses = thisresponse.getitemresponses(); logger.log('itemresponses: ' + itemresponses); var total = "a=" + itemresponses[0].getres

android - Google analytics for apps real time is laggish -

the real time report laggish 3-5 minutes after real action in app show in real time interface. real time report website 'real' real time 3-5 sec want know if bug in plugin or how google analytics mobile working? i using cordova , plugin: https://github.com/danwilson/google-analytics-plugin

Spring JUnit Test fail caused by: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already -

if run junit test cases @ once (~300) following exception: org.postgresql.util.psqlexception: fatal: sorry, many clients @ org.postgresql.core.v3.connectionfactoryimpl.doauthentication(connectionfactoryimpl.java:293) @ org.postgresql.core.v3.connectionfactoryimpl.openconnectionimpl(connectionfactoryimpl.java:108) @ org.postgresql.core.connectionfactory.openconnection(connectionfactory.java:66) @ org.postgresql.jdbc2.abstractjdbc2connection.<init>(abstractjdbc2connection.java:125) @ org.postgresql.jdbc3.abstractjdbc3connection.<init>(abstractjdbc3connection.java:30) @ org.postgresql.jdbc3g.abstractjdbc3gconnection.<init>(abstractjdbc3gconnection.java:22) @ org.postgresql.jdbc4.abstractjdbc4connection.<init>(abstractjdbc4connection.java:32) @ org.postgresql.jdbc4.jdbc4connection.<init>(jdbc4connection.java:24) @ org.postgresql.driver.makeconnection(driver.java:393) @ org.postgresql.driver.connect(driver.java:267)

ios - UICollectionView Cell + UiLabel with AutoLayout -

Image
i'm trying pin uilabel it's parent cell. added 4 constraints (top, leading, trailing, bottom) which works fine on ios 8.0 not on ios 7.x . please see image below: [click here full size] what doing wrong? please advise! edit #1 it seems it's broken since xcode 6 gm. approach working fine in xcode 6 beta 7. moreover, if decrease inner view's width, throws following warning: 2014-09-10 19:58:28.109 test[57827:60b] unable simultaneously satisfy constraints. @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints) ( "<nslayoutconstraint:0x799573a0 h:|-(8)-[uiview:0x798a86e0] (names: '|':uiview:0x798ae5d0 )>", "<nsla

php - Route @token confusion -

apologies if has been asked. i working on project looking display locations of business. can either state, or city (in state). i trying work these 2 routes: get /@state /@city-@state @state works well, when try navigate @city-@state page, errors because trying load @state page, , cannot find required data. looking @ base.php, found preg_match_all matching \w, should ignoring hyphen(-), reason isn't. i need urls in structure. can me notice missing? thanks! i don't think f3 allows use dash separate tokens in url; hence why it's matching first token (@state). the regex used grab tokens '/@(\w+)/', wants slash character separate tokens. suggest using /@state , /@city/@state.

php - mysql too many connection warning -

i keep getting following error when running cron job. runs every minute: error <br /> <b>warning</b>: mysqli_connect(): (08004/1040): many connections in <b>/home/eterna33/public_html/script/email_cron.php</b> on line <b>2</b><br /> <br /> <b>warning</b>: mysqli_query() expects parameter 1 mysqli, boolean given in <b>/home/eterna33/public_html/script/email_cron.php</b> on line <b>6</b><br /> <br /> <b>warning</b>: mysqli_fetch_array() expects parameter 1 mysqli_result, null given in <b>/home/eterna33/public_html/script/email_cron.php</b> on line <b>8</b><br /> <br /> <b>warning</b>: mysqli_close() expects parameter 1 mysqli, boolean given in <b>/home/eterna33/public_html/script/email_cron.php</b> on line <b>19</b><br /> here code runs in cron job every m

javascript - Print data attribute of object tag -

i trying setup system can call browser's print function print data attribute of object tag. i.e. have object tag pdf content, , want way when press button can print pdf. this have. <head> <script type="text/javascript"> function printme () { var test = document.getelementbyid('pdf'); test.focus(); test.print(); } </script> </head> <body> <object data="test.pdf" type="application/pdf" id="pdf"></object> <button onclick="printme()">print!</button> </body> now keep getting error, uncaught typeerror: undefined not function when click button. doing wrong here , how set properly?

php - Pass Query String variable into contact form email -

i have application form on page. working correctly except query string. want take url variable, , pass contact form email. ex. http://www.example.net?merchantid=12345 i want merchant id variable name , value display on email receive, along rest of user information. way sits breaks page. great send cc email without merchant id well. here markup: <form id="shortapplication" action="{site_url}application#contact-sent" method="post" enctype="multipart/form-data" data-type="advanced"> <input type="hidden" value="true" name="emailsent" id="emailsent"> <input type="hidden" name="xid" value="{xid_hash}" /> <input type="hidden" name="merchantid" value='<?php echo $merchantid; ?>' />

google drive sdk - API access to different video formats and resolutions -

when video file uploaded google drive, gets transcoded bunch of different formats , resolutions, can previewed efficiently depending on platform, screen size, network bandwidth, etc. pretty putting video on youtube. what i'm looking way direct url of different transcodings, in same way can url download original file. it's ok if url temporary. original file, i'd file: get call through api, download downloadlink url response. hoping there parameter api call specify, instead of original file, 360p webm transcoding (for example). don't see such parameter, nor alternate api call same thing. in use case, i'd calling api javascript on client side, , pasting resulting url html element. need video served cors headers (i want use video element webgl texture ). though might useful have solution didn't include cors headers. any way this? maybe unofficial workaround? the google drive api doesn't support this, nor core use case product.

how to compile apache,mysql and php in linux -

i have never used linux os. want know how can start compiling apache,mysql , php in linux , necessary configure it. tried doing using cd/user/scr/httpd_2.0.09 need downloads set google do favour , don't try compile own webserver etc. ;) aside fact it's lot of work set tools compiling, resolve dependencies, , debug possible errors, have same procedure every tiny update – instead of getting new version via package manager. if use common distribution, install packages required so-called lamp stack, , configure them properly. hard enough starters. if you're using ubuntu, have here: https://help.ubuntu.com/community/apachemysqlphp

Android - Adding Switch to the Action Bar not working -

i followed procedure explained on link bellow reason switch never displayed. changed visibility match app namespace suggested in other threads no avail. procedure works fine if try adding icon's or regular buttons. thanks lot. i'm running on nexus 4 android 4.4.4 how add switch android action bar? here current xml contents. /menu/main.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.testapp.mainactivity" > <item android:id="@+id/myswitch" android:title="" app:showasaction="always" android:actionlayout="@layout/switch_layout" /> </menu> /layout/switch_layout.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="htt

java - Fragement reference from another activity returns null -

i start details fragment in new activity when in portrait mode so.... fdetail=(historyofragdetail) manager.findfragmentbyid(r.id.fragment2); if(fdetail!=null&& fdetail.isvisible()) { fdetail.changedata(st); }else{ // portrait intent intent = new intent(this, historyoactfrag.class); intent.putextra("index", st); startactivity(intent); } while in portrait mode load fragment so... public class historyoactfrag extends sherlockfragmentactivity... @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.history_actifrag_layout); intent intent = getintent(); string myindex = intent.getstringextra("index"); historyofragdetail f2 = (historyofragdetail)getsupportfragmentmanager().findfragmentbyid(r.id.fragment2); f2.changedata(myindex); } the layout follows.

objective c - Combine static libraries -

i tried approach in question , seems linux version of ar not same mac version since failed combine object files again. what want is merge static library xcode static library build product via run-script build phase. unfortunately can't compile other library directly project because has it's own build system (therefore use compiled libs). i think should possible merge other library via ar xcode generated library without decompiling build product. how accomplish this? you can use libtool it libtool -static -o new.a old1.a old2.a

laravel 4 - Schema Builder length of an integer -

i've been searching around , question asked few times, no-one seem able give definite answer it. how specify integer length table column using schema? i've seen suggesting: $table->integer('post')->length(11); but doesn't work - @ least laravel 4.2 - still produces column int(10) . is there built in method specify integer length? if you're using mysql, can't specify length of integer column. can choose between 1 of available integer types, described @ http://dev.mysql.com/doc/refman/5.1/en/integer-types.html . hence, cannot set integer length in laravel either. can choose 1 of available types described @ http://laravel.com/docs/schema#adding-columns .

html5 - How to populate a html 5 date input -

i have modal opens form data edited. populates correctly except date input. when put date in there saves , updates fine format issue? input field showing mm/dd/yy when modal opens. plunkr <label style="margin-left:296px">date:</label> <input style="width:150px" ng-model="currentitem.changeorderdate" type="date" /> you should convert string date object before populating. $scope.currentitem = {changeorderdate : new date('2014-08-27t07:41:43.803')}; plnkr

html - What will be indexed better in search engines: img tags or background-images with screenreader tags? -

when building responsive websites use background images render appropriate image appropriate screen size. eg: #image { background-image: url(largeimage.jpg); } @media screen , (max-width: 320px) { #image { background-image: url(smallimage.jpg); } } to let screen readers know kind of element dealing add role="img" and aria-label here question: i've learned it's better seo add image company logo in actual image element. eg <img src="logo-companyname.png"> the reasoning logo show when google image searching on company name. (presuming website ranked enough) will google still "scrape" logo when implemented div? eg <div id="logo-company" role="img" aria-label="company name"></div> or still need add image somewhere desired result? google @ screen reader tags matter? use img tag. it's better number of reasons

python - Ambiguity in Pandas Dataframe / Numpy Array "axis" definition -

Image
i've been confused how python axes defined, , whether refer dataframe's rows or columns. consider code below: >>> df = pd.dataframe([[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], columns=["col1", "col2", "col3", "col4"]) >>> df col1 col2 col3 col4 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 so if call df.mean(axis=1) , we'll mean across rows: >>> df.mean(axis=1) 0 1 1 2 2 3 however, if call df.drop(name, axis=1) , drop column , not row: >>> df.drop("col4", axis=1) col1 col2 col3 0 1 1 1 1 2 2 2 2 3 3 3 can me understand meant "axis" in pandas/numpy/scipy? a side note, dataframe.mean might defined wrong. says in documentation dataframe.mean axis=1 supposed mean mean on columns, not rows... it's perhaps simplest remember 0=down , 1=across . this means: use