Posts

Column height per class with JavaScript and PHP -

i have following code in script set max height each column. however, intend set max height individually 4 columns per row . won't execute function per class. here's javascript: <script type="text/javascript" > $(document).ready(function() { <?php $test = $cart->count_contents(); ($i=0, $n=$test; $i<$n; $i++) { ?> setheight('.<?php echo 'col'.$i; ?>'); <?php } ?> }); //initialize global variable, store highest height value var maxheight = 0; function setheight(col) { //get element class = col col = $(col); //loop col col.each(function() { //store highest value if($(this).height() > maxheight) { maxheight = $(this).height();; } }); //set height col.height(maxheight); } </script> i pull out each row mysql database php , generate following html: <div class="ui-grid-c ui-bar ui-bar-e"> <div class="ui-block-a"><div class="ui-bar ui-bar-b" style=...

number formatting - JSTL padding int with leading zeros -

i'm trying use jstl build form. have select input months need months 2 digits i.e. padded left 0 1-9. i have obvious doesn't give me want. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <select class="forminput"> <c:foreach var="i" begin="1" end="12" step="1" varstatus ="status"> <option><fmt:formatnumber pattern="##" value="${i}" /></option> </c:foreach> </select> this has have been done before can't find example after bit of searching. found answer: minintegerdigits <select class="forminput"> <c:foreach var="i" begin="1" end="12" step="1" varstatus ="status"> <option><fmt:formatnumber minintegerdigits="2" value="${i}" /></option> ...

security - Where should I store an encryption key for php? -

i'm writing php application accepts sensitive customer data, , need encrypt before storing in mysql database. i'm going use mysql's built-in aes functionality column-level encryption. i want avoid storing encryption key on server, , i'm going provide web-page administrator log-in, , enter encryption key. want store key in memory while application running, never permanently disk. what best way this? can modify $_server array store information between requests? can store key apache in way? maybe shared memory? rather rely on mysql aes encryption, why not use php's native openssl encryption scheme (a pecl extension). requires private , public key, public encrypt, private decrypt, , keys can kept in separate places.

c# - How to retrieve the data out of a Silverlight DataContext Object -

i have silverlight application collection of form fields , buttons. i've created method stub handles click event in xaml.cs. when inspect sender during debug, can see base type textblock, , in datacontext object within textblock see custom type's properties. 1 of them guid - sender's type, cast textblock , can see datacontext, not sure how type's field value out of object: private void sometextfield_mouseleftbuttondown(object sender, system.windows.input.mousebuttoneventargs e) { var datacontext = (textblock) sender; var assetguid = datacontext.datacontext. / // intellsense not show fields, indexers, or getters - says "get or set datacontext fields in datacontext". } as stated, if debug , place watch on sender, go 2 levels deep can see objects fields. thanks. if can see in debug mode, datacontext of textblock needed object, have cast object. private void sometextfield_mouseleftbuttondown(object sender, ...

cpu usage - Unable to import android.server.* package -

i trying use android.server.processstats class cpu usage statistics (pcpu, idle time, etc) of app on android device, i'm not able import package android.server required use class. after searching on net, came know android.server package not part of standard sdk. can please tell me how/where should find package. thanks! there go . rest of package included.

c# - Scheduling Dependent Jobs in Quartz.Net -

i need help. trying figure out how schedule jobs in quartz.net. jobs in quartz correspond tasks in web application, each apart of job in web application. want users able launch job (webapplication context) on demand , have run or schedule job in future and, possibly repeat on given interval. know how these items accomplished in quartz individually, having hard time putting together. for example, in web application, may have job several task, in specific order. want able schedule these tasks in quartz execute in same order determined in web application. have idea of how this? have read on quartz documentation saying store next job in jobdatamap, struggling it. i waiting create quartz jobs until user requests either schedule job or run it. think should creating job , trigger on creation of task in web app , pulling information task object scheduling in quartz? on second paragraph: if understand correctly, have set of jobs, user can select , put in order of execut...

java - Get Enum Instance from Class<? extends Enum> using String value? -

i'm finding difficult put exact question words, i'll give example. i have 2 enum types: enum shape { cat, dog; } enum color { blue, red; } i have method: public object getinstance(string value, class<?> type); i use method like: // somevalue "red", , someenumclass color.class color c = getinstance(somevalue, someenumclass); i've been having trouble determining how implement getinstance() . once know exact enum class want instantiate, it's easy: color.valueof("red"); but how can above line accomplished unknown class ? (it is, however, known someenumclass subclass of enum .) thanks! public static <t extends enum<t>> t getinstance(final string value, final class<t> enumclass) { return enum.valueof(enumclass, value); } and method used as: final shape shape = getinstance("cat", shape.class); then again, can use final shape shape = shape.valueof("cat"); ...