Posts

Showing posts from May, 2012

Spring environment validation -

we're building spring-based application delivered end users distribution package. users responsible configuring whatever needs configured (it's various filesystem locations, folder access permissions, etc). there's idea make app users understand not configured or parts of configuration invalid. our current approach custom applicationcontextinitializer environment validation "manually" , registers few "low level" beans in application context explicitly. if wrong, initializer throws, exception caught somewhere in main() , interpreted (converted plain english) , displayed. while approach works fine, i'm wondering if there best practices minimize hand-written code , use spring whenever possible. here's illustrative example. application requires folder file uploads. means: there should configuration file this file should accessible app this file should have no syntax errors this file should explicitly define specific property (let app

html - Undefined Margin/Padding at bottom of body -

i've tried using chrome's developer tools isolate problem can find culprit there margin or padding @ bottom of page i'm developing. looks margin on body or footer can't seem find it. looking fresh pair of eyes. http://idwebhosta.net/~engravea/about-engraveables/ it's copyright p margin in footer. p.copyright { margin-bottom: 0; }

c++ - WinSock2 sockaddr structure as a parameter -

what point of having functions such inet_ntop, wsaaddresstostring, recvfrom require either size of actual sockaddr structure or address family provided? the first 2 bytes of sockaddr structure indicate address family , therefore indicate whether it's sockaddr_in or sockaddr_in6. so reason additional sizeof(sockaddr_in/sockaddr_in6) , af_inet/af_inet6? sockaddr legacy type. there newer sockaddr_... types specific address families, sockaddr_in ipv4 , sockaddr_in6 ipv6, , have different byte sizes. apis operate on generic sockaddr* pointers partly historic reasons , partly flexibility. socket apis recognize multiple address types. have provide sizes apis can validate memory buffers large enough pass address data based on specified families ( af_inet ipv4, af_inet6 ipv6). in inet_ntop() , in_addr , in6_addr not contain address family, why have pass separately. responsible making sure specify correct address family input type passing in. in wsaaddresst

debugging - debuggable false in Android Studio 0.5.1 -

