Posts

Php sessions switch image -

this question exact duplicate of: php imageswap script stuck php sessions imageswap [duplicate] i have home button on website, home button image of house. want make website userfriendly website. if clicking on button home button changing color , opens homepage. person knows on page he/she is. code far. the problem of script it won't switch image i'm not expert in php sessions scripting, me out? searched google , couldn't find related question. <?php session_start(); $_session['1'] = $_get["active"]; if (!empty($_get["active"])){ ?> <a href="<?php echo $this->createurl("/admin/survey/sa/index")."home"; ?>"> <img src='<?php echo $simageurl;?>home1.png' alt='<?php $clang->et("default administration page");?>...

asp.net mvc - How to use Moq with Entity Framework IDbSet Count() etc. methods -

i'm trying use moq make tests entity framework code first classes. i'm new moq , mocking techniques , wonder if it's possible test describe below. searched through web solutions, based on repository pattern, want avoid. i have itestentities interface context public interface itestentities { idbset<order> orders { get; } idbset<product> products { get; } idbset<user> users { get; } } then context public class testentities : dbcontext, itestentities { public testentities() : base("name=testentities") { } public virtual idbset<order> orders { get; set; } public virtual idbset<product> products { get; set; } public virtual idbset<user> users { get; set; } } a controller , action test public class homecontroller : controller { private itestentities db; public homecontroller() { db = new testentities(); } public homecontroller(itestentities db) {...

java - How to Prevent JSP Page Refresh -

