Posts

Showing posts from February, 2013

Passing data between PHP and JavaScript? -

the overall idea drawing graph of somebody's scores in div. i've got button when clicked runs graph drawing function. have function retrieves data database using switch statement function shared other buttons. my data retrieval function: var getdata = function(button_id) { $.ajax({ type: "post", url: "../scripts/getdata.php", datatype: "html", data: {id: button_id}, success: function(result){ $("#profilebox").html(result); } }); }; runs getdata.php , returns values blank div. getdata.php: <?php session_start(); $switchcase = $_post['id']; $email = $_session['user']['email']; //connect database here $result=mysqli_query($con,"select * users email = '$email'"); switch ($switchcase) { case "profile_home": while($row = mysqli_fetch_array($result)) { echo $row['username'] . "

fonts - Android : Proper way to use custom typeface in -

what right way use typeface in android? see many examples using custom xml tag text view. tried to set in java normal text view , works fine, reason use custom fields? when using custom typeface best add typeface /assets directory in project. lightweight following: textview customtypefacetextview = (textview) findviewbyid(r.id.customtypefacetextview); typeface customtypeface = typeface.createfromasset(getassets(), "custom_typeface.ttf"); customtypefacetextview.settypeface(customtypeface); just remember finding assets related current context if using custom fonts in fragment vs. activity want call getactivity().getassets() instead of getassets() . this reference quick tip : http://code.tutsplus.com/tutorials/customize-android-fonts--mobile-1601 additionally may more practical create class extends textview have more practical implementation custom font can used textview s want add custom font so: public class customtitletextview extends textview { pri

java - Undefined for type ArrayList - putting random object of arraylist into variable -

i attempting place randomly chosen object of arraylist variable in class constructor. public wordstoguess randomword() { int index = randomgenerator.nextint(words.size()); wordstoguess chosenword = words.get(index); return chosenword; } public model() throws ioexception { words = new arraylist<wordstoguess>(); chosenword = words.randomword(); randomgenerator = new random(); } i error saying "the method randomword() undefined type arraylist". have removed unnecessary code constructor. chosenword = words.randomword(); should read: chosenword = randomword(); randomword() not method of arraylist of class.

android - set actionbar icon height to match actionbar height -

Image
see problem here, grey checkbox leaves room top , bottom of action bar: styles.xml <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="customactionbartheme" parent="theme.base.appcompat.light"> <item name="android:windowcontentoverlay">@null</item> <item name="android:actionbuttonstyle">@style/actionbuttonstyle</item> </style> <!--<style name="actionbuttonstyle" parent="@android:style/widget.holo.light.actionbutton">--> <style name="actionbuttonstyle" > <item name="android:height">@dimen/abc_action_bar_default_height</item> <item name="android:layout_height">@dimen/abc_action_bar_default_height</item> </style> i set item so: getmenuinflater().inflate(r.menu.submit_action, menu); submit_action looks like: <menu xmlns:android="

c# - MVC 4 Razor _Layout.cshtml use a HTML section for only one page -

i have scenario want specific content _layout.cshtml used 1 view "_layout.cshtml" looks this.. <div> //common part pages - 1 </div> <div> //only index page - want index page. //but don't know how specify condition. if(it index page) use section //i can't move section index page, //because have html content displayed on index page below section, i.e. common part-2. </div> <div> //common part pages - 2 </div> @renderbody() <div> //common part pages - 3 </div> my index.cshtml page should this.. <div> //common part pages - 1 </div> <div> //only index page </div> <div> //common part pages - 2 </div> //content specific index.cshtml <div> //common part pages - 3 </div> and other pages should this.. <div> //common part pages - 1 </div> <div> //common part pages - 2 </div>

jquery - slideDown() effect issue -