in version 0.4.2 write in androidmanifest android:debuggable="false" upload play.store but in 0.5.1, not do. please, me. y resolved problem with buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } foo{ debuggable false //add } } in androidmanifest i resolved problem with buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } foo{ debuggable false //add } }

wpf - how to handle DataGrid event in ViewModel class -

i trying handle datagrid event in viewmodel class. since there no command property in datagrid becomes tough handle events in datagrid. refered interaction.triggers ,but system.windows.interactivity.dll giving exception while building project. please me. here 1 example in projects. use mvvm light version eventtocommand, system.windows.interactivity.dll should work too <datagrid itemssource="{binding myview}" autogeneratecolumns="false" x:name="myprotokolllist" isreadonly="true" canuseraddrows="false" canuserdeleterows="false" canuserreordercolumns="true" selectionmode="extended" selectionunit="fullrow" selecteditem="{binding selectedrow, mode=oneway}" issynchronizedwithcurrentitem="true"> <i:interaction.triggers> <i:eventtrigger eventname=&q

php - Symfony2, set default value of datetime field -

so, have in entity datetime field : /** * @var \datetime * * @orm\column(name="timestamp", type="datetime") */ private $timestamp; each time insert in database, : $myentity->settimestamp(new \datetime('now')); so, want set default value on field in entity, when try : /** * @var \datetime * * @orm\column(name="timestamp", type="datetime") */ private $timestamp = new \datetime('now'); and after update base doctrine:schema:update have error : php parse error: syntax error, unexpected 'new' (t_new) in... how can set default value field ? don't want settimestamp each time use entity... ! you in constructor. public function __construct(){ $this->timestamp(new \datetime()); }

ios - Execute ObjC function from NSstring -

this question has answer here: using nsstring call function in xcode 4.x 5 answers this stupid question execute function in objc, example this: nsstring *function = @"-(void)execute{nslog(@"123");}" how execute string become function? i think looking for, 1. no parameter sel aselector = nsselectorfromstring(@"execute"); [self performselector:aselector]; simulation: -(void)execute; 2. single parameter sel singleparamselector = nsselectorfromstring(@"methodwithoneparam:"); [self performselector:singleparamselector withobject:first]; simulation: -(void)methodwithoneparam:(nsstring*)first; 3. multi parameter sel doubleparamselector = nsselectorfromstring(@"methodwithfirst:andsecond:"); [self performselector: doubleparamselector withobject: first

python - split list of tuples in lists of list of tuples -

i have list of tuples like: [(1,a),(2,b), (1, e), (3, b), (2,c), (4,d), (1, b), (0,b), (6, a), (8, e)] i want split list of lists @ every "b" [[(1,a),(2,b)], [(1, e), (3, b)], [(2,c), (4,d), (1, b)], [(0,b)], [(6, a), (8, e)]] is there pythonic way this? my_list = [(1, "a"),(2, "b"), (1, "e"), (3, "b"), (2, "c"), (1, "b"), (0, "b")] result, temp = [], [] item in my_list: temp.append(item) if item[1] == 'b': result.append(temp) temp = [] if len(temp) > 0: result.append(temp) print result # [[(1, 'a'), (2, 'b')], [(1, 'e'), (3, 'b')], [(2, 'c'), (1, 'b')], [(0, 'b')]]

java - Any way to zip the RestLet StringRepresentation response -

i using restlet , returning xml response stringrepresentation. 1 of service need return large amount of data makes response size close 5 mb. is there way zip response? wrapping in encoderepresentation should work psudocode: return new encoderepresentation(encoding.zip, stringrepresentation); do double check have selected correct encoding there few options.

c# - Weird dictionary ContainsKey issue -

before start, i'd clarify not other "similar" questions out there. i've tried implementing each approach, phenomena getting here weird. i have dictionary containskey returns false , if gethashcode functions return same output, , if equals method returns true . what mean? doing wrong here? additional information the 2 elements inserting both of type owner , no gethashcode or equals method. these inherit type storable , implements interface, , has gethashcode , equals defined. here's storable class. wondering if 2 guid properties indeed equal - , yes, are. double-checked. see sample code afterwards. public abstract class storable : istorable { public override int gethashcode() { return id == default(guid) ? 0 : id.gethashcode(); } public override bool equals(object obj) { var other = obj storable; return other != null && (other.id == id || referenceequals(obj, this)); } public gu

gwtp - What is the best practice for open a new page or redirect page in GWT? -

there options open new page or redirect page in gwt, & don't know 1 best? -option 1: redirect current page new page not opening new tab. string url = window.location.createurlbuilder().sethash("!search").buildstring(); window.location.assign(url); -option 2: open new page on new tab. string url = window.location.createurlbuilder().sethash("!search").buildstring(); window.open(url, "_blank", null); -option 3: redirect current page new page not opening new tab & retain states of previous page placerequest request=new placerequest(nametokens.search); placemanager.revealplace(request); in option 1 & 2, seems system starts reload whole page. option 2, if press back button reload previous page again. in option 3, seems not reload whole page (ie if have header won't download header again). therefore, run fast. if click back button won't reload previous page can still see existing states of previous page. option 3 qu

html - Chrome displaying tooltip behind link -

Image
developing plugin chrome, i've used data-tooltip links require tooltip. until 2-3 days ago, seemed working fine. today i've discovered tooltip links inside modal display behind modal. nothing has changed in code. tested older versions of app ant still displays tooltips behind modal. my guess chrome has changed way views tooltips. idea can fix it? example of tooltip usage: <div class="choose-platform" data-tooltip="googledrive"> ... </div> screenshot of error i'm facing on hover of google drive icon, tooltip appears behind modal it seems tooltip appended in body. try giving higher z-index modal box

serial port - Arduino AltSoftSerial press enter to read/print altSerial? -

don't know if there arduino-wizards around here on stackoverflow, i'm gonna try , find one! i'm having issues understanding code, , why can't automate process instead of pressing enter . i'm using rfid reader read tags, , using altsoftserial library. however, in order print tagid serial, need press enter . , love of god can't figure out why is. isn't possible check altserial.read id, , print when appears? cause when print serial automatically lot of 'fffffffffffffffffffffffffffffffffffff' noise... #include <altsoftserial.h> altsoftserial altserial; char txrxbuffer[255]; char get_readid[] = { 0xaa , 0x00, 0x03, 0x25, 0x26, 0x00, 0x00, 0xbb }; void setup() { serial.begin(9600); serial.println("hit enter read rfid number"); altserial.begin(9600); } void loop() // run on , on { int counter = 0; if (serial.available()){ serial.read(); serial.println(""); (counter =0 ; counter < 8 ; counter++){ ch

C++ Container with Fastest "Exists" Seeking (Vector/Array/etc) -

i'm not sure best c++ data container use here.... i'm building application that's sensitive latency (so need absolute fastest implementation). i need store 300,000 strings one-time (only 1 write), frequent checks if element exists in data store (many reads). never need else data set except check if value exists within it, , i'll need check hundreds of times per second. if matters, majority of lookups result in key not being found. i've considered using vector or array, seem scan through entire list , inspect value one-to-one... work... since we're indexing strings, isn't there data container builds kind of tree index values, when searching value "apple", it'll first @ keys beginning "a", next character "p", , when doesn't find "ap..." returns not found. me seems it'd faster searching entire massive set each time. i'm hoping native container has kind of functionality. this project have boos

save - Card Game Python, Saving a shuffled deck -

i writing program in python user has guess if next card in pack of playing cards bigger or smaller previous card. i've got whole program work except 1 function. i have 2 ways of playing game. 1 way shuffle deck of cards , other way play un-shuffled deck of cards (some random order put them in when making text file). want when user selects play shuffled deck, shuffled deck saved , overwrites un-shuffled deck's text file. the cards in text file saved 2 or 3 digit numbers. each suit numbered follows: 1 - clubs 2 - diamonds 3 - hearts 4 - spades as far card numbers go: 1 - ace 2 - two ... 11 - jack 12 - queen 13 - king so 5 of hearts saved 35 , , jack of clubs saved 110 here code far. this attempt @ saving: def saveshuffleddeck(deck): currentfile = open('deck.txt', 'w') count = 1 count in range(1,52+1): cardtoaddtofile = str(deck[count].suit) + str(deck[count].rank) +

javascript - Unique jQuery function to update data from any table -

i have jquery function on separate functions.js file, in charge of making sql update posting info. working properly, here can see it: function being called on php file, passing element's id info: $('.tablecontent').on('click', '.discontinueicon', function() { turnid = $(this).attr('data-id'); discontinuerow();}) function working on separate functions.js file: function discontinuerow(){ row = '#' + turnid; $.post('config/forms/turn_conf/turn_discontinue.php', { tu_id:turnid }).success(messageokkkk);} as need create many more functions updating info many tables, trying have unique function, , provide needed info being sent parameters php files. new this, not know if possible, , if can't way to. i tried store needed values on several variables on php file: $('.tablecontent').on('click', '.discontinueicon', function() { turnid = $(this).attr('data-id'); action = &

Uninitialize git repository -

i have initialized git repository , have made commit in reason not want track files in , want git going out of it. there way can uninitialize it? git stores repository related data in folder named ".git" inside repository folder. want keep files change "not-git-repository". warning: irreversible! cd path/to/repo rm -rf .git the files might remain hidden ".gitignore" files (but if added them or using tool eclipse). remove them: find . -name ".gitignore" | xargs rm

jquery - Changing value of variable based on elseif -

i new in stack, , new in jquery. found here reactions, collect these "calculator". it´s functional, there 1 problem, variable called "hodnota" isn´t changing value according elseif statement. please, problem, don´t know anybody? :-) simply need change value called "hodnota" based on variables values in "if conditions" , when select(.ninja-forms-field) changing... my code here... <script> var vyska; var barva; var rozmery; var $hodnota = $(this.hash); var pocet; rozmery=jquery("#ninja_forms_field_165 :selected").text(); barva=jquery("#ninja_forms_field_167 :selected").text(); vyska=jquery("#ninja_forms_field_166 :selected").text(); if(/200x200cm/i.test(rozmery)&&/140/i.test(vyska)&&/režná/i.test(barva)){ hodnota=2380; }else if(/200x200cm/i.test(rozmery)&&/150/i.test(vyska)&&/režná/i.test(barva)){ $hodnota=2480; }else if(/200x200cm/i.test(rozmery)&&/160/i

web services - Scala WS exception error (Web page returned instead of Json) -

i using play scala ws send rest api call web server , exception error. json sent server , response server 1 of following. server returns valid json response. server returns "no valid json found" server returns error web page triggers exception error com.fasterxml.jackson.core.jsonparseexception: unexpected character ('<' (code 60)): expected valid value (number, string, array, object, 'true', 'false' or 'null') how modify code below contents of web page without exception error? import play.api.libs.ws._ var temptext = helpers.await(ws.url("localhost:9000/someapi").post(jsontosend)).body println(temptext) tempjson = json.parse(temptext) println(tempjson) much depends on how "correct" downstream api server is. in perfect world, assert following facts: success case => http status 200 , http content-type header application/json "no valid json found" => http status 404 or simil

objective c - Disable DNS on UIWebView -

how disable dns filtering in uiwebview ?? have website has viewed on particular wi-fi , has dns filtering want bypass. thanx, seboh. this doesn't have uiwebview, more type of dns filtering network has in place. there tons of ways dns being filtered. here few possible methods off of top of head: 1. "dumb filtering" in case, ios automatically requests dns server used gateway. gateway can provide dns server filters requests. extremely easy bypass. going wifi settings , setting dns server manually, phone no longer ask gateway dns server , instead use whichever server specify. (google 8.8.8.8)     2. "smart filtering" this must little creative. in smart filtering, gateway analyzes dns packets they're sent, , if detects request blocked website, doesn't let packet through. can difficult bypass. have somehow obtain ip address registered domain name using different protocol, http or custom design. you'd need employ own server in meth

reporting services - Adding watermark or background image to vs 2013 report -

Image
how go adding watermark or background image vs2013 rdlc. able add image report data. dragged report, , repor tablix placed on image. didn't work because image obscured report tablix. put image on report tablix, table obscured. not able "set background." steps necessary make watermark or background image? you on right track setting image background. set image background image report body. set tablix backgroundcolor no color (transparent)

html - Allow Bootstrap inline code block to break? -

Image
i'm working on blaze , app uses se api grab recent content. works great finding naas, there's 1 problem. when has put whole bunch of code or entire sentence in inline code block , happens: when should (non-so site): essentially, inline code blocks aren't breaking, , pushing td out right. html generated: <tr> <td style="vertical-align:top" class="col-md-1"> <div class="score"> <h2 style="color:rgba(0,0,0,0.6); pull:right">0</h2> </div> </td> <td class=""> <div class="post col-md-9"> <h3><a href="http://stackoverflow.com/questions/22561506/how-can-i-insert-php-into-a-webpage-using-javascript/22561707#22561707">how can insert php webpage using javascript</a></h3> <hr> <span class="post-body" style="color:rgba(7

attributes - Database - Entity relationship diagram -

presentations: • details of speakers - speakers, topics, times, contact details, special requirements (if any) e.g. data projection, audio, powerpoint version • details of chairs (your model should able cope more 1 “n” number) each presentation session, there chairpersons chair presentations; changeover @ refreshment breaks, need know session each do; contact details. with info above, can fit both speakers , chairs attributes under 1 entity called 'presentation' or should create 2 new entities - 1 speaker , 1 chairs? based on question, seems want more entities those. depends on if there other specifications , data related each of entities. anyways, here's 1 possible idea: presentations entity persons entity (name , contact details) speaker_for relationship (persons presentations) chairperson_for relationship (persons presentations) this way can speak @ many presentations or chair many presentations, , can query that. person speak @ 1 presentation

python - Merge fields in a file -

i have file 7 columns, gff file having chromosomal regions.i want collapse rows region ="exon" 1 row in file.the row has collapsed on basis of regions being overlapping each other. region start end score strand frame attribute exon 26453 26644 . + . transcript "xm_092971"; name "xm_092971" exon 26842 27020 . + . transcript "xm_092971"; name "xm_092971" exon 30355 30899 . - . transcript "xm_104663"; name "xm_104663" gs_tran 30355 34083 . - . gs_tran "hs22_30444_28_1_1"; name "hs22_30444_28_1_1" snp 30847 30847 . + . snp "rs2971719"; name "rs2971719" exon 31012 31409 . - . transcript "xm_104663"; name "xm_104663" exon 34013 34083 . - . transcript "xm_104663"; name "xm_104663" exon 40932 41071 . + . transcript "xm_0929

android - Class reference after orientation change -

i wrote public class, handle ethernet communication, has thread update variables. the main activity interact class getting variables or send messages. after orientation change thread running want main activity can not datas "ethernet class". how declare class in main activity: ethip = new ethip(tot_in, tot_out, ip , port, false); start thread in ethip class thank hlep... when orientation changed activity should have recreated , new ethernet class instance created. have avoid activity recreate. change manifest as... <activity android:name=".activity.mainactivity" android:configchanges="keyboardhidden|orientation|screensize"> </activity> and override onconfigurationchanged() in activity ... @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); }