please can 1 me idea on how prevent jsp page refresh when request parameter triggered. below line of code: string action = request.getparameter("cmd"); if (action == null) { system.out.println("you here2"); action = ""; } else if(action.equalsignorecase("examselected")){ system.out.println("the exam id of long value " + examid); arraylist<subject> subjectname = new arraylist<subject>(); i want when action on examselected, let jsp page not refresh. in response. if want update info o page without refreshing can use ajax updating info on page. here detailed tutorial describes how to ajax requests. https://netbeans.org/kb/docs/web/ajax-quickstart.html

css - jquery mobile: How to insert an image into button -

i have kind of problem. have button: <button type="button" data-theme="c">test</button> and here instead of text test insert picture: <img src="resources/images/test-icon.png" align="middle" /> i tried couple of options couldn't find solution. thank help! bacause selected tag assume using jquery mobile styled buttons , not classic native browser button version. if case example never work. while amits example 1 never work in jquery mobile. when jquery mobile styles button hiddes old 1 , creates new 1 out of a tag. takes button text , redirects click events real (now hidden) button. we can use information modify new button styles. unfortunately in case of inputt button , input submit can't done without javascript. so show solution. jquery moible button can constructed this: <a data-role="button" class="custom-button">button text goes here</a> we can modify...

android - Gson fromJson() returns object with null attrubutes -

Image
i'm trying create java objects using line: quiz currentquiz = gson.fromjson(json, quiz.class); but this: here object classes: quiz: public class quiz { private string ref; private string broadcast_dt; private question[] questions; public quiz() { // todo auto-generated constructor stub } public string getref() { return ref; } public void setref(string ref) { this.ref = ref; } public string getbroadcast_dt() { return broadcast_dt; } public void setbroadcast_dt(string broadcast_dt) { this.broadcast_dt = broadcast_dt; } public quiz(string ref, string broadcast_dt, question[] questions) { super(); this.ref = ref; this.broadcast_dt = broadcast_dt; this.questions = questions; } public question[] getquestions() { return questions; } public void setquestions(question[] questions) { this.questions = questions; } } question: public class question { private int question_number; private string question_text; private ans...

php - plupload should save large and small image -

i using plupload save multiple images, want store same image 2 sizes, small image thum , large image display in large. how plupload store 2 sizes of images? it easier implementing need in server side... for plupload; can make use of function: resize : {width : 500, height : 600, quality : 90}, you should able achieve need if made use of events such fileuploaded reupload same uploaded file different parameters. here take @ discussion; should guide right path http://www.plupload.com/punbb/viewtopic.php?id=555

qgis - Change offset of geotiff file -

i need change offset of tiff files exporting qgis. qgis gives them offset of 0xbd72, while program need load them in reades files offset of 0xbcde. does know how change offset of tiff file in qgis or python/gdal or other way? (i trying make dtm of same shape srtm ace2-data, north of 60deg, use in compass c-pilot, flight instrument paragliding. needs data in offset 0xbcde , 0x2ee2 bytes per row.) since gdal software configures , writes data, take @ technical manual . in particular, see creation options section, there many options affect resulting file. also, it's not clear mean "offset", need clarify it. also, ideal tiff file, run gdalinfo example.tif to idea of ideal structure.

Start the script on Hover jQuery Cycle -

i have done jquery cycle in practice web design. problem is, want script start on mouse hover happens when refresh page, starts already. on 1st mouse over, stops. 2nd mouse over, starts slideshow , stops when it's mouse out. here's code: jquery(function($){ // cycle plugin $('.slides').cycle(); // pause & play on hover $('.slideshow-block').hover(function(){ $(this).find('.slides').addclass('active').cycle('resume'); }, function(){ $(this).find('.slides').removeclass('active').cycle('pause'); }); }); i tried putting 'pause' or "pause" in $('.slides').cycle(); destroys plugin , there no more effect. help! :) you can use .mouseover , .mouseout , .mouseenter or .mouseleave have better control of mouse actions. example: $(".slideshow-block").mouseover(function() { $(this).find(".slides").addclass('...

Display Graph in Titanium iOS -

in app, need display status of feedback graph (chart) view. is webview need? i tried rgraph framework, showing errors me, how use framework? are they're anyother ways achieve this? thanks in advance ! yes, library utilizes canvas, you'll need webview display on. possibly helpful reading material on displaying charts: display charts titanium

c++ - Accessing child function, while using parent class -

i doing assignment university course , me , partner have problem. program making game. we have several classes, inherit base class, called creature. these enemies player needs deal , run own ais. there 4 different types of child classes, within namespace creature(including parent, creature), 1 class having special functions needs. class called bunny. now, job call ai functions needed. problem is, not know what class calling out, such, when ask game board tell me creature get. all enemies saved pointers so, in game board squares: struct square { // pointers morso class, enemy saved creature::creature* creature; //undeeded stuff removed }; now, , fine until need access special functions. pupu multiply if conditions filled. such, in pupu there few functions need call make sure carries out it's act correctly. however, here comes problem. i call our board class give me creature in coordinates give it. void gameengine::gameengi...

how to know that user accept oauth permission in youtube api v2 in android -

i want use youtube api v2 in android, following developers.google.com/youtube when open https://accounts.google.com/o/oauth2/auth?client_id=client_id&redirect_uri=redirect_uri&scope=https://gdata.youtube.com&response_type=code url in webview, ask access application. how know if user accept it, because after accepting webview redirect page can success code=4/fsgko348949 i think tutorial can useful: http://blog.blundell-apps.com/tut-oauth-youtube-api-access/ this tutorial shows how detect if user selects “allow access” using listener: package com.blundell.youtubesignin.oauth; /** * class checks paramater's our redirect url has informing our listener * passes auth code if access granted. * * google documentation: * if user granted access application, * google have appended code parameter redirect_uri. * value temporary authorization code can exchange access token. * example : http://localhost/oauth2callback?code=4/ux5gnj-_miu4dod_gnzdjx9etof...

php - How can I use Session Variables to output login username -

i'm building application , have added login page works well, communicating "username" , "password" field in database. after logging in, takes page users authorized see. is there way can display "welcome, xxx" particular user logged in @ next page? , more importantly, output detailed information of logged in user on next page? thanks. you can use session temporarily store data can seen across page.... after checking successful login credential, can stores user data in session <?php session_start(); $_session['username'] = $user_name; ?> after storing user data in session,you can access data across different pages until unset session data <?php session_start(); if (!isset($_session['username'])) { echo 'welcome, '.$_session['username']; } else { echo 'sorry, not logged in.'; } ?> when user logged out,unregister session variable. unregistering of sessi...

android - How to stop a GridView from cropping my images? -

Image
i have gridview have filled 64 60x60px png's. want gridview display them close perfect square can have set numcolumns in xml 8 have 8x8 gird. here looks like: my images have small border @ edge though being cropped off. here drew on top left image should when displayed: here xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/textfieldfu" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <gridview android:id="@+id/gridview" android:lay...