Posts

Showing posts from April, 2010

get user viewed products from his Cookie or Session in magento -

i want user viewed products in magento.is possible.like on start show empty data view product want products info , show user.any clue or guidelines appreciated .thanks you can have modification in following class. better extend it. mage_catalog_productcontroller -> viewaction() $myvalue = $productid; mage::getsingleton('core/session')->setmyvalue($myvalue); to retrieve: $myvalue=mage::getsingleton('core/session')->getmyvalue(); to unset: mage::getsingleton('core/session')->unsmyvalue(); for array: mage::getsingleton('core/session')->setdata('yourarray',array(1,2,3)); other way. here $value can array/object mage::getsingleton('core/session')->setxxx(serialize($value)); …… $value = unserialize(mage::getsingleton('core/session')->getxxx()); look here more info

sql - To retrieve not null value -

my requirement is select * emp comm not null; how find not null (or) null values without using null (or) not null keyword. why want avoid using is null , is not null ? that's simplest , logical approach. if you're determined where nvl( comm, -99 ) = -99 will give rows comm null assuming comm can never have value of -99. where comm > -99 will give rows comm not null assuming non-null values of comm greater -99. it make no sense write query way, however, when can use is null or is not null , end more maintainable query.

asp.net mvc 3 - 2 Models of same Properties, MVC3 -