c# - Is Generic Types in C # like in Java? -

this question has answer here: c# vs java generics [duplicate] 4 answers i studied java long time , acquainted operation of generic types in language : know there @ compile time , suffering type erasure @ end of ( @ runtime information not available ) , have notion of difficulties when applying polymorphism on generic types . now learning c # , , noticed although language use similar notation ( type ) semantics not seem same . example , see question did c # runtime stores information of generic types instead of discarding , unlike java, correct? also, have never seen example in c # utilizes " jokers " ( wildcards ) , type < ? extends tipogenerico > . possible ( or necessary ) in language ? finally , c # supports individual methods ( not classes ) generics ? if yes , equivalent syntax of construction in java : public <t> void method (t par

wso2is - Customizing login pages -

i want have custom login page is. i'm following documentation here: https://docs.wso2.org/display/is460/customizing+login+pages however, don't know meant step 3: "redirecting or forwarding 'authenticationendpoint' webapp". how do this? changing configuration within installation? no, not configuration change. under wso2is multiple java web applications deployed here: /repository/deployment/server/webapps . under authenticationendpoint webapp can modify, theme pure html pages css.

Android Java.Lang.RuntimeException : Unable to start activity Component Info -

i'm new in android programmer. recently, trying make project using google map v2 in android app, i'm getting lot of error (i have add google play services library , find similar topic in here, not solved problem).please see log cat bellow : updated 03-22 13:52:29.331: e/androidruntime(17708): fatal exception: main 03-22 13:52:29.331: e/androidruntime(17708): java.lang.runtimeexception: unable resume activity {com.yai.testmap/com.yai.testmap.mainactivity}: java.lang.nullpointerexception 03-22 13:52:29.331: e/androidruntime(17708): @ android.app.activitythread.performresumeactivity(activitythread.java:2613) 03-22 13:52:29.331: e/androidruntime(17708): @ android.app.activitythread.handleresumeactivity(activitythread.java:2641) 03-22 13:52:29.331: e/androidruntime(17708): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2127) 03-22 13:52:29.331: e/androidruntime(17708): @ android.app.activitythread.access$600(activitythread.java:140) 03-22

