Posts

Showing posts from February, 2014

sql server 2008 - SQL Nested Aggregate Query- How do I get the number of customers per employee? -

the following prompt need answer: list number of customers each employee. include employee's name , number of customers labeled appropriately, listing employee customers first. the following employees table: create table employees (empid char(4) unique not null, ename varchar(10), job varchar(9), mgr char(4), hiredate date, salary decimal(7,2), comm decimal(7,2), deptno char(2) not null, primary key(empid), foreign key(deptno) references departments(deptno)); insert employees values (7839,'king','president',null,'17-nov-11',5000,null,10); insert employees values (7698,'blake','manager',7839,'01-may-11',2850,null,30); insert employees values (7782,'clark','manager',7839,'02-jun-11',2450,null,10); insert employees values (7566,'jones','manager',7839,'02-apr-11',2975,null,20); inser

couchdb - How to link more documents in one view -

there 3 couchdb document types: user { "_id: "user/author1", "type: "user", "name" : "joe doe"} review { "_id: "review/review1", "type" : "review", "content" : "..." } product { "_id": "product/awesomeproduct", "type" : "product", "reviews": [ { "author": "author1", "review_id": "review/review1" }, { "author": "author2", "review_id": "review/review2" } ] } how can data documents single view? i try use linked documents, can use (with include_docs=true) 1 per emit: (coffescript) (doc) -> if doc.type "product" review in doc.reviews emit [doc._id, review.author],{_id: "user/" + review.author} emit [doc._id, review.author],{_id: review.review_id} but

random - Does "math.floor(x)" and "int(x)" produce different results for positive real numbers in Python? -

i have checked few examples on python shell , seem spit out same numbers. in program large set of numbers supposed approximated, apparently produce different results. i trying write little program simulates movement of object on rectangular plane. that, had write class named "rectangularroom" takes in width , height , creates grid: class rectangularroom(object): """ rectangularroom represents rectangular region containing clean or dirty tiles. room has width , height , contains (width * height) tiles. @ particular time, each of these tiles either clean or dirty. """ def __init__(self, width, height): """ initializes rectangular room specified width , height. initially, no tiles in room have been cleaned. width: integer > 0 height: integer > 0 """ self.width = width self.height = height self.room_coordinates = [] m in range(self.width): n in range(self.h

Get user last login time on SharePoint? -

is there way check users login sharepoint site during past 30 days? , what's last login time? from search, enable auditing 'document view' site, query audit log. however, may use lots of resource. is there better way using sharepoint powershell directly without creating webpart? thanks as far i'm aware, sharepoint doesn't store this. suggest create httpmodule , log requests in own database. doing can create reports need in easy way. edit: if it's sharepoint 2010, can enable site usage statistics. after can access sharepoint database , retract data want. data won't date though, it's timer job filling data can't know happened after job ran. if wants create nightly report, ok guess. the timer job reason had create http modules have correct live data.

c++ - What does access violation mean? -

i'm new c++ , not understand why getting error "access violation reading location". here code: gdiscreen(); int startx = 1823 - minusx; int starty = 915 - minusy; (int = startx; < startx + 61; i++) { (int j = starty; j < starty + 70; j++) { color pixelcolor; bitmap->getpixel(i, j, &pixelcolor); cout << pixelcolor.getvalue() << " "; } cout << endl; } gdiscreen() can found here: http://forums.codeguru.com/showthread.php?476912-gdi-screenshot-save-to-jpg please help!! access violation or segmentation fault means program tried access memory not reserved in scope. have few examples how achieve this: leaving bounds of array: int arr[10]; for(unsigned char i=0; i<=10; i++) //will throw error @ i=10 arr[i]=0; note: in code above, use unsigned char iterate. char 1 byte, unsigned char 0-255. larger numbers, may need unsigned short (2 bytes) or unsigned int (4 by

Rally Java Rest API 302 Temporarily Moved Error -

i creating integration tool teamcity rally , using java rest api. when try create object of type "build" exception thrown restapi 302 "temporarily moved" error. how handle this? cannot see settings in rally restapi turns on or off redirects , api not handling redirect. any suggestions? here code being issued. create call restapi throws exception. 2 calls def.getworkspace().getref , def.getref() return urls workspace , build definition entries build record associated (the string "_ref" attribute entities). try { jsonobject obj = new jsonobject(); obj.addproperty("workspace", def.getworkspace().getref()); obj.addproperty("builddefinition",def.getref()); obj.addproperty("duration",1.05); obj.addproperty("message", "message build"); obj.addproperty("number","test0000"); obj.addproperty("start", isoformat.format(new date())); obj.addpro

java - Is there a Sonar, Findbugs, or PMD rule that detects this possible NPE that CodePro detects? -

let's have block of code this: map<string, object> mappy = (map<string, object>)pextraparameters.get(serviceclientconstants.extra_parameters); if (pssresponsebean!=null) { mappy.put(addressresearchcontext.csi_response_bean, (addressnotfoundresponsebean)pssresponsebean); // line may throw null pointer } is there sonar, findbugs, or pmd rule flag "mappy" potentially null? apparently codepro flags this, , need provide similar, if possible. the problem findbugs treats unannotated items if annotated @nullable causes ignore nullness checks against them. can create empty java.util package annotated custom @returnvaluesarecheckfornullbydefault annotation (modify @returnvaluesarenonnullbydefault ), apply every method in every class in package. @returnvaluesarecheckfornullbydefault package java.util; import edu.umd.cs.findbugs.annotations.returnvaluesarecheckfornullbydefault; another option create map facade has uses @checkfornull

Is there a way to organize file content by list element in python? -

i working on project in python in regards file information on students. file orders students alphabetically last name in following format: lastname,firstname,house,activity the first direction change format to firstname,lastname,house,activity i have done this. next step organize them house that amewolo, bob j.,e2,none anderson, billy d.,e1,basketball andrade, danny r.,e2,soccer banks-audu, rob a.,e2,football brads, kev j.,n1,band souza, ian l.,e1,eco club dimijian, annie a.,s2,speech , debate garcia, yellow,e1,none glasper, larry l.,n1,choir will output them organized house amewolo, bob j.,e2,none andrade, danny r.,e2,soccer banks-audu, rob a.,e2,football anderson, billy d.,e1,basketball souza, ian l.,e1,eco club garcia, yellow,e1,none brads, kev j.,n1,band glasper, larry l.,n1,choir dimijian, annie a.,s2,speech , debate here code far def main(): info = open('studentinfo.txt', 'r') in info: data = data = data.rstrip('\

java - Android BMI calculation in CM and KG -

hye, want create bmi simple android application. found code code calculate in lbs , inch. but, program need create in kg , cm. try recode back. but, still cant find solution. this code. package com.example.bmicalculator; import android.app.activity; import android.os.bundle; import android.widget.textview; import android.widget.edittext; import android.widget.button; import android.view.view; public class bmicalculatoractivity extends activity { private edittext txtheight; private edittext txtweight; private textview txtresult; private button btncalculate; private double bmi = 0; private double valueheight = 0; private double valueweight = 0; private string resulttext; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); initcontrols(); /*textview tv = new

android - Cocos2d-x admob Integration -

is there link can integrate cocos2d-x admob in app. activity extending cclayer. how can approach integrating admob in file. please let me know. thanks you may choose plugin-x project.click here :)

Haskell- Running monad states -

i stuck trying function: runarraystate :: array arr => arraystate arr e -> arr e -> (a, arr e) to run arraystate action let's call act array arr , result , return result res , original array arr' pair (res,arr'). arraystate defined as data arraystate arr e = mkarraystate (arr e -> (a, arr e)) i thought be: runarraystate act arr = ((act arr), arr) or runarraystate mkarraystate (\ arr -> (res, arr)) arr' = (res, arr') but fails. ideas? i think runarraystate (mkarraystate act) arr = act arr is looking for. your type arraystate defined having single constructor mkarraystate has argument function takes arrays pairs consisting of result , (presumably) updated array. in definition above, use identifier act refer function , arr array have input. @ right-hand side of definition, apply function act arr obtain required pair. alternatively, can define type as data arraystate arr e = mkarraystate {runarraystate :

Find any letter in a string SQL Server 2008 R2 -

i have string contains number , letter combination. 1a , 10c, 15a etc. have case statement applies relative value number based on number , letter combination. statement looks this: when [page] '%[a-z]' left([page],1)+((ascii(convert(varchar,(right([page],1))))-64)*.01) this works great when page number portion less 10 in case of 1a when @ 10c , 15a, should 10.02 , 15.01 respectively. want use charindex find [a-z] in left's length factor. has done this? when [page] '[0-9][a-z]' left([page],1)+((ascii(convert(varchar,(right([page],1))))-64)*.01) when [page] '[0-9][0-9][a-z]' left([page],2)+((ascii(convert(varchar,(right([page],1))))-64)*.01) when [page] '[0-9][0-9][0-9][a-z]' left([page],3)+((ascii(convert(varchar,(right([page],1))))-64)*.01) etc

c# - What is the theory of DrawCurve in GDI+ -

i know drawcurve draw cardinal spline, algorithm. can tell me theory, or give me formula. thanks! msdn has brief description of cardinal splines @ cardinal splines in gdi+ . there's little bit general math of cardinal splines @ http://en.wikipedia.org/wiki/cubic_hermite_spline#cardinal_spline

visual studio - Error after build - Web Essentials 2012 -

i got error frequent asp.net mvc4 applications. project build ok shows message in output. 18/04/2013 3:17:57 p.m.: object reference not set instance of object. @ madskristensen.editorextensions.projecthelpers.getrootfolder() @ madskristensen.editorextensions.projecthelpers.getrootfolder() i using vs2012 update 1. web essentials 2012 version 2.6. it not major annoy. please help. this older question, top hit on google. here answer. have found occurs due version conflict or bug in visual studio , web essential 2012 extension. rtm install of visual studio 2012 , latest web essentials (version 3.2 @ time of post) can reproduce error. installing latest update visual studio has fixed problem me. update to confirm version of visual studio running, goto help -> about update 3 or greater should fix issue microsoft visual studio ultimate 2012 version 11.0.60610.01 update 3 here link visual studio update on microsoft site

Getting stream from Google+ SDK? -

does current google+ sdk platform support pulling user stream google+ facebook/twiter news feed? did not find related in documentation. you cannot recreate google+ steam using apis. you user's list of friends' public posts if using plus.login scope access people.list method , used activities.list each person returned in people list. then, if wanted comments, use comments.list each activity. again won't recreate real stream because public data. you'd miss out on posts community posts public, wouldn't come these apis. depending on app trying do, might sufficient if you're trying display feed of own posts. if trying create own google+ client, not work , end running out of quota.

opengl - How to convert Euler Angles to Front, Up, Right vectors -

i need function given yaw, pitch, , roll, can produce front (or looking at), right, , vectors in "world coordinates". in particular world space, starting origin (0,0,0), x positive left, z positive going away viewer/origin, , y positive going up. for example, given... (angles in degrees) yaw=0, pitch=0, roll=0, expected output is: front = (0.0,0.0,1.0) right = (-1.0,0.0,0.0) up = (0.0,1.0,0.0) yaw=90, pitch=0, roll=0, expected output is: front = (1.0,0.0,0.0) right = (0,0,0.0,1.0) up = (0.0,1.0,0.0) yaw=0, pitch=90, roll=0, expected output is: front = (0.0,1.0,0.0) right = (-1.0,0.0,0.0) up = (0.0,0.0,-1.0) yaw=0, pitch=0, roll=90, expected output is: front = (0.0,0.0,1.0) right = (0.0,1.0,0.0) up = (1.0,0.0,0.0) the language i'm working in c++, , gladly use glm solve problem if makes sense. if can there through quaternion's i'm fine solution well, since i've found other tutorials describe how quaternion

html - Content Editable Text Editors -

i have tried out several html editors including tinymce, ckeditor , nicedit. nicedit in 1 respect - easy customize. however, have found have tendency produce poor html. not because don't correctly interpret invalid user actions such attempting style without first having made selection. it far easy end html contains like <span style='color:#ff0000'><span style='color:#ff0000'><span style='color:#ff0000'>red</span></span></span> am right in thinking pretty limitation of content editable concept? poor html not matter if purpose email or posts on forums such gets rather uncomfortable live if generated html has used in context of web page. if of right alternatives? perhaps flash based plugin editor produces better html , works harder @ interpreting user wants do? i suppose in principle possible study generated output , clean out between concertina'd spans if required liable quite undertaking. at b

Navigate to div section of a different html page using javascript in href -

i using javascript function jump div section on current html page(system_details.html): <a href="javascript:show_processor()">processor</a> <a href="javascript:show_ram()">ram</a> however, want directly navigate system_details.html page's show_ram() function different html page (index.html) give links , id <a href="javascript:show_ram()" id="ram">ram</a> . add id @ end of url using hash index.html#ram . then use jquery this: $(document).ready(function(){ if(window.location.hash) $('#' + window.location.hash).click(); }); this take last part of url after hash id of link clicked on, , call click() on link specified id .

ios - Object Array in Objective C with ARC -

i writing application i'd speed up. 1 way have thought switching using nsarray , nsmutablearray using straight c-style arrays of pointers. i had tried naively do: myobject** objects = (myobject**) malloc(n/2*sizeof(myobject*)) this reports compiler error when using arc doesn't know ** object; can fixed adding bridge directive. my question how memory being handled , how memory management mixing c , objective-c objects. two solutions are myobject* __weak* objects = (myobject* __weak*) malloc(n/2*sizeof(myobject*)); myobject* __strong* objects = (myobject* __strong*) malloc(n/2*sizeof(myobject*)); what differences between 2 arrays , how go freeing/releasing them when done. nsarrays optimized point wouldn't result of speed up? are nsarrays optimized point wouldn't result of speed up? yes. you should profile code in instruments -- chances if make heavy use of arrays, you're going find code spends of time in places other nsarray met

Test if page is in an iframe from within a PHP function -

how can call function test if user in iframe within php function? understand way test in javascript, , doesn't seem work when try passing js function in php using echo '<script type="text/javascript"> ... </script>'; i want add function checks if user authorized because need direct them different login pages depending upon whether or not they're in iframe. function in separate file (because called on every page on site) don't think can in straight js. js function i'm trying call var isiniframe = (window.location != window.parent.location) function test_iframe() { if (isiniframe === "true") { window.location.href = "sign_in_iframe.html"; } else { window.location.href = "sign_in.html"; } php function function is_user_logged(){ if ( session_id() == ''){ session_start(); } if(!isset($_session['sess_user_id']) ) { $logged = "false"; he

radio button - Can ttk radiobuttons be made to have style Toolbutton by default? -

i can set toolbutton style individual radiobuttons: #!/bin/sh # \ exec /usr/bin/wish "$0" "$@" set x11 /usr/x11/include/x11/bitmaps image create bitmap leftimage -file "$x11/left_ptr" image create bitmap rightimage -file "$x11/right_ptr" ttk::radiobutton .left -variable foo -image leftimage -style toolbutton ttk::radiobutton .right -variable foo -image rightimage pack .left .right but can't figure out how make them have toolbutton style default, ie, without having specify every 1 separately. you can style 'tradiobutton', default style radio buttons.

javascript - Removing select items depending on selected items -

i have 2 select elements times 12:00 through 11:45 pm, both selects have same options inside including text , value. possible example select 1:00 pm on first select remove options before 1:00 pm on second select? know can detect change jquery $('#select1').change(function(){ // in here remove previous selects }); any appreciated it. try this $('#select1').change(function(){ var value = $(this).val(); $("#selectid > option").each(function() { if(value > this.value) $("#selectid option[value=this.value]").remove(); }); }); but values need in ascending order select boxes

c# - LinQ Error linq joint type inference failed to call 'join' error -

i'm quite new entity framework , i'm trying use join clause on 2 entities follows. var alertlist = elogalert in yangkeedbentity.yang_kee_logistics_pte_ltd_elog_tablet_alert elogalert.no_ != null join elogalertdetail in yangkeedbentity. yang_kee_logistics_pte_ltd_elog_tablet_alert_details on elogalert.no_ == elogalertdetail.alertid elogalertdetail.employee_id == driverid select new { elogalertdetail.employee_id, elogalertdetail.alert_id, elogalertdetail.no_, elogalertdetail.status, elogalertdetail.created_by, elogalertdetail.date_created, }; hi above code i'm getting 2 errors saying 'error 1 name 'elogalertdetail&#

android - second activity still remains in session after logout -

i developing apps in android. in have login , logout activity session management using sharedpreferences. apps logout , store data in sharedpreferences maintain session done. when logout apps(second activity) , rendered first activity(login activity ) happen when clicked button on emulator after logout still again rendered second activity , version 2.3.3 etc encountered exception java.lang.runtimeexception: unable destroy activity {com.oj.bs/com.oj.bs.loginactivity}: java.lang.nullpointerexception can fix problem. please refer following code following login activity code sessionmngr = new sessionmanager(getapplicationcontext()); jsonobject json_user = jsonobj.getjsonobject("user"); sessionmngr.createloginsession(id,json_user.getstring(key_uname), json_user.getstring(key_uemail)); . . following session management public class sessionmanager { share

javascript - get variables from parent window to child window -

i opening new window using window.open() clicking on button.i create 4 variables in new window page named name1,name2,name3,name4 i have following code var updatebrowser = window.open("url",,"scrollbars=yes,height=600,width=700,left=200,top=200"); updatebrowser.name1= value1; updatebrowser.name2= value2; updatebrowser.name3= value3; updatebrowser.name4= value4; first when click on button can able values(for name1 value value1 , name2 value value2....).it ok me.then closed child window , did same working me.but if click button out closing window values coming undefined . i unable solve problem.thanks in advance...

android - SVN checkout commit and update -

i ask svn checkout respect android . if commit project , in project not commit /bin pros , cons related this. best practice, commit /bin or not commit /bin . second question if commit /bin along project , conflict on update should preferable should resolve " using their`s " or resolve " using mine ". /bin auto generated folder. whenever import/run/debug/build project recreated. while committing project remote repository, recommended not commit auto generated folders (e.g., /bin, /gen)with it. because automatically created once import/run/debug/build project in editor. i hope answers question.

c# - Auto checker of application that is running and create a report -

i create application check if schedule task program running, , after checking generate report , auto send report email. this monitoring purposes. , track discrepancies in system. hoping response. best regards, create timer in timer's elaspsed function, running processes check process name (or ever) , see if exists; write email system.web.mail.mailmessage class

asp.net mvc - how to fill MVC dropdownlist via javascript -

good morning, have view connected view model, has 3 parts general information simple model, address model list<> , telephone model list too, on view model. problem on new customer view, above view, address , telephone model empty, when give user opportunity add address , telephone model empty, when need fill 2 dropdownlists above data page loaded. question how can "refresh" dropdownlist data fill viewbag holds above data? in advance when user clicks on add new address button perform ajax call controller action return partial view containing template of address added dom. steven sanderson illustrated concept in excellent editing variable length list in asp.net mvc blog post. as alternative using ajax using pure client side approach. example use templating javascript framework such knockoutjs . steven sanderson covered approach in his blog post .

Facebook Batch query for posts -

Image
i using below query page post results , comment count in batch query post method. batch : [{"name":"post-resultset","method":"get","relative_url":"me/posts?offset=0&limit=2"},{"method":"get","relative_url":"fql?q=select post_id, comment_info stream post_id in ({result=post-resultset:$.data.*.id})"}] i got response error code 400 {"error": {"message": "(#601) parser error: unexpected '_435851216505244' @ position 74.","type": "oauthexception","code": 601 }} what wrong query? it's due post_id on post-resultset:$.data.*.id not surrounded quotes, such as "relative_url":"fql?q=select post_id, comment_info stream post_id in (\"1234567_435851216505244\")" i think it's facebook bug , should report bug on https://developers.facebook.com/bugs

android - Showing ProgressDialog in AsyncTask only for specific parameters -

i'm implementing asynctask, calls wcf service methods in doinbackground method. the wcf method name parameter doinbackground method. i want progress dialog show specific methods name sent doinbackground. my porgressdialog setting set in onpreexecute methods. any way make progressdialog appear specific doinbackground parameter (wcf method name) public class wcfhelper extends asynctask<object, void, string[]>{ private static final string namespace = "http://tempuri.org/"; private static final string url = "http://url"; final progressdialog pd; public context ctx; public wcfhelper(context _ctx) { this.ctx = _ctx; pd = new progressdialog(_ctx); } @override protected void onpreexecute() { pd.setprogressstyle(progressdialog.style_spinner); pd.setmessage("login..."); pd.setindeterminate(true); pd.setcancelable(false); pd.show(); } @override protected string[] doinbackground(object... params) { string w

java - How to pass the dynamic added values into servlet -

i want value name="product' + counter + '" its dynamic values when click add crate row, can 1 tell me how dynamic values , how should pass servlet , how can in servlet. using form submission : jsp , java env. $("#addrow").on("click", function () { counter++; var newrow = $("<tr>"); var cols = ""; cols += '<td><input type="text" name="product' + counter + '"/></td>'; cols += '<td><input type="text" name="price' + counter + '"/></td>'; cols += '<td><input type="text" name="qty' + counter + '"/></td>'; cols += '<td><input type="text" name="linetotal' + counter + '" readonly="readonly"/></td>'; cols += '<td><a c

Titanium Studio working with Vmware or VirtualBox Android 4.0.3 virtual machine -

i using windows 7 . installed titanium studio , updated it. load android sdk , java jdk 6 . android api includes packages. after installations, set java_home , android_sdk params on windows system environment settings. after that, installed android virtual machine (vmware virtualbox). found android eth0's ip , connected android virtual machine on windows command line below m:\sdks\android\platform-tools>adb kill-server m:\sdks\android\platform-tools>adb connect 192.168.230.128 connected 192.168.230.128:5555 m:\sdks\android\platform-tools>adb devices list of devices attached 192.168.230.128:5555 device after connected virtual android, created example on titanium studio. when select android devices run menu of titanium studio compiling sample app on android virtual machine, getting error below [error] invalid --target value 'devıce' where doing wrong? this unicode translating problem in titanium sdk. please, bug ticket. solution

ms access get sum from derived field on forms -

i have derived field in subform calculates sum. on main form calculate sum of records of derived field. how this? below subform calculation. =dsum("value","lineitems","jobno = " & [jobno]) in main form have tried: =sum([jobvalue]) jobvalue name of derived filed in subform. i have tried put calculation in main form reading this , not work. =sum(dsum("value","lineitems","jobno = " & [jobno])) =sum(dsum("value","lineitems","jobno = " & [frmjobs].[form]![jobnofield]))

regex - Split a complex string into a list of classes using regular expressions and lambda in C# -

given string "a:b,c", use regular expressions , lambda expressions in c# split string list of classes return following. { column1: "a", column2: "b", }, { column1: "a", column2: "c", } in other words, want repeat value before colon every comma separated value behind colon. in sql equivalent of doing cross join column1 left side of join , column2 right side. i have of code, including regular expressions, cannot second select project split of comma separated values new classes. instead, code returns following. { column1: "a", column2: [ "b", "c" ] } here's code, stands. public class myclass { public string column1 { get; set; } public string column2 { get; set; } } list<myclass> mc = "a:b,c" .select(a => new { column1 = new regex(@"[a-z]+(?=\:)").match(a).value), column2s = new regex(@"(?<=\:)[a

javascript - Click go to modal section -

Image
this want achieve: the modal has 4 sections, each section loads it´s content dinamically using .load() container on right. the problem have menu in footer opens modal, , should put user in correct section: i don´t know how make it, example if click on footer menu 'metodos de pago' it open modal in specified section . ideas on how it? this script load modal: function loadmodal(){ $('.info_modal').fadein(); } this script load content of sections in modal after clicking on left menu: function loadcontent(){ $('.info_modal_content').load('includes/text2.html'); } markup of modal: <div class="info_modal"> <div class="info_modal_container"> <h2>guia de compra</h2> <hr> <ul class="info_modal_menu"> <li> <a href="javascript:void(0)">como comprar</a>

ios - UIwebview loading remote html with bundle/local images -

well, searched everywhere didn't have luck situation. loading webpage uiwebview following code: nsstring *fullurl; fullurl=@"http://domain.com"; nsurl *url=[nsurl urlwithstring:fullurl]; nsurlrequest *requestobj=[nsurlrequest requestwithurl:url]; [_webview loadrequest:requestobj]; i want load remote html file load images bundle resourses. html file looks this: <img src="http://domain.com/images/image.png" width="20px" height="20px"/> can done? majority of posts on internet(and here) loading local html local images/resources different in case. any code? thanks it better use more "loosely coupled" solution - not edit html code in hacky way (regexp, not regexp... changing html code manually still pretty hacky). as matter of fact, believe can done. ios needs somehow informed of assets available offline, bundle. basically, when uiwebview loading page, first thing happens behind scene downloading main *.ht

jquery - Smooth scrolling/jump to javascript issue -

i'm using stellar , smooth scroll js site (www.cedricvella.com) example learn how works can apply similar site. have local copy can't show yet (no webspace setup yet) my problem can't figure out happens on cedricvella site well, once site loaded , click on 1 of 3 buttons scroll respective areas. but if resize browser window height click on 1 of buttons not scroll correct position until page refreshed. i know fixed using $(window).resize(function() can't life of me figure out. any great, thanks.

oop - PHP toString not printing -

i keep getting following error while trying using __tostring(): catchable fatal error: object of class address not converted string in c:wamp\www\demo.php on line 36 where did go wrong? demo.php echo '<h2>instantiating address</h2>'; $address = new address; echo '<h2>empty address</h2>'; echo '<tt><pre>' . var_export($address, true) . '</pre></tt>'; echo '<h2>setting properties...</h2>'; $address->street_address_1 = '555 fake street'; $address->city_name = 'townsville'; $address->subdivision_name = 'state'; $address->postal_code = '12345'; $address->country_name = 'united states of america'; echo '<tt><pre>' . var_export($address, true) . '</pre></tt>'; echo '<h2>displaying address ...</h2>'; echo

javascript - Preload images from database -

i need preload images database , show them in slider 8 8. how can it? <script type="text/javascript"> function preload(arrayofimages) { $(arrayofimages).each(function(){ $('<img/>')[0].src = this; // alternatively use: // (new image()).src = this; }); } </script> <script> preload([here have select database??]); </script> the slider this: <script type="text/javascript"> $(document).ready(function() { $("#foo1").caroufredsel({ items : 8, direction : "left", width : "100%", scroll : { items : 1, easing : "swing", duration : 300 } }); $("#foo1_next").click(function() { $("#foo1").

Connection with mysql with netbeans for jsp -

i using netbeans 7.0.1 ide jsp/servlet trying make database connection project. downloaded jar file 'mysql-connector-java-5.1.24-bin.jar' pasted jdk's jre/lib dir, added netbean projects libraries dir. created servlet , wrote following code: import java.sql.*; import java.io.ioexception; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class tstjdbc extends httpservlet { protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { try{ string dburl = "jdbc:mysql://localhost:3306/murach"; string username="root"; string password="1234"; connection con2 = drivermanager.getconnection(dburl, username, password); string query = "insert tbluser1(firstname) values('shaon')"; st

c# - Assign extension methods to a variable -

i trying assign variable extension method, getting error when hover on line. cannot assign 'void' implicitly-typed local variable i checking empty fields , calling extension method , wanted check more 1 field , if failing wanted them appear in 1 error box instead of them piling up. if (drp_selectgroup.selectedvalue == "0") { var message = this.showmessage("select ethnic group", "error", errortype.error); } edit* public static void showmessage(this page page, string message, string title, errortype err) { page.clientscript.registerstartupscript(page.gettype(), "toastr", string.format("toastr.{0}('{1}','{2}');", err, message, title), addscripttags: true); } the problem isn't it's extension method - it's extension method has void return type. presumably method shows message, rather creating it. you'd same error message if tried call other void m

SQL IN Operator with Select -

i want use in operator in sql select statement following error "cannot perform aggregate function on expression containing aggregate or subquery." the code using looks follows: select * table id in (select units table2) you have use when instead of where select * `table` `id` in (select `units` `table2`)

bytearray - How to Declare byte* ( byte array ) in c++? -

how declare byte* ( byte array ) in c++ , how define parameter in function definition? when declare below function declaration: int analysis(byte* inputimage,int nheight,int nwidth); getting error : "byte" undefined there no type byte in c++. should use typedef before. like typedef std::uint8_t byte; in c++11, or typedef unsigned char byte; in c++03.

Android, How to get/set layout parameters? -

in application have conversation room. of messages should aligned right while rest should left aligned. single row of list this: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/llcontainer" > <linearlayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/speech_bubble_orange" android:id="@+id/llgroup" > <textview android:id="@+id/message_text" android:layout_width="wrap_content" android:layout_height="wrap_content"

java - How to Clear instance filed afterClass in Junit? -

i looking way collect , publish these myresults . junit @afterclass supports static method. if having super class if multiple test cases running can ugly. idea how can resolve this? if use after, won't full output collected myresult abstract class maintestcase{ static list<string> myresults = new arraylist(); @afterclass public static void wrapup() { //code write myresults text file goes here system.out.println("wrapping up"); myresults.clear() } } @runwith(theories.class) public class theoryafterclasstest extends maintestcase { @datapoint public static string = "a"; @datapoint public static string b = "bb"; @datapoint public static string c = "ccc"; @theory public void stringtest(string x, string y) { myresults.add(x + " " + y); system.out.println(x + " " + y); } } putting list<string> myresults; threadlocal may solve problem, how p

unity3d - How to draw images on Terrain in unity -

Image
i working on game in unity in need images placed on terrain in attached image yellow arrows , "p in blue circle" rendered on surface in unity. any idea or method appreciated. there's no built-in support decals in unity. create separate gameobjects transparent texture , place them above terrain here, or use 1 of several packages decals in unity asset store, this one . (i have briefly tried , can't it's quality).