good day guys! i've started using mvc3, i've 2 models in application i.e. "page" , "pagehistory" both has same properties. except "pagehistory" has 1 property called "pageid" references "page" model. my question doing in correct way? or should use inheritance this. if inheritance option, how can handle this, examples me lot. my model looks follows: public class page { private readonly indiantime _g = new indiantime(); public page() { createdon = _g.datetime; properties = "published"; tags = "page"; relativeurl = string.empty; } public string path { { return (parentpage != null) ? parentpage.heading + " >> " + heading : heading; } } [key] public int id { get; set; } [stringlength(200), required, datatype(datatype.text)] public s

opencv - HTTP live stream AVAsset -

i implementing n http live streaming player osx using avplayer. able stream seek , duration timing etc. want take screen shots , process frames using opencv. went using avassetimagegenerator. there no audio , video tracks avasset associated player.currentitem. the tracks appearing in player.currentitem.tracks. not able sue avassetgenerator. can find out solution extract screenshots , individual frames in such scenario? please find code below how initiating http live stream thanks in advance. nsurl* url = [nsurl urlwithstring:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; playeritem = [avplayeritem playeritemwithurl:url]; [playeritem addobserver:self forkeypath:@"status" options:0 context:avspplayerstatuscontext]; [self setplayer:[avplayer playerwithplayeritem:playeritem]]; [self addobserver:self forkeypath:@"player.rate" options:nskeyvalueobservingoptionnew context:avspplayerratecontext]; [self addobserver:self forkeypat

python - Flask: Getting at Blueprint options in view code -

flask's blueprints let me pass optional values when register blueprint. how them later? from flask import blueprint, g bp = blueprint('test', __name__, url_prefix='/test') @bp.route('/') def index(): ... value of `foo` from? ... app.register_blueprint(bp, foo="bar") as far can see options pass in register_blueprint used flask's internal setup of blueprint (e.g. configuring url_prefix, subdomain, etc. options). aren't available @ request time. maybe helpful if explain why want access value within request? have considered using pluggable view? http://flask.pocoo.org/docs/views/ with views can subclass view , override __init__ pass values in usable within request. you can subclass blueprint , same thing, it's little more code & complexity. did here (see blueprintwrapper). although if rewrite try rid of metaclass.

java - Parsing date to remove timezone -

i use following simpledateformat parse string, simpledateformat ft= new simpledateformat("eee mmm dd hh:mm:ss yyyy"); string notimezone = ft.format(startdatetime); date date = ft.parse(notimezone); startdatetime date object value in format "thu mar 06 12:27:55 ist 2014". in notimezone variable get, thu mar 06 12:27:55 2014 i expecting output in variable date as, thu mar 06 12:27:55 2014 but getting same , thu mar 06 12:27:55 ist 2014. how remove time zone date object. please help. java.util.date does not have timezone . not aware of timezone . when print, java picks default time zone. conceptually, cannot have date time without timezone. date time has in 1 , 1 zone. may convert other zones, can never without zone. if business use case requires awareness of time zone, prefer use calendar class, or joda time . avoid playing date class. if business use cases not require time zone awareness, go ahead date. assume date instances

sd card - Android Nexus 5 code to create hidden folder stopped working -

//the code working fine on nexus 5 months stopped working, //it working fine on other devices same os version kitkat. below //code. please suggest asap.checked permissions in manifest fine. public static file getpicturestoragepath(int storagelocint) { // todo auto-generated method stub string path = environment.getexternalstoragedirectory() .getabsolutepath().tostring() + "/.drivermaticsv/" + activejourney.journey_folder_id + "/picture/"; map<string, file> externallocations = externalstorage .getallstoragelocations(); file sdcard = externallocations.get(externalstorage.sd_card); file externalsdcard = externallocations .get(externalstorage.external_sd_card); environment.getexternalstoragestate(); //long count = system.currenttimemillis(); if (sdcard == null) { path = null; } el

javascript - one jquery function is disabling the other -

Image
<!doctype html> <!-- --> <!--[if ie 8]> <html lang="en" class="ie8"> <![endif]--> <!--[if ie 9]> <html lang="en" class="ie9"> <![endif]--> <!--[if !ie]><!--> <html lang="en"> <!--<![endif]--> <!-- begin head --> <head> <meta charset="utf-8" /> <title>f.e.g | admin dashboard </title> <meta content="width=device-width, initial-scale=1.0" name="viewport" /> <!-- begin global mandatory styles --> <script src="js/text_class.js" type="text/javascript"></script> <script src="web/assets/plugins/flot/jquery.flot.js" type="text/javascript"></script> <script type="text/javascript" src="/js/bmain172.js"></script> <script src="/js/text_class.js" type="

asp.net mvc 4 - loading dropdown list with data from table in mvc4 -

i have 3 models , corresponding tables (enquirymodel, employeemodel, regionmodel). want populate dropdown list in both 'create' views of enquiry , employee. dropdown list should filled data 'region_name' field in regionmodel table. how can this? i have regionmodel: namespace mvcconquery.models { [table("region_details")] public class regionmodel { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int32 region_id { get; set; } public string region { get; set; } } } and have employeemodel , enquirymodel, give following code in controller of these models: public actionresult create() { ienumerable<selectlistitem> abc = new selectlist(db.regions, "region_id", "region"); viewbag.regions = abc; return view(); } i give code in create view: @html.dropdownlist("region

javascript - Google maps markers aren't showing up -

i seem have searched every question , google maps api can't see why markers aren't showing on map. i've taken code other areas , console isn't showing errors. code <script type="text/javascript"> //declare namespace var up206b = {}; //declare map var map; //set geocoder var geocoder = new google.maps.geocoder(); function trace(message) { if (typeof console != 'undefined') { console.log(message); } } //function gets run when document loads up206b.initialize = function() { var latlng = new google.maps.latlng(-31.954465, 115.859586); var myoptions = { zoom: 13, center: latlng, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions);

linux - shebangs script behaving strange in machine to machine -

i have executed below code in 1 linux machine, there executing fine, when execute in linux machine, giving errors like error:( declaration not correct -- @ line array=($@) declare not correct -- @ line declare hash code: #! /bin/sh str="ssidradio0=russia&ssidradio1=japan&country=th&radiob=1&radioa=0&txpowerradio0=8&txpowerradio1=12&radiobchan=3&radioachan=60&publishssidradio0=1&publishssidradio1=1&supportedtxrateradio0=12&supportedtxrateradio1=18&refreshrate=2000&inactperiod=600" ifs='&' set -- $str array=($@) declare hash in "${array[@]}"; ifs="=" ; set -- $i; hash[$1]=$2; echo ${hash[$1]} >>help;done please me the problem sh softlinked specific shell. can change when context change. in ubuntu, sh bash when start interactive shell , dash if start script. when have switched 10.04 12.04 sh shebanged scripts failed ! might have version problem user286

linux - Run several jobs parallelly and Efficiently -

os: cent-os i have 30,000 jobs(or scripts) run. each job takes 3-5 min. have 48 cpus(nproc = 48) . can use 40 cpus run 40 jobs parallelly. please suggest script or tools can handle 30,000 jobs running each 40 jobs parallely. what had done: i created 40 different folders , executed jobs parallely creating shell script each directory. i want know better ways handle kind of jobs next time. as mark setchell says: gnu parallel. find scripts/ -type f | parallel if insists on keeping 8 cpus free: find scripts/ -type f | parallel -j-8 but more efficient use nice give 48 cores when no 1 else needs them: find scripts/ -type f | nice -n 15 parallel to learn more: watch intro video quick introduction: https://www.youtube.com/playlist?list=pl284c9ff2488bc6d1 walk through tutorial (man parallel_tutorial). command line love it.

php - Error in configuration Zend Framework 1.12 application.ini -

i'm making simple website have use table db , perform webservice task. nothing complicated. i've taken configuration other projects in root folder , pasted them in configuration, , bootstrap files. application ini following: [production] phpsettings.display_startup_errors = 0 phpsettings.display_errors = 0 phpsettings.date.timezone = "europe/rome" includepaths.library = application_path "/../library" bootstrap.path = application_path "/bootstrap.php" bootstrap.class = "bootstrap" appnamespace = "application" resources.frontcontroller.controllerdirectory = application_path "/controllers" resources.frontcontroller.params.displayexceptions = 0 includepaths.library = application_path "/../library" resources.layout.layoutpath = application_path "/layouts/scripts/" ;connessione al db resources.db.adapter = pdo_mssql resources.db.params.host = "ip" resources.db.params.username = user reso

Javascript/PHP continuous integration, testing, deployment -

i building web application in javascript php/mysql backend. entire ui javascript based, except index.php contains few php lines. out of that, works ajax calls. have php backend answering ajax calls json. i have few questions on how create "clean" deployment process. process should contain: ci running javascript & php unit tests, backend json tests js compression deployment test server ui/acceptance testing eventual deployment prod server what tools should use that? see many ci servers, 1 can javascript testing , compression , php unit testing? how can staging in javascript , php? don't want javascript on test instance connect prod backend, neither test backend connect prod database. how should implement switch ? moreover, would better if split project in 2 parts - front-end , back-end or ok deploy/test whole javascript/php thing 1 package? thank lot help you can ci of heterogeneous projects using jenkins aside of unit tests can set

php - Nav Bar issue: only show links in nav bar when logged in as admin[SOLVED] -

i want code show when im logged in admin have written code exept when add like <a href=""></a> in php code crashes so when use: </html> //check if logged in <?php session_start(); $loggedin = $_session['loggedin']; $loggedinadmin = $_session['positief']; ?> //or have use code below check if logged in (i can leave out if ($loggedin) <?php session_start(); // start session $loggedin = $_session['loggedin']; // loggedin? // not logged in, kill page , ask them login. if ($loggedin != "1") { die('sorry not logged in, please click <a href="testlogin.php">here</a> login');} $logadmin = $_session['logadmin']; // loggedin? // not admin, kill page , ask them login. if ($logadmin != "1") { die('you have no power here! click <a href="test.html">here</a> return shell');} //in line above need edit? doesn't show items have no righ

SSIS Precedence Constraint Expression not working -

Image
i have int variable user::filelinecount scoped in loop container , in task within loop, want proceed task depending in variable's value . in precedence constraint editor have chosen evaluation operation expression , expression @filelinecount!=0 . there version other task @filelinecount==0 . when debug, can see user::filelinecount value 0 when step on task unable step. not implemented. error. thanks help edit : apparently debugger not step on reason error conditions still not work properly. edit2 : the other 1 @filelinecount==0. doesnt work without or'in in picture.

ios - How to replace a number as an image in Xcode 5 -

i kinda new xcode , making program. when person gets score, output on screen. example, person got score of 132, show score "132", how replace numbers image instead of using font, numbers showing image. thinking if there anyway use output numbers picture, wouldn't put them in order or wouldn't work anyway. if can me, i'd appreciate it. thanks! one = [uiimage imagenamed:@"1.png"]; //image number 1 2 = [uiimage imagenamed:@"2.png"]; //image number 2 3 = [uiimage imagenamed:@"3.png"]; //image number 3 nsstring *score = "132"; //this score user got if ([score rangeofstring:@"1"].location == nsfound) { imagescore = one; //if score contains one, image adds image 1 } if ([score rangeofstring:@"2"].location == nsfound) { imagescore += two; //if score contains two, image adds image 2 } if ([score rangeofstring:@"3"].location == nsfound) { imagescore +=three; //if score contains two

android - Light sensor gauge -

Image
introduction for job, need use light sensor aplication. i'm learning android, decided create simple app reads light sensor's values shows it. concern i know how read light sensor's values , i'm actualy doing it. need create gauge represents these values. this: being lower limit 0, , higher limit 30000lx (my mobile can read 60000lx think 30000lx enough). to this, started tutorial here . i'm not able adapt temperature values light values , redesing scale, as can see on picture, there numbers floating, don't put values, hand doesn't appear, etc. so, appreciate lot if me adapting code tutorial, providing me example or link, or me finish app. finally i've decided base in 1 link

logging - TFS 2013 default template run powershell script and log output -

running powershell script within build process has become really straight forward vs 2013. unfortunately no write-host commands being logged tfs build log. so after build completed cannot log file , see powershell shell script did. the log file says: run optional script after msbuild 00:03 run optional script before test runner 00:00 run vs test runner 00:00 run optional script after test runner 00:00 ... the activitylog.agentscope.1.xml log file more talkative still has few information. run optional script after msbuild00:00:03 inputsenvironmentvariables: enabled: true arguments: filepath: $/cmp04/some/project/main/web/.scripts/ci/ci.ps1 outputsresult: 0 c:\windows\system32\windowspowershell\v1.0\powershell.exe -executionpolicy remotesigned -noprofile -noninteractive -file "d:\ws_build\1\cmp04\ip-main\src\some\project\main\web\.scripts\ci\ci.ps1" any idea how can debugging information tfs build logs? i of course create log file, plan b :) edit: write-

android - Animation lags on large screen sizes -

i have relativelayout stores 5 imageview , each of them contains image of cloud. images differ in size, smallest being 582*182 , largest being 700*400. size of area contains clouds 860*1080. in top of screen image want load onto server , below relativelayout described above. when user falls on screen clouds start moving. problem whole animation lagging badly (i'm trying run on htc one). animation described below: <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fillenabled="true" android:fillafter="true"> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="12000" android:toxdelta="-12%p" android:repeatcount="infinite" android:repeatmode="reverse"/&g

hadoop - Web based Visualization tools pulling large data sets directly from hive -

i'm looking @ web based visualization tools pulling large data sets directly hive . my use case -: have done offline analysis,the results of stored tables in storage box (hadoop) , can queried via hive. in these tables have field interested in visualizing. since need expose , visualization multiple stakeholders need hosted on web, possibly on 1 of our internal web server. @ point in time, data should securely connected , directly connect via hive my criteria -: cost of license(vs 1 time purchase) leraning curve & adaptablity (low priority, important)visualization formats suited digital advertising use-case, funnels, lift attribution etc. i tableu, expensive (upward of 10000 usd per year) - looking @ good, cheaper. evaluated datameer , looks promising, have used similar usecases , experiences ? i haven't tried yet, perhaps zeppelin ( http://zeppelin-project.org ) might useful at.

javascript - Issue with scoping, when calling a function in a callback -

when clicking inside canvas generate ball , move clicked location when ball get's location want remove itself. think have problem scope when calling removeball() function. you can find working example her: jsfiddle /* * main app logic */ function main() { this.canvas = "canvas"; this.stage = null; this.width = 0; this.height = 0; this.init(); } main.prototype.init = function() { console.clear(); this.stage = new createjs.stage(this.canvas); this.resize(); //start game loop createjs.ticker.setfps(30); createjs.ticker.addeventlistener("tick", this.gameloop); //click event handler this.stage.on("stagemousedown", function(evt) { main.fireball(evt); }); }; main.prototype.fireball = function(evt) { var bal = new bal(evt.stagex, evt.stagey); }; main.prototype.resize = function() { //resize canvas take max width this.width = window.innerwidth; this.heigh

javascript - YUI create div in every input[type=text] -

hi ~ pardon ignorance, i'm new yui3. create clear button in every input textbox. attempt create div , append every input text. attempt fail. kindly need guidance here on code tried below.. thanks in advance! yui().use("node", function(y) { y.all('input[type=text]').each(function(node) { var outerdiv = y.node.create('<div class="clrinput">x</div>'); outerdiv.setstyles({ position: absolute, left: node.get('offsetleft')+this.get('width')-10, top: node.get('offsettop'), width:node.get('width'), height:node.get('height') }) node.appendto(outerdiv); }); }); the reason why not seeing outerdiv never becomes part of dom. it's created, , input node append ed it, outerdiv never added dom. node.appendto(outerdiv); y.one('body').append(outerd

c# - how to add conditional formatting on cells with values greater than a specific constant value using epplus -

i have made excel sheet programmatically. , want add conditional formatting on specific cell range. the formatting type cells values greater 0 (>0) how go doing it? in excel can using inbuilt formula of cell values greater than . how embed in excel using c# , epplus? i coudnt find exact solution problem. adding own solution works var celladdress = new exceladdress( <startingrow>, <startingcolumn>, <endingrow>, <endingcolumn>); var cf = ws.conditionalformatting.addgreaterthan(celladdress); cf.formula = "0"; cf.style.fill.backgroundcolor.color = color.lightgreen;

ServiceStack Swagger - Mark method as 'New' or 'Updated' -

i'm going shot down in flames asking this: i want mark endpoints in api 'new' or 'updated' when developers through swagger ui can see of recent additions. does such thing exist? that doesn't exist in core swagger-ui functionality or servicestack's swagger support. but, can roll own without effort. trick summary , notes properties of routeattribute support raw html. decorate dto this: static class docs { public const string newapi = @"<em class=""new-api"">new!</em> "; } [route(...., notes = docs.newapi + "detailed description of dto goes here")] public class mydto { ... } // or [route(...., summary = docs.newapi + "summary goes here")] public class mydto { ... } then can add css swagger-ui index.html: .new-api { background-color: #ffff00; font-weight: bold; font-style: normal; } now can append string constant notes or summary property on app

cordova - Phonegap config.xml error cvc-elt.1: Cannot find the declaration of element 'widget' -

hello guys i've created new phonegap app , gives me error. no errors when i'm creating project cmd. when import project eclipse cvc-elt.1: cannot find declaration of element 'widget'. error showing. i didn't have problems before error up. not figure out on own. please help.

getjson - jQuery JSON parse: undefined object -

i have used jquery's getjson() data server. response looks me. how looks {"user" :[{"username":"nupac"},{"username":"nupac2"}]} when alert(objects.keys(jsonresponse)); user in alert box fine when try access data jsonresponse['user'] undefined . why getting undefined? think should array of objects. edit: here code real url, function getlmslinks(email){ $.getjson("url?student=" + email, function(d) { alert(object.keys(d)); alert(d['user']); }).fail( function(d, textstatus, error) { //alert("fail " + textstatus + " error " + error); console.error("getjson failed, status: " + textstatus + ", error: "+error) }); } are looking this var jsonresponse = { "user": [{ "username": "nupac" }, { "username": "nupac2"}] }

javascript - Prevent bootstrap-3 modal from closing when the form has changes -

i'm trying prevent bootstrap-3 modal closing without warning when there changes made form inside modal. when listen events fired modal , return false prevent modal closing ever. here's code: $(function() { $('body').live('shown.bs.modal', '#quickbutton-create', function () { $(this).find('#quickbutton-create form').monitor(); }); $('body').live('hide.bs.modal', '#quickbutton-create', function () { if ($(this).find('#quickbutton-create form').monitor('has_changed')) { if (!confirm('are sure?')) { return false; } } }); }); so in short, in case; how prevent modal closing once. ok figured out, instead of return false needed event.preventdefault() jsfiddle here: http://jsfiddle.net/acybv/1/ $(function() { $('.modal').on('shown.bs.modal, loaded.bs.modal', function(e) { // set f

scala - Is Atlasian Bamboo 5.x compatible with Play Framework 2.x -

can build , deploy play framework 2.x projects atlasian bamboo 5.x? i see there sbt plugin bamboo apparently doesn't support bamboo 5 , above. will interested know if others having success babmoo , play or if should stick hudson or jenkins we building, testing , deploying several play 2.x projects using bamboo. using script tasks. long agents have sbt installed, seems working fine.

pointers - cannot convert arg from char to const char in c -

void squeeze(char str[], char c) { char newstr[150]; int len = strlen(str); char *new_ptr; new_ptr = newstr; (int = 0; < len; i++) { if (str[i]!=c) *new_ptr=str[i]; new_ptr++; } printf("the string without character %c is: %s", c, newstr); } i tried run code, showing error int strcmp(const char*,const char*); cannot convert arg char const char i know in strcmp prototype, both args passed should of const char , dont know how str[i] can changed constant, modify code accordingly. tried create char variable temp hold str[i] , isn't working either. im new pointers, im not sure if im doing correct. can pls help? try this void squeeze(char str[], char c) { char newstr[150]; int len = strlen(str); char *new_ptr; new_ptr = newstr; (int = 0; < len; i++) { if (str[i]!=c) *new_ptr++ = str[i]; } *new_ptr = '\0'; printf("the string w

Trying to checkout file from svn using java code(svn cli) -

this trying do: 1) take svn url input user 2) take svn username input 3) take svn username input 4) take directory path checkout needs done input now, passing checkout command cmd prompt through java code.somehow, file if not getting checked out through java code, on running same command on cmd prompt able checkout file.pfb code running. runtime rt = runtime.getruntime(); rt.exec("cmd.exe /c start "+"svn co 'http://testing//its_r2_final_1.0_14feb' -- username 12345 --password 'abc@mar14' --non-interactive", null, new file ("d://test_svn")); rt.wait(1700); please help. point noted here when dont use non-interactive opens command prompts username , password,once provide credentials,it checks out fine.

html - Is it possible to force printing of images? -

i have series of forms have option printed before being submitted our system. the trouble is, radio buttons custom, , use images instead of default controls. print view (in firefox/chrome @ least) hides these completely. i know can not use images, need same style throughout. also company logo needs appear on header of each page. is possible force browser enable images on printing?

eclipse - WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock -

whenever start eclipse, keep getting message printed in console again , again. warning: couldn't flush user prefs: java.util.prefs.backingstoreexception: couldn't file lock. the message seems clear, how know file trying lock for? here excerpt .log file seems relevant: !entry org.eclipse.ui.navigator 2 0 2014-02-27 13:40:53.913 !message can't find navigator content descriptor id: org.eclipse.jst.servlet.ui.enhancedjavarendering !entry org.eclipse.mylyn.tasks.ui 4 0 2014-02-27 13:40:57.125 !message not load repository template extension contributed org.eclipse.mylyn.bugzilla.ide connectorkind bugzilla !entry com.google.gdt.eclipse.login 4 0 2014-02-27 13:40:58.904 !message not flush preferences while saving login credentials

ios - Apple Auto Renewal In-App Purchase Expiry Time -

i making app auto renew in-app purchase. first time api bit confused auto renewal logics. grateful if guys can me these 2 logics- 1) when user buys new subscription, expiry equal date or date/time. example - buy subscription month today @ 2.00pm. expire next month @ 2.00pm or @ midnight. means renew subscription date or time purchase it. 2) during auto renewal, mentioned in apple docs, apple starts trying renew subscription 24 hours before expiry date. if user somehow cancels auto renewal between these 24 hours apple still renew subscription or cancellation take affect (assuming subscription hasn't been renewed). please answer it. lot in advance.

jsf - How to dynamically wrap Primefaces component in a div? -

i want dynamically enclosed primefaces component in <div> tag. possible? example using <p:inputtext /> will rendered as: <div> <input id="j_idt18" ...> </div> i tried creating custom component extending pf's inputtext , in renderer manually enclosed inputtext markup like: @override protected void encodemarkup(facescontext context, org.primefaces.component.inputtext.inputtext inputtext) throws ioexception { responsewriter writer = context.getresponsewriter(); string clientid = div.getclientid(context); writer.startelement("div", div); super.encodemarkup(context, inputtext); writer.endelement("div"); } it's working fine when ajax update on inputtext component, div rerendered , recreated again. how prevent div being rerendered in markup? i can't use composite component custom component. thanks wrap input in <h:panelgroup layout="block&

sql - Excel MDX - same period last month - totals -

i have following mdx expression helps me display data 'same period last month' cube per day. filter( [date].[date].[date], [date].[date].currentmember.member_value >= dateserial(year(dateadd('m', -1, vba![date]())), month(dateadd('m', -1, vba![date]())), 1 ) , [date].[date].currentmember.member_value < dateadd('m', -1, vba![date]()) ) now redo code display total period without breaking down per day. reason is, if example want see total number of active users same period last month can't sum numbers of daily users higher real number of total users in period (user may active on more 1 day , want count him once period). i tried chaning code nothing works far. ideas? many in advance, maciej

android - Dynamicaly add layout in layout? -

i have layout , need insert in kind of blocks text - comments date, name, text. there way use this (int r=0; r<10;r++) { textview t1=(textview) findviewbyid(r.id.text1); t1="blabla"; mainlayout.add(commentlayout); } so listview without adapter , etc. <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="name" android:id="@+id/comm_name" android:layout_marginleft="20dp" android:layout_margintop="24dp" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> <textview android:layout_width="wrap_content" android:l

azureservicebus - How Reliable is access to Azure Service Bus? -

i have azure vm running third party server process. server process notifies me of important events calling executable give it, passing in data command line argument. this data needs queued , processed worker. it's important these notifications aren't missed, i'm wondering: is acceptable (given requirement) queue messages directly azure service bus? or should queue first local msmq, have worker reads messages msmq , pushes them azure service bus? thanks the access service bus reliable, have build solution in order cope "transient faults". way can check if fault happens (a temporary 404 on queue, connection problem @ side, etc). these faults called transient faults , should retry on them. this, service bus client has built in functionality , on client, can specify retrypolicy. there different retry policies available , can create own (exponentialbackoff, etc) check : http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebu

php - how to redirect to secure section of website with Login script created in redbeanphp -

Image
$email = trim($_post['email']); $pass = md5(trim($_post['password'])); $user = r::findone("user"," email = ? , password = ? ", array($email,$pass)); if($user != null) { // login header('location: http://www.google.com/'); } else { // bad login } now framework provided in redbean create login script in file runs when submit form on website - require_once('xyz.class.php'); if (isset($_request['apiname']) && $_request['apiname'] != null) { $apiname = $_request['apiname']; switch ($apiname) { case 'requestsignup': echo uberhealth::requestsignup($_request['email']); break; case 'contact': echo uberhealth::contact($_request['email'], $_request['msg'], $_request['name'], $_request['subject']); break;

Issue with Open Shift Origin Mongo DB service -

i have installed openshift origin v3 on aws ec2(fedora19) using oo-install.the set 1 broker +one node. i making modifications security groups make more restrictive - , ended issues in mongo service. 1.service mongod not start , status shows failed. the /var/log/mongodb/mongodb.log says thu mar 6 11:24:08.189 [initandlisten] error: listen(): bind() failed errno:99 cannot assign requested address socket: :27017 thu mar 6 11:24:08.189 [initandlisten] exiting running oo-accept-broker -v says fail: error logging mongo db: moped: retrying connection primary replica set :27017">]>: moped: retrying connection primary replica set :27017">]>/moped: --username retrying, exit code: 1 any pointers on how resolve appreciated. thanks shabna i try rolling changes security groups first , make changes 1 one , see 1 causes issue, post stack , see if can comment on specific change affecting mongodb.

Appium Android Windows: driver.findElement(By.name(" ")) is not working consecutively -

Image
webelement username=driver.findelement(by.name("username")); username.sendkeys("test"); webelement password=driver.findelement(by.name("password")); password.sendkeys("test"); webelement loginbtn=driver.findelement(by.name("login")); loginbtn.click(); webelement backbtn=driver.findelement(by.tagname("button")); backbtn.click(); when using above testcase, username running when going password showing following error. debug: appium request initiated @ /wd/hub/session/71ed55ce-c3ae-46d8-9ce7-67452 0992c0a/element/1/value debug: request received params: {"id":"1","value":["test"]} info: pushing command appium work queue: ["element:settext",{"elementid":"1", "text":"test"}] info: [bootstrap] [info] got data client: {"cmd":"action","action":"element :settext","params":{&qu

java - how to store whole resume inside mysql database in servlet/jsp? -

resume uploading/downloading in java i want store resumes inside mysql database , download in system. resume size upto 5 mb. how it?? currently i saved path in database , resume in folder. refer servletfileupload() provided servlet technology, below piece of code demonstrating reading of file submited client. protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { try { list<fileitem> items = new servletfileupload(new diskfileitemfactory()).parserequest(request); (fileitem item : items) { if (item.isformfield()) { // process regular form field (input type="text|radio|checkbox|etc", select, etc). string fieldname = item.getfieldname(); string fieldvalue = item.getstring(); // ... (do job here) } else { // process form file field (input type="file"). string fieldname = item.getfiel

how to edit the attachment file in ASP.net MVC4 -

i have created list of project in crud operation, in have created list of projects uploading attachment. problem when update project list. unable read inserted file , unable upload attachment file. businees access layer code is public bool updateproject(projectinfomodel upd) { try { int projectid = upd.projectid; string projectcode = upd.projectcode; string projectname = upd.projectname; int projecttechnologiesid = upd.projecttechnologiesid; int projectengagementmodelid = upd.projectengagementmodelid; int clientid = upd.clientid; datetime projectstartdate = upd.projectstartdate; datetime projectenddate = upd.projectenddate; string remarks = upd.remarks; datetime createddatetime = upd.createddatetime; int createdby = upd.createdby; int lastmodifiedby = upd.lastmodifiedby; datetime lastmodifieddatetime = up

serialization - Java: when to serialize non-serializated objects or put them to transient? -

i puzzled non-serialized fields, objects in serialized object @ new work. should serialized or should marked transient serialization? here example: @stateless public class nonserializedthingstateless{ ... } @requestscoped public class nonserializedthingrequestscoped{ ... } @named @sessionscoped public class serializedbean implements serializable{ @inject private nonserializedthingrequestscoped nstrs; @inject private nonserializedthingstateless nsts; private list<something> list; //or else pojo ... } is there , simple way can tell when should serialize injected or used classes or guideline? is true have choose between serialization , putting things transient, or there other ways? first, word of warning: want use @inject simple cases (usually singletons). else, autowiring works can confusing fast. that said, rule transient simple: when read object (deserialize), still have everything need recreate original state? if object depends on

matlab - Is default '\n' line terminator can be changed? -

is default '\n' matlab line terminator can changed? can use ',' instead of '\n'? because serial port reading programmed terminate when ',' read.is possible? answers highly appreciated! in advance! use eg: ser = serial('com1'); % establish connection between matlab , com1 set(ser, 'terminator', 'cr'); % set communication string end on ascii 13 and replace 'cr' ',' see http://www.swarthmore.edu/natsci/ceverba1/class/e5/e5matlabexamples.html http://www.mathworks.co.uk/help/matlab/matlab_external/terminator.html

java - Want to calculate number of login members in System using Spring SessionAttribute? -

i working spring. whenever user logs in following model.addattribute("user",user); where model object of modelmap model; and adding user in session @sessionattribute({"user"}); now want calculate how many members logged in ? possible in continues way? you approach wouldn't work (at least lot of code), because dealing session objects, not accessible outside respective session. you have have external tracking object keep track of session authentications , sessions destroyed. can see , example here .

c# - Pass model and modellist data together to a partial view - ASP.NET MVC 5 -

i working on asp.net mvc 5 app. need create form in partial view. in form passing viewmodel hold related model class instances. 1 of model classes, need pass data list can print in foreach loop in razor code. now need pass model of few classes , list data of 1 model view... many thanks view model: public class qualificationviewmodel : leo.dal.viewmodels.iqualificationviewmodel { public qualification _qualification { get; set; } public qualificationtype _qualificationtype { get; set; } public subject _subject { get; set; } public componentscheme _componentscheme { get; set; } } controller: [httpget] public actionresult createnewqualification() { var model = new qualificationviewmodel(); var componentlist = //imagin list of components need send along viewmodel ?????????????????????? return partialview("partialqualification_create", model); } view (need fix part (display list data here ) @model

c# excel format each row in rtf -

i working on application has convert valuables each row rtf document. excel file using has more 10.000 rows 5 columns. far can read file using value2.tostring method. 5 values each row, provide them header firsttext= text of cel a1 secondtext= text of cel b1 thirdtext= text of cel c1 fourthtext= text of cel d1 fifttext= text of cel e1 and same cel a2, b2 etc etc. code far //create com objects. excel.application xlapp = new excel.application(); excel.workbook xlworkbook = xlapp.workbooks.open(@"c:\aaa.xlsx"); excel._worksheet xlworksheet = xlworkbook.sheets[1]; excel.range xlrange = xlworksheet.usedrange; int rowcount = xlrange.rows.count; int colcount = xlrange.columns.count; //iterate on rows , columns , print console appears in file //excel not 0 based!! (int = 1; <= rowcount; i++) { (int j = 1; j <= colcount; j++)

java - screenshots don't change when layout changes -

i'm using viewpager main navigation in app. i'm using actionbar, well. want achieve when user clicks search button in actionbar want have blurred background. approach take screenshot, blur it, set imageview , display overlay on whole view. , works. problem when first open search displays proper screenshot. turn overlay off, change page in viewpager , click search again , ... can see previous screenshot- not new 1 new page on it. here snippets of code: show , hide overlay on search click (i'm passing r.id.container view parent id of content view, menuoverlay imageview referenced layout) here's method takes screenshot , makes blurry // ad. 1 item.setonactionexpandlistener(new menuitem.onactionexpandlistener() { @override public boolean onmenuitemactionexpand(menuitem menuitem) { if(menuitem.getitemid() == r.id.action_search) { menuoverlay.setimagebitmap(utils.takesnapshot(findviewbyid(r.id.container)));

ruby on rails - dynamically insert greater than > | less than < | equals to = operators into a query -

my app allows filtering via get. www.mysite.com/rating=5 www.mysite.com/rating>5 www.mysite.com/rating<5 i can split params[:filter] into: column (filter) value (5) operator (=,>,<) so after queried laptop model , did basic ordering, filter results if set. if params[:filter] != "all" . . case operator when "=" laptops = laptops.where("laptops.rating = ?", value) when ">" laptops = laptops.where("laptops.rating > ?", value) when "<" laptops = laptops.where("laptops.rating < ?", value) end end i wondered if there way add operator dynamically similar value . when add >= , <= code gets repeated 5 times ! i tried: laptops.where("laptops.rating ? ?", operator, value) but added operator string, naturally resulted in error syntax error: near "laptops.rating '>' '6'" any ideas how can

profiling - java profiler with flame graph output -

in perl there nice profiler available called nytprof. in it's report includes flame graph , makes easy find bottleneck of program is there equivalent java profiler produces same report? try : https://www.npmjs.com/package/javaflamegraph npm install javaflamegraph npm start

c# - Connection String problems with OLEDB on a Remote Server -

my goal: create program can copy sharepoint database daily sql server. should run server, , should run daily. current status: sharepoint website linked local copy of accessdb file type accdb open oledb , program runs locally generating tables/columns/datatypes , copying data. problem: when take solution , try deploy remote server has popup window asking user in segment of code opens accessdb. need window die. process must automatic cannot require human input run. i have spent better part of day trying thing go away , program run without it. no luck google, stackoverflow, connectionstrings.com, or msdn , lot of other random websites. relevant code: public void opendatafromaccess(string connectionstring, string tablename, string connectionstring2) { string sqlquery = "select * [" + tablename +"]"; try { using (datatable dt = new datatable()) { using (oledbconnection c

asp.net - How to get the value from 4 tables -

i want generate report 4 tables.could not figure out how it. using sql server 2008 r2 , asp.net frontend. [table 1] ---> 2014 ----------------------------- division totalprograms ----------------------------- edd-coa 3 edd-edsd 2 edd-eoa 6 edd-soa 2 edd-woa 3 table2 ----> 2013 ------------------------------ division totalprograms ------------------------------ edd-coa 24 edd-edsd 3 edd-eoa 14 edd-soa 7 edd-woa 11 table3 ----> 2012 ------------------------------ division totalprograms ------------------------------ edd-coa 12 edd-edsd 1 edd-eoa 9 edd-soa 7 edd-woa 12 table4 ---> 2011 (note : edd-soa not present in table) ------------------------------- division totalprograms ------------------------------- edd-coa 2 edd-edsd 1 edd-eoa 3