javascript - How to dynamically change CSS style attribute of DIV tag? -

we have div tag: <div id='div1' style="background-color:red"></div> i know how can change style attribute of div tag:- can clear style value? can append value existing style attribute ? can set new value style attribute thanks in advance. var div = document.getelementbyid('div1'); // clear value div.setattribute('style',''); // or div.removeattribute('style'); // set style / append style div.style.backgroundcolor = '#ff0000'; don't modify style attribute directly when adding or changing styles unless want remove them all. javascript removeattribute: https://developer.mozilla.org/en-us/docs/web/api/element.removeattribute javascript style: https://developer.mozilla.org/en-us/docs/web/api/htmlelement.style

ruby on rails - undefined method `todo_items' for #<TodoList:0x4528c20> -

i getting error undefined method `todo_items' #<todolist:0x4528c20> in code: <h1><%= @todo_list.title %></h1> <p>find me in app/views/todo_items/index.html.erb</p> <ul class="todo_items"> <% @todo_list.todo_items.each |todo_item| %> <li><%= todo_item.content %></li> <% end %> </ul> i new rails, unsure how debug error or where possible issue . can guide me on equivalent of console.log or var_dump in rails. update: todo_items_controller.rb class todoitemscontroller < applicationcontroller def index @todo_list = todolist.find(params[:todo_list_id]) end end it looks missing has_many association in todolist class. has_many :todo_items assuming have todoitem class associated db table