i’ve noticed slidedown() effect doesn’t work div navigationmain, notice how i’m using ul/li tags header menu in div navigationmain. notice how i’ve placed id name within a/hyperlink tags header nav portfolio/about/contact within li tags , in div navigationmain. i’ve tried using slidedown() effect id #about-link nav button in navigationmain div , suppose open hidden div called aboutlayout opens small section of div , closes immediately. reason slidedown() effect works div doesn’t include ul/li , a/hyperlink tags. within div i’ve placed id name in img tag , slidedown() effect works. possible slidedown() effect doesn’t work ul/li , a/hyperlink tags? jsfiddle: http://jsfiddle.net/tb8h5/17/ http://jsfiddle.net/tb8h5/17/embedded/result/ (the navigation menu portfolio/about/contact text isn't appearing on jsfiddle link, i’ve added background colour show navigation menu) html <div class="header"> <div class="container"> <div class="he

c++ - Can you 'redeclare' a variable in a subclass? -

is possible declare member subclass of base classes member? e.g. class { int a; } class b : { int b; } class foo { *baz; } class bar : foo { b *baz; //how can not shadow baz, 'redeclare' b? } basically, bar have baz b , want 2 things: way of showing/enforcing , avoiding have cast baz everytime used in bar. intuition not possible, dont purport c++ expert. you cannot. can redeclare return type of virtual function. class foo { virtual *baz(); }; class bar : public foo { b *baz(); };

is there a loop in matlab similar to (for in ) in R? -

in r if have index=[1,5,10]; use in index each element of vector: i=1, i=5, i=10 each iteration. i not want go through size for = 1:3 index(i) end is there similar way in matlab? you can write for i=[1 5 10] here end; for example for i=[1 5 10] end; will print 1 5 10 on console.

how to get previous view when entered in foreground in ios -

i've chat view,i'm chating , when enter in background,and once again enter in foreground message have been removed(refresh),how can got same chat message. - (void)applicationwillenterforeground:(uiapplication *)application { // called part of transition background inactive state; here can undo many of changes made on entering background. [[uiapplication sharedapplication] cancelalllocalnotifications]; application.applicationiconbadgenumber = 0; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; sphviewcontroller *chatview = [[sphviewcontroller alloc] initwithnibname:@"sphviewcontroller" bundle:nil]; chatview.strcallername = [nsstring stringwithformat:@"%@",strselectedcallername]; self.window.rootviewcontroller = chatview; [self.window makekeyandvisible]; } you resetting app state every time app enters foreground. that's not place instantiate view controller , set app's main

html - bootstrap 3 scaling text -

i've started using bootstrap 3 , whilst playing layout can't seem text scale on mobile when within jumbotron h1 tag. i'm trying copy jumbotron on getbootstrap site has large text scales down when viewport changes. <div class="row"> <div class="col-xs-12"> <div class="jumbotron"> <div class="container"> <center><span class="h1">testing jumbotron </span></center> <div class="col-xs-2 col-xs-offset-5 btn-info btn btn-sm">full</div> </div> </div> </div> </div> i've looked @ example , seems heading scale within bootstrap 3 ... maybe because i'm using flat-ui has broken this? try changing html this. <div class="container"> <div class="jumbotron"> <div class="row"> <center><span class="h1 col-

java - JAXB marshalling for function with arguments -

is possible use jaxb create xml attribute function includes parameter? i'd this: @xmlrootelement public class app { @xmlattribute public boolean isowned( user user ) { return user.ownsapp( getid( ) ); } } how can user parameter function call when marshalling app class xml? i'm not concerned unmarshalling. jaxb (jsr-222) limits use of annotations field (i.e. foo ) or property (i.e. bar ). can not use on arbitrary method per 1 in question. @xmlrootelement public class app { @xmlattribute // valid private boolean foo; private boolean bar; @xmlattribute // valid public boolean isbar() { return bar; } @xmlattribute // invalid public boolean isowned( user user ) { return user.ownsapp( getid( ) ); } }

c++ - What Can I use to draw with cuda -

i'm starting university project, "real time ray tracing". have use cuda, can use graphics part? i wanted use opengl, in particular draw pixel gldrawpixels() funcion, function deprecated, , don't want use deprecated funcions , function doesn't work newest opengl's codes. searched newest function in opengl (i think) there isn't 1 that. so searched opencl, haven't figured out if library can me. so, can use implement project? a common simple rendering approach in opengl 1 level of complexity above gldrawpixels draw pixels texture, apply texture quad , render quad. this presentation walk through steps, , bonus show how use cuda/opengl interop , make ray tracing animation run quicker, , should brownie points @ least on university project.

jquery - Using ajax global event to show loading image -

i have bit of problem showing loading image ajax calls in application. this way tried (unsuccessfully) front: <img src="~/images/ajax-progress.gif" alt="" class="hide" id="ajaxprogress"/> css: .hide{ display:none !importent; } javascript: $(function () { $('#ajaxprogress').bind('ajaxstart', function () { $(this).show(); }).bind('ajaxstop', function () { $(this).hide(); }); }); when ajax call being made, image not shown. why? you can use - custom namespace $(document).bind("ajaxstart.mine", function() { $('#ajaxprogress').removeclass('hide'); }); $(document).bind("ajaxstop.mine", function() { $('#ajaxprogress').addclass('hide'); }); or can use this $(document) .ajaxstart(function(){ $('#ajaxprogress').removeclass('hide'); }) .ajaxstop(function(){ $('#ajaxpr

actionscript 3 - Group a multidimensional array by a particular value -

i have multidimensional array , trying group them according value of array properties. i'm trying group them id, won't know id beforehand. so, it's not can put in loop , while < 7, because won't know 7 maximum value id value, array ( [0] => array ( [name] => r8900 [type] => public [id] => 1 ) [1] => array ( [name] => r8944 [type] => public [id] => 1 ) [2] => array ( [name] => r8922 [type] => private [id] => 3 ) [3] => array ( [name] => r8816 [type] => private [id] => 3 ) [4] => array ( [name] => r7434 [type] => vip [id] => 7 ) ) what i'm hoping produce: array ( [1] => array ( [0] => array ( [name] => r8900 [type] => public ) [1] => array ( [name] => r8944 [type] =

ios - How Do I Insert Tab Bar Controller Into Storyboard? -

Image
i have existing iphone application consists of login vc, account table vc, , account detail vc. note storyboard: i need enhance account detail vc show tab bar allow surfacing of other information related selected account recent orders, map, etc. i've done far embed account detail vc in tab bar controller this: it's not clear me how wire new tab bar controller existing storyboard. examples see on use of tab bar controller have root vc; not case here want tabs present on account detail view (and other tab sibling views - not shown here). thanks assistance. you need add push segue table view controller (or cell) tab bar controller. accountdetailview should connected tab bar controller "relationship segue" ---> viewcontrollers.

xaml - wpf binding list inside class not updating -

when want bind observablecollection of strings ui. this: observablecollection<string> mystrings = new observablecollection<string>(); mystrings.add("hello"); myitemscontrol.itemssource = mystrings; then when add/remove elements list, ui updates. however, when add observablecollection class binding not update: public class testclass { public observablecollection<string> mystrings = new observablecollection<string>(); } testclass mytestclass = new testclass(); mytestclass.mystrings.add("hello"); myitemscontrol.itemssource = mytestclass.mystrings; the binding works first time not update when add/remove items. can explain me why happens , how can around it? you're trying bind field, not property. change class public class testclass { public testclass() { mystring = new observablecollection<string>(); } public observablecollection<string> mystrings {get; set;} } and should wo

PHP - How can i insert a "fixed" string into database? -

i want that: when insert post: <input type="text" name="name" /> <?php $name = $_post['name']; $string = "m"; //code insert $name , $string database table ?> i want put fixed string in front variable, , want query read this: $name + m lets imagine name george, want insert name george database, m like this: george m how can that? $name = $_post['name']; $string = "m"; $full_string = $name . " " . $string; //code insert $full_string database table

android - ChildFragmentManager + ViewPager + Animation = not good -

Image
my app build on many fagments , change fragments horizontal slide animation. fragments contain viewpager fragmentstatepageradapter. in process of restoring fragments backstack see black page of adapter. looks childfragmentmanager in fragmentstatepageradapter destroed soon. how fix that? it 's simple done setoffscreenpagelimit(numberoffragment want retain).

python - Pandas groupby: compute (relative) sizes and save in original dataframe -

Image
my database structure such have units, belong several groups , have different variables (i focus on one, x, question). have year-based records. database looks like unitid, groupid, year, x 0 1 1, 1990, 5 1 2 1, 1990, 2 2 2 1, 1991, 3 3 3 2, 1990, 10 etc. measure "intensity" variable, going number of units per group , year, , put database. so far, doing asd = df.drop_duplicates(cols=['unitid', 'year']) groups = asd.groupby(['year', 'groupid']) intensity = groups.size() and intensity looks like year groupid 1961 2000 4 2030 3 2040 1 2221 1 2300 2 however, don't know how put them old dataframe. can access them through intensity[0] , intensity.loc() gives locindexer not callable error. secondly, nice if scale intensity. instead of "units per group-year", "units per group-year, scaled average/max units

javascript - include socket.io server into my html -

i have run nodeserver , client sucessfully. want connect server proxy. here node client: <html> <head> <script src="http://localhost:8000/socket.io/socket.io.js"></script> <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> <script> var name = ''; var socket = io.connect('http://localhost:8000'); // @ document read (runs ones). $(document).ready(function(){ // on click of button (jquery thing) // things inside clause happen when // button clicked. $("button").click(function(){ // simple logging $("p#log").html('sent message: ' + $("input#msg").val()); // send message on inputbox server socket.emit('chat', $("input#msg").val() ); // server recieve message, // maybe processing, // broadcast again

ios - Read and Write the MetaData contents as a File in Documents Directory -

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring* arraytext = [metadataarray componentsjoinedbystring: @"\n"]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"employeedata.txt"]; [arraytext writetofile:path atomically:yes]; metadata array first object : {filesize:"9385033" labels:{viewed,starred,restricted,trashed,hidden} originalfilename:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" mimetype:"audio/mpeg" title:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" parents:[1] md5checksum:"51d598c750102dd4bca09addf4d8212d" quotabytesused:"9385033" lastmodifyingusername:"shadow.hibrise" copyable?:1 headrevisionid?:"0b7v4x9xjauwjr3dzm1fqwlpheefozgyyyzr2nudtlzhmb2fnpq" kind:"drive#file" writerscanshar

How to run Multiple Process in C# -

seniors, beginner , new in c# after php. my question how execute multiple function same time in c# e.g class void main() { call functiona(argument) call functionb(argument) call functionc(argument) // these function should start @ same time } my first function public void functiona(argument) { richtextbox1.appendtext(starttime); } my second function public void functionb(argument) { richtextbox1.appendtext(starttime); } my third function public void functionc(argument) { richtextbox1.appendtext(starttime); } your / guideline save time. the easiest option use task class. msdn nails it, copying (with minor edits) relevant bit here action action1 = () => { // code here }; action action2 = () => { // code here }; task t1 = new task(action1); task t2 = new task(action2); t1.start(); t2.start();

javascript - Is it possible to get all elements which have a specific value into any type of attribute? -

i want elements in html dom, have attribute specific value. for example - <ul style="width:150px;" id="radiobutton1"> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 1</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 2</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 3</label> </li> </ul> i want elements contains "radiobutton1" in attribute. means want select ul , 3 radiobuttons . note: above html used ul-li structure, real scenario it's different. please don't give answer in favor of ul-li . want global solution. there selector exist select type of attribute? is possible select elements in approach? bunch of i

android - MultiAutoCompleteTextView custom adapter with custom object instead of String Object -

this code working fine want when pass arraylist<string> adapter. when add object adapter, in multiautocompletetextview set object full name instead of object full name. want first_name jgetdata object. public class myautocomplete extends multiautocompletetextview implements onitemclicklistener { private final string tag = "chipsmultiautocompletetextview"; private handler mhandler = new handler() { public void handlemessage(message paramanonymousmessage) { if (paramanonymousmessage.what == 0) { mhandler.removemessages(0); string str = gettext().tostring().trim(); log.e("handler", "yes"); if (str.length() >= 2) { if(gettext().tostring().contains(",")) // check comman in string { string chips[] = gettext().tostring().trim().split(",");

arrays - Adding Values of Field in C? -

i want ask how can add values of array in c. example: array[5] -------- array[1]=0.2 array[2]=0.2 ----> want add first 0.2 second 0.2 (=0.4) array[3]=0.3 array[4]=0.15 i want following output: 0.2 0.4 0.7 0.85 how can that? special operators? ps: want in simple loop. not libaries etc. much fail. many error. tag question [c] or [c++] , not both. not same thing. if declare array[5] , valid indicies 0 through 4 . array[5] out of bounds . you describe wanting output, program has no output! show printf , or cout , or similar output statement. if want add value array member, simple: array[2] = array[2] + 0.2; if want add 2 array members together: array[2] = array[1] + array[2]; although did not specify clearly, looks want make each member of array sum of earlier members (including itself). here's code: int main(void) { double array[] = { 0.2, 0.2, 0.3, 0.15

Plot 3D Shape in Maple -

i'm trying plot 3d shape in maple using following 4 points: [3, -5,-4], [4, -1, 3], [-4,-5, 4], [2, -5, 4] have no idea code use or begin. appreciated thank you not entirely sure want, here how draw tetrahedron: with(plots); # display with(plottools); # polygon v := [[3, -5,-4], [4, -1, 3], [-4,-5, 4], [2, -5, 4]]; combos:= combinat:-choose(v,3); display(map(polygon,combos));

linux - Grep specific part of text -

i have text this: ora.sas.aa.svc 1 online online sas1 ora.sas.bb.svc 1 online online sas2 ora.sas.cc.svc 1 online online sas2 ora.sas.dd.svc 1 online online sas1 ora.sas.ee.svc 1 online online sas1 2 online online sas2 what want grep specific part of .svc , online status like: example.txt |grep aa ora.sas.aa.svc 1 online online sas1 or example.txt |grep ee ora.sas.ee.svc 1 online online sas1 2 online online sas2 row number of "online" may change, can't grep grep -a2 or grep -a3 . you can use awk instead:

java - Unable to Parse Time String to specified format -

i need compare 2 time string have entered.. able date time unable it. please find below code tried : my issue is.. -- able time format according format enter in string unable parse it. because if parse able compare , find out whether varible time field difference. please find below code have done : try{ dateformat df = new simpledateformat(format); //assume format entered hh:mm:ss df.setlenient(false); t1 = new date(); //here current time temp_time = df.format(t1); // change format have requested (example format – hh:mm:ss. temp_time = 18:20:45). t1 = df.parse(temp_time); // when try parse thu jan 01 13:24:40 ist 1970. able parse date, time format it’s not working. in order see how parse-result looks (an object of type java.util.date ) have format again: dateformat df = new simpledateformat("hh:mm:ss"); date time = df.parse("18:20:45"); // visualizing result system.out.println(df

html - Japanese unicode character is reversing CSS float left -

please check out following js fiddle in ie (i'm using 10) http://jsfiddle.net/bf65u/1/ .inlinecol2 { width: 50%; } .option { float: left; } <div id="div_a799f1fc-ccbb-4c85-b367-a20300fe5a64" class="div_ " > <div class="errormsg"></div> <div class="surveyelementcontent" title=""> why '箱' japanese character mess floats? </div> <div class="surveyelementoptions"> <div class="surveyelementoption option inlinecol2 "> <input type="radio" value="1" /> <label>1</label> </div> <div class="surveyelementoption option inlinecol2"> <input type="radio" value="2" /> <label>2</label> </div> <div class="surveyelementoption option

regex - remove number and special character using owa_pattern -

using owa_pattern.change in oracle 9i. is possible remove number , trailing special character (pls note trailing) special character in string? i refer special character characters neither word nor number. e.g _ , # , @ ,$ etc ... for example. string = test_string_10 desired output test_string (notice trailing special character _ removed). i have figured out how remove number stuck in special character part. i have code far. owa_pattern.change (string, '\d', '', 'g'); appreciate inputs. thanks! try following. owa_pattern.change (string, '[^a-za-z]+$', ''); regular expression [^a-za-z]+ character except: 'a' 'z', 'a' 'z' (1 or more times (matching amount possible)) $ before optional \n, , end of string

rails 4 scopes with NOT equal and associations -

i have instance variable in controller i'm trying convert scope model. instance variable: products @products_with_user_differences = product.where{|p| p.last_user != p.user.username && p.asset_type.name == "computer" unless p.user.nil? or p.allow_multi_users == true} explanation: this shows products have last_user value different user.username type of "computer" . excludes product user_id: nil or have allow_multi_users attribute set true . i've tried following 0 luck: products.rb scope :with_user_differences, -> { where(last_user != user.username && asset_type.name == "computer" unless user.nil? or allow_multi_users == true)} it doesn't seem recognize associations or allow "!=" in scope. any ideas or pointers? the following code return products associated user , asset_type product.joins(:user, :asset_type) to exclude products allow_multi_users set true product.where(allow_mu

eprocessing network ios sdk integration -

as of requirement, need integrate eprocessing network payment gateway application credit card payment transactions. didn't find sdk or sample codes implement. integrated eprocessing network, please me here. thanks in advance!!! eprocessing network allows developers use existing mobile framework (including integrated, encrypted audio jack card reader) implement own payment application. provide developers business logic, , presentation layer left imagination. here documentation mobile sdk (pdf format): ios :- http://www.eprocessingnetwork.com/docs/sdk/ios_sdk_developers_guide_v2.1.pdf android :- http://www.eprocessingnetwork.com/docs/sdk/android_sdk_developers_guide_v2.1.pdf some code reference :- icharge.gateway = ichargegateways.gweprocessing; //this eprocessingnetwork account number. //for testing may use value 05971 icharge.merchantlogin = "05971"; //merchantpassword not used icharge.merchantpassword = ""; icharge.card.cvvdata = &qu

c# - Visual Studio 2013 Update 2 RC isn't installing ( Error: Update 2 RC does not apply, or is blocked by another condition on your computer.) -

this error image , next image shows have vs2013 installed update 1 visual studio 2013 update 2 rc error: http://1.bp.blogspot.com/-tlighioohhg/u1dwwhmg7qi/aaaaaaaaaek/ca_vculggd0/s1600/error.png proof of visual studio 2013 update 1: http://2.bp.blogspot.com/-gs3zpkss8k8/u1dwxhhmg7i/aaaaaaaaaes/8hp-7ftabnw/s1600/visual+studio+update+1.png i had same problem when installing update 2 visual studio express 2013 web . the reason in case because before installation doing housekeeping , deleted content of folder c:\users\all users\package cache\ when restored back, there no error message , installation successful. that means, might have missing bundles , installer not happy that. in case had backup if haven't had need reinstall visual studio express 2013 web , in place , installation of update should hassle free. more less same mentioned in article link above. keval.

Visual Studio 2012 Installation Issues -

i finished installing visual studio 2012 .iso image , when finished installing got these 2 errors: microsoft web deploy 3.0 a required certificate not within validity period when verifying against current system clock or timestamp in signed file. microsoft visual studio 2010 tools office runtime (x64) package failed should worried? made sure uninstalled 2010 before installed 2012 , did registry cleanup not sure if helped or made worse. i don't think !! way , can solve issues updates microsoft , these links might : http://support.microsoft.com/kb/2872457 http://msdn.microsoft.com/en-us/library/ms178739.aspx

javascript - Validate the string which needs to match particular condition(Regular Expression)? -

i want validate string, should not contain special characters except underscore(_). have written below code not able through. var string = 'pro$12'; var result = /[a-za-z0-9_]*/.test(string); in above given string not valid got result true. can body tell doing wrong here? it returns true because, able match pro . can see actual matched string, match function, this. console.log(string.match(/[a-za-z0-9_]*/)); # [ 'pro', index: 0, input: 'pro$12' ] even when doesn't match anything, example, input '$12', return true . because, * matches 0 or more characters. so, matches 0 characters before $ in $12 . (thanks @jack pointing out ) so, need is console.log(/^[a-za-z0-9_]*$/.test(string)); # false ^ means beginning of string , $ means ending of string. telling regex engine that, match string has characters character class, beginning , ending of string. note: instead of using explicit character class, [a-za-z0-9_] , can u

javascript - Making a smooth, dynamic website -

Image
i seeking create website smooth layout, dynamic , not blam, heres website. let me elaborate: got setup now, can figure trying working. what mean dynamic is, want when page have been loaded image come sliding in (maybe banner too, haven't decided design yet, throwing suggestions.). when image have slided in expanding , despanding slowly, it's in movement. when hovered on should expand more , stop it's movements while hovered. this main needs searching for, , little clueless on how done. thinking javascript obvious, i've failed guides i've found , therefore belive need direct help. highly appreciated, thanks! i've tried making image fade in , out jquery, doesn't seem work, heres code: <!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title></title> <meta

javascript - Change Datatables jquery Header & Footer Width -

i building database table using following code: <script> var j$ = jquery.noconflict(); j$(document).ready(function() { j$('.reporstdt').datatable( { 'bjqueryui': true, 'bfilter': false, "blengthchange": false }); } ); </script> and calling above script using tag & adding class="reporstdt" html5 table. problem width of generated table doesn't match html table, result of following result: http://www.imagebam.com/image/0e8fdb322413745 can configure datatables header width , footer width without change css styling? you can set column widths in creation of datatable, indexed left right. should override setting in css header , footer , pull them line column width set here: j$('.reporstdt').datatable( {"bautowidth": false , aocolumns : [ { "swidth": &qu

javascript - Unit testing ext js with Jasmine 2.0 and PhantomJS -

i'm trying setup unit testing ext js application. i'm using jasmine 2.0 , phantomjs run tests console. can init store in init method of controller. but, if try declare in stores config, i'm getting following error : typeerror: 'null' not constructor (evaluating 'new c()') (line 1) (1) , cause error, , how can resolved? thank in advance. my code below: testapplication.js ext.loader.setconfig({ enabled: true }); ext.ns('myapp'); // loading different components controller, model, view.. ext.application({ name: 'myapp', appfolder: '../app', controllers: [], autocreateviewport: false, init : function() { myapp.app = this; }, // launch jasmine test environment launch: function () { var jasmineenv = jasmine.getenv(); jasmineenv.updateinterval = 1000; var htmlreporter = new jasmine.htmlreporter(); jasmineenv.addreporter(htmlreporter); jasmine

python - Understanding factorial recursion -

i'm looking on factorial example of recursion , make sure i'm understanding correctly! def factorial(n): if(n == 0): return 1 else: return n * factorial(n-1) would right in saying: factorial(4) = factorial(4-1) * 4 = factorial(3-1) *3 *4 = factorial(2-1) *2 *3 *4 = factorial(1-1) *1 *2 *3 *4 = 24 because factorial(1-1) = factorial(0) base case shows = 1 , multiply 2, 3 4. is correct way of looking @ it? thanks in advance! yes is. since it's recursion, works opposite way. once had interviewer explain me : say, fact(5) : - fact(5) = 5 * fact(4) - fact(4) = 4 * fact(3) - fact(3) = 3 * fact(2) - fact(2) = 2 * fact(1) - fact(1) = 1 * fact(0) - fact(0) = 1 // condition returns 1. now, imagine - sign above stands retu

regex - Regular Expression replacing keyword that occurred multiple times -

i tried match "text" word can replace , highlight "text" word, using.. strtext = "this triple text text texting word" keyword = " text " regex.replace(strtext, keyword, m=> string.format(" <span class='keywordhighlight'>{0}</span> "); the result : triple text text texting word but first word highlighted, need space @ begin , end of "text" keyword avoid matching "texting", anyone have idea how solve it? use word boundaries: regex.replace(@"\b"+strtext+"\b" ...); \b word boundary in regex. match text , not texting

javascript - Using Validation on Jquery pop up login menu -

i have jquery pop menu using bootstrap . has validation issues when password field empty or password wrong ,i tried couple of ways . works when type in password or username field , still stays there here codes <div class="container"> <h4>demo page</h4> <!-- twitter content --> <div id="form-content" class="modal hide fade in"> <a class="close" data-dismiss="modal">×</a> <div> <form class="contact" action=""> <div class="modal-body"> <ul class="nav nav-list"> <li class="nav-header">username</li> <li> <input class="input-xlarge" type="text" id="txtusername" name="username"> </li&

How to get a list of tables with composite primary key in SQL Server? -

how create query gives me list of tables composite primary key in sql server? maybe using sys.tables or information_schema.tables or else? you can dig info in information_schema.table_constraints , information_schema.constraint_column_usage , checking multiple rows of primary key constraints on table, like; select col.table_name information_schema.table_constraints tc join information_schema.constraint_column_usage col on col.constraint_name = tc.constraint_name , col.table_name = tc.table_name , tc.constraint_type = 'primary key ' group col.table_name having count(*) > 1 an sqlfiddle test with .

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/tun_recrut -

i'm new in java , i'm trying make simple authentication interface. i trying execute simple query using drivermanager . can please me understand issue here ? 1/ mydbconnection.java package com.esprit.tunrecrut.util; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import java.util.logging.level; import java.util.logging.logger; public class mydbconnection { /** * déclaration des variables pour la connexion */ private string url = "jdbc:mysql://localhost:3306/tun_recrut"; private string login = "root"; private string pwd = ""; private static mydbconnection instance; public static connection connection; private mydbconnection() { try { connection = drivermanager.getconnection(url,login,pwd); } catch (sqlexcep

javascript - CAPH API widgets in Samsung TV SDK -

i have made simple caph project consists of page has 3x3 containing images. want able when focus on image. far have read documentation unable understand. what want reduce opacity of image when focused. this code needs edited: page1_page.prototype.image_3fzrc_onfocus = function() { //should reduce image opacity don't know how reference image } thank you. ps: used visual editor edit: did nothing happens. page1_page.prototype.image_3fzrc_onfocus = function() { imgspring= caph.wui.widget._component.getwidgetbyid("image_3fzrc"); imgspring.setopacity(0.5); };

c++ - Why does not see the array in the same class? -

i want write polynomial class,each polynomial consist of multi poly have implemented array, code: class polynomial { private: int count; public: polynomial() { count = 0; term terms[10]; } void create(int c) { terms[count].coef = c; } }; class term { public: double coef; int expo; }; i have problem in create method,it not know terms array , not access term object properties. why happen? // first declare class referenced class term { public: double coef; int expo; }; class polynomial { private: int count; // terms should class member not local of constructor term terms[10]; public: polynomial() { count = 0; // if declare terms array here // destroy after returns constructor // term terms[10]; } void create(int c) { terms[count].coef = c; } }; if polynomial declaration before term declaration requirement forward declaration can

Ruby SSL with Twitter failed on cert OpenSSL issue on Windows 7 -

i've searched high , low answer this. many people have own answers. none of them have worked me. i'll provide situation. so want access twitter , upon using net:http's post function error. ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed yes know get's message. here viable solutions found. first; manually set cert file: #! /usr/bin/env ruby require 'net/https' require 'uri' uri = uri.parse(argv[0] || 'https://localhost/') http = net::http.new(uri.host, uri.port) if uri.scheme == "https" http.use_ssl = true http.verify_mode = openssl::ssl::verify_peer http.ca_file = file.join(file.dirname(__file__), "cacert.pem") end http.start { http.request_get(uri.path) {|res| print res.body } } this provided ariejan de vroom @ link http://blog.kabisa.nl/2009/12/04/ruby-and-ssl-certificate-validation/ many people have given similar answer this. did not work