r - Filling in a matrix from a list of row,column,value -

i have data frame contains list of row positions, column positions , values, so: combs <- as.data.frame(t(combn(1:10,2))) colnames(combs) <- c('row','column') combs$value <- rnorm(nrow(combs)) i fill in matrix these values such every value appears in matrix in position specified row , column . suppose manually mat <- matrix(nrow=10,ncol=10) for(i in 1:nrow(combs)) { mat[combs[i,'row'],combs[i,'column']] <- combs[i,'value'] } but surely there more elegant way accomplish in r? like this: mat <- matrix(nrow = 10, ncol = 10) mat[cbind(combs$row, combs$column)] <- combs$value you consider building sparse matrix using matrix package: library(matrix) mat <- sparsematrix(i = combs$row, j = combs$column, x = combs$value, dims = c(10, 10))

c# - Get the object from a StackPanel by index - Silverlight -

i have list of labels in stack panel. is there way item index or position in panel. example : x = 5; label l = (label) panel.children[x]; environment silverlight 5 inbrowser control

jquery - iframe sharing inside facebook -

i have jquery script image spin.this scipt come site.and showed using iframe in site.i need share on facebook.whene share post images should rotate ,is way this?. you have save rotated file on server , share link. share-thing have use facebook api: https://developers.facebook.com/docs/plugins/share-button/

angularjs - 'content_security_policy' in Chrome packaged app not allowed -

i developing chrome packaged app first time. using bluetooth api communicating smartphone. i encountered problem when trying implement angularjs: apparently content security policy should bypassed declaring in manifest file error: 'content_security_policy' allowed extensions , legacy packaged apps, packaged app. i looked , read page should running in sandbox, mean no longer have access bluetooth adapter? options making work?

jQuery draggable and revert with delay -

i trying add delay between when user drags , drops div, , when div reverts back. revertduration controls speed of div reverting back, want delay before happens. i quite unfamiliar jquery, spending time trying work out , seems should pretty straight-forward. here jquery: $( "#draggable" ).draggable({ revert: true , revertduration: 1000 }); and here fiddle http://jsfiddle.net/yxbp9/54/ thank much -e is not simple seems. the way found use function in revert option , use jquery delay wait time, dealy build other purposes (queue , animation) in case working fine. code: $("#draggable").draggable({ revert: function () { $(this).delay(5000); return true }, revertduration: 1000 }); demo: http://jsfiddle.net/irvindominin/qgtf5/

mysql - Shopping cart with PHP and SQL -

i have various number of files , database tables including artist , album , tracks . on webpage user can choose artist, album , songs or albums buy. the desired functionality is: when user selects buy album, tracks added shopping cart. here php code chunk link buying album: <p>?php session_start(); <br> $albumid=$_post["albumid"]; <br> echo "<p>going buy album $albumid</p>"; echo "<p><a href=\"shopfortracks.php\">click here continue</a></p>"; ?></p> i have got other files db queries etc. in them. there 1 artist letter, 1 album artist. then, shopping, show basket, show purchases, add basket , checkout files. any problem appreciated. additional code gettracksbyalbum.php ?php include ("dbconnect.php"); $albumid=$_get["id"]; $dbquery="select id,title tracks albumid='$albumid' order tracknumber asc"; $dbres

css - Access through multiple and mixed selectors in jQuery -

<table id="financial101_tab2" class="dxrpcontrol_moderno dxrpwithoutheader_moderno" style="border-collapse: separate; opacity: 1; margin-left: 0px;"> <tbody> <tr> <td id="financial101_tab2_rpc" class="dxrp dxrpcontent" style="padding: 6px 10px 10px; border-width: medium; border-style: …r-color: -moz-use-text-color; background-color: transparent;"> <input id="blockcontrolfinancial101_tab2ati" type="hidden" value="0" name="blockcontrolfinancial101_tab2ati"></input> <div id="blockcontrolfinancial101_tab2" class="dxtclite_moderno dxtc-top" style=""> <ul id="blockcontrolfinancial101_tab2_tc" class="dxtc-strip dxtc-stripcontainer" style="padding: 3px 0px 0px; width: 624px;"> <li class="dxtc-leftindent&qu

asp.net - Sticky footer in master page -

after days of searching code makes footer stick end of page, found works. but realized, sticks end of page if have specific resolution. if has bigger screen or looking @ page in full view, doesn’t work anymore. please help? and also, know oh-so-famous sticky-footer sites. can't seem find answer here need specific code. thanks! masterpage: <form id="form1" runat="server"> <div class="page"> <div class="header"> </div> <div class="main"> <asp:contentplaceholder id="contentplaceholder1" runat="server"> <div class="wrapper" /> </asp:contentplaceholder> </div> <asp:contentplaceholder id="footerplaceholder" runat="server"> </asp:contentplaceholder> </div> </form> contentpage aspx <asp:conte

ios - supportedInterfaceOrientations is not called in my controller -

i have complex problem (or think). i'm working on legacy application fixing issues, , making support 4 inch displays , ios 7. problem app's architecture quiet complex, several categories , method swizzling implement custom , feel in ios 4.3 , 5. the application related financial markets , stock exchanges. app designed being navigated in portrait orientation only, except couple of controllers, tilting phone change view chart of stock/market. whole app has 1 uinavigationcontroller , , in many places, uitabbarcontroller s. in controller i'm interested in, structure follows: uinavigationcontroller orientation controller changes view if orientation changed uitabbarcontroller having several uiviewcontrollers market/stock controller in first slot of uitabbarcontroller chart controller this structure used work this. when phone tilted, shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation (this pre ios 6) called on orientation co

c++ - Convert pointer to iterator in STL set / delete element in std::set using pointer -

i have set stores lot (upwards of 50k) of double type values on heap: struct user { int id; double score; } set <user*, user_comparator_descending_score> users = new set ... i create a map<key, list of pointers elements in aforementioned set> that is map<id, vector<user*> > = new map... now erase elements pointed key in map. use set::erase function accepts iterators pointing element erased. correct use delete(pointer) remove object set? quite uncertain of because set not use contiguous memory. other solutions problem highly appreciated. keep set sorted in descending order of values. require insertion , deletion in o(logn) . however, note deletion not value in set other key.

How to select the containing li with jQuery -

<li><span class="close">&times;</span> <%= item %></li> when user clicks close icon, want hide <li> . how can that? not sure how "select" span, lets assume click. $('.close').on('click', function() { $(this).closest('li').hide(); }); you'd closest li element closest();

python - Putting log files into Hive -

i have unstructured file has data like: file.log: 2014-03-13 texas 334 4.985 2014-03-13 minnesota 534 6.544 the log file not tab separated fields tab separated , not. how can put hive table? hive table schema is: create table file (datefact string, country string, state string, id int, value string); how can load log file hive table using python , or hadoop commands ? thanks! with regexserde, can use \s+ match multiple whitespace types (single spaces, multi spaces, tabs). i don't have hive instance in front of me test, should idea code below. create table file.log ( datefact string, country string, state string, id string, value string ) row format serde 'org.apache.hadoop.hive.contrib.serde2.regexserde' serdeproperties ( "input.regex" = "([0-9]{4}-[0-9]{2}-[0-9]{2})\s+(\w+)\s+(\w+)\s+(\d+)\s+([\d.]+)", "output.format.string" = "%1$s %2$s %3$s %4$s %5$s" ) stored textfile;

image upload - Rename photo completely before uploading - php -

i'd totally rename file before uploads. other posts i've found on here seem append beginning or end of file name make unique, want wipe name , rename it. input : anyoldfilename.jpg output : thisnameexactly.jpg the following function i'm working uploads doesn't rename file. name should $newfilename , i've created in function: $target = "../files/photos/" $target = $target . basename( $_files['photo']['name']); //find file extension of photo $newfilename = "thisnameexactly"; $ext = end(explode('.', $_files['photo']['name'])); $newfilename = $newfilename . "." . $ext; if(move_uploaded_file($_files['photo']['tmp_name'], $target)){ echo "image uploaded"; } else { echo "sorry, there problem uploading file."; } how can modify renames file entirely? $target = $target . basename( $_files['photo']['name']); you have

c# - Can't find Request.GetOwinContext -

i have been searching hour trying figure out why isn't working. i have asp.net mvc 5 application webapi. trying request.getowincontext().authentication, can't seem find how include getowincontext. here code: using system; using system.collections.generic; using system.linq; using system.net; using system.net.http; using system.web; using system.web.mvc; using system.web.security; using taskpro.models; namespace taskpro.controllers.api { public class accountcontroller : apicontroller { [httppost] [allowanonymous] public returnstatus login(loginviewmodel model) { if (modelstate.isvalid) { var ctx = request.getowincontext(); // <-- can't find return returnstatus.returnstatussuccess(); } return base.returnstatuserrorsfrommodelstate(modelstate); } } } from i've read, should part of system.net.http, i've included , still is

javascript - Target only the contents of a folder in gulp -

i'm using gulp compile project. i'm using gulp-zip zip bunch of files. i want zip files in "dist" folder, i'm using this: var thesrc: ['dist/**/*']; gulp.task('createmainzip', ['createpluginzip'], function () { return gulp.src(thesrc) .pipe(zip('main_files.zip')) .pipe(gulp.dest('compiled')); }); this compiles files zip in following way: dist file.css another.js folder file.js however, want this: file.css another.js folder file.js without dist folder. there way using different src path? thanks help. gulp-zip doesn't honor base . see background: https://github.com/sindresorhus/gulp-zip/issues/10 https://github.com/sindresorhus/gulp-zip/pull/11 https://github.com/sindresorhus/gulp-zip/blob/master/index.js#l30 now, can (admittedly ugly): var gulp = require('gulp'); var zip = require('gulp-zip'); var thesrc = ['**/*']; gulp.task('cr

asp.net mvc 4 - jquery fileupload Images Uploaded to Server Not Showing -

i able add files , upload them website correctly existing images on server not display in table correctly. show blank rows in table. href 'file:///d:/hosting/11318691/html/images/penguins.jpg' when believe should ' http://www.mywebsite.com/images/penguins.jpg '. using godaddy if matters. you need edit .html file images <img src="/images/penguins.jpg'" > rather <img src="file:///d:/hosting/11318691/html/images/penguins.jpg'" > . web editing software using?

c# - Sitecore - Go back to parent bucket -

Image
hi guys i'm having question regarding bucket items in sitecore. i have following structure: i want create button on 'test' detail page goes top bucket 'news overview'. like: linkmanager.getitemurl(sitecore.context.item.parent) the problem here direct parent bucket '44' , not 'news overview'. best way create link overview bucket? thanks in advance! there extension method in item gives bucket item of current item. its in sitecore.buckets.extensions namespace in sitecore.buckets.dll assembly. you can use this: var bucketitem = sitecore.context.item.getparentbucketitemorparent(); var urltobucket = linkmanager.getitemurl(bucketitem); you can use bucketmanager check if item contained within bucket: bucketmanager.isitemcontainedwithinbucket(sitecore.context.item)

c# - RadComboBox Binding Selected Value -

i have radcombobox , i'm trying bind selected value data i'm pulling table in database. <telerik:radcombobox id="cborole" runat="server" datavaluefield="usertype.id" datatextfield="usertype.value" text='<%# bind("usertype") %>' datasourceid="odscertifications" > </telerik:radcombobox> here data public partial class certification { public certification() { this.courses = new hashset<certificationcourse>(); } public int id { get; set; } public string title { get; set; } public string description { get; set; } public int duration { get; set; } public nullable<system.datetime> expiration { get; set; } public bool isactive { get; set; } public string createdby { get; set; } public system.datetime createdon { get; set; } public string updatedby { get; set; } public nullable&

css - 3 column layout with edge columns as wide as their content? -

could please explain how alter my example has: 3 columns wide container right, left columns wide content therein (ie shall not wrap inline child elements) center column take remaining width, wrapping its' content necessary all 3 columns maintain equal height (i.e. if middle column grows in height due wrapping of its' content, content should not spill under either right or left columns) container can still wide parent element fiddle : http://jsfiddle.net/qg98e/ - tried using floats middle column's content expectedly spills over, flowing around right/left columns: markup above fiddle html: <p>other content above</p> <div id="container"> <div id="left"> <button>foo</button> <button>bar</button> </div> <div id="center"> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

c# - MVC 5 WF4.5 : Dynamic View select in running workflow -

i contemplating on creating few workflows using wf4.5 mvc 5. of these workflows human workflows (state based), long quite straight forward. of them require me show runtime decided view (or pre-configured view based on rules) view when state has been transitioned for e.g. step 1: customer1 drafts loan request (loanview) step 2: teller1 (with review permissions) reviews , submits request (loanview) step 3: manager1 (with bank profile) reviews request (loanview) step 3a: manager1 checks few options e.g. requestcreditscore step 3b: can manager1 choose *view* available in project next step(s)? step 4: underwriter1 generates credit score, , adds comments (creditscoreview) step 5: otherusers review information based on *views* chosen manager1 please can me point in right direction, idea here under customer folder there many views (and more added on time). in step 3b hoping manager can choose views required re-certified e.g. loancommitments , insurance , monthlyspendanalysis

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

my test list<person> mylist; @test public void testisvalidperson() { mylist = new arraylist<person>(); mylist.add(new person("tom")); when(persondao.get(person)).thenreturn(mylist); when((persondao.get(person)).isempty()).thenreturn(false);//------exception thrown boolean result = service.isvalid("tom"); assertfalse(result); } method tested: public boolean isvalid(string person){ persondao = new persondao(); person personobj = new person(person); return (persondao.get(person).isempty())?false : true; } exception thrown: org.mockito.exceptions.misusing.wrongtypeofreturnvalue: boolean cannot returned get() get() should return list *** if you're unsure why you're getting above error read on. due nature of syntax above problem might occur because: 1. exception *might* occur in wrongly written multi-threaded tests. please refer mockito faq on limitations of concurrency testing. 2. sp