Posts

Showing posts from June, 2015

Where to get json data for map creation? -

where can find json data tunisia create map d3.js? if there better tools create map (than d3.js) i'll pleased know that. you might able need natural earth data . if that's not sufficient, try humanitarian response cod/fod registry - un data, , official. in both cases, you'll need convert shapefile geojson - see http://bost.ocks.org/mike/map/ conversion strategies.

php - Unable to Call Reconnect API -

i trying connect reconncet api of quickbooks. says me 'this api requires authorization' dont understand mean. $nonce = <random string>; $time = time(); $url = "https://appcenter.intuit.com/api/v1/connection/reconnect?oauth_consumer_key=qyprdxncjbz7mv8zujvlc155xtmeoe&oauth_nonce=$nonce&oauth_signature=eidxzulefveroxdbrt58nitvc2imtcqjoczy81bl%26nyxwe3eewpmkx5qm9fwzotzjw7jupahaaa9z74ch&oauth_signature_method=plaintext&oauth_timestamp=$time&oauth_token=qyprd2p9wwof6mn8phszdk6rlwtcph0neezqhkwdokxdl2aq&oauth_version=1.0"; $params = array ( 19913 => 1, 10002 => $url, 10023 => array ( ), 10102 => '', 41 => 0, 64 => 0, 81 => 0 ); $ch = curl_init(); curl_setopt_array($ch, $params); $response = curl_exec($ch); print_r($response); please me on problem. need this. thanks in advance th

Displaying contents of a pdf in php -

this question has answer here: read pdf files php 4 answers when echoing out file_get_contents on uploaded pdf file, load of nonsense displayed so: 6}ÕìúÖ is there anyway of decoding infomation? this code maybe you <?php $file = 'path/to/pdf/file.pdf'; $filename = 'filename.pdf'; header('content-type: application/pdf'); header('content-disposition: inline; filename="' . $filename . '"'); header('content-transfer-encoding: binary'); header('accept-ranges: bytes'); @readfile($file); ?> be successfull

php - FetchXML - record not being return -

i have fetchxml query returns records based off of business owner user in , probability opportunity success. of fields reporting mandatory , filled out. issue i'm having 1 of linked accounts - "new_dealerid" account might not filled, if include 31 records(all of them have dealers), if don't 32(only new 1 doesn't have dealer). know how make attribute default empty string or if there isnt related account? <request i:type="b:retrievemultiplerequest" xmlns:b="http://schemas.microsoft.com/xrm/2011/contracts" xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <b:parameters xmlns:c="http://schemas.datacontract.org/2004/07/system.collections.generic"> <b:keyvaluepairofstringanytype> <c:key>query</c:key> <c:value i:type="b:fetchexpression"> <b:query>&lt;fetch mapping="logica

java - How convert the char ' to \' in android? -

is possible convert string "hello i'm boss" "hello i\'m boss" how can please my problem convert ' \' somebody have idea please?? string a="hello i'm boss"; i need result="hello i\'m boss" thanks you may use replace follows: string result = a.replace("'","\\'"); note original string a not affected operation.

install IIS 7 on win 7 -

i have downloaded iis 7 when clicked install messege appear the iis management console not installed, required managing remote iis servers. please install before installing iis7 manager. going - control panel / turn windows features on , off , select iis management console in inet . . . . i searched on google , said you need make sure iis management console checked, , install when check it , had not installed iis before . how fix error iis windows component. not can download. have @ answer on super user: https://superuser.com/questions/288312/where-can-i-find-iis-in-windows-7

iis 7.5 - Setting up DNN 6.2 to install new environment but cannot browse to pages. Error 404 -

i setting dev site , went through steps (multiple times now) , continues give error 404. i created ap_dev application pool, gave rights on folder ap_dev user, created web site, assigned apppool, yet continues not allow me browse it. spent full day troubleshooting yesterday; doesn't make sense me. steps not hard. can offer me direction? thank you make sure going right address... ex if unzipped dnn site in folder called dnn should go dnn.yourwebsite.com.... way found around after unzipping filed dnn folder, move them out of there , root of server.... luck

openerp - How to disable automated sales order email notification to customer? -

when confirm sale order email sent customer : " have been invited follow so014. access messages , personal documents through our customer portal". i want disable action. when access basic sale workflow, there no action server defined when sale order confirmed. try find server actions setting -> actions -> server actions then find sale orders , remove action there.

servicemanager - map a custom enum list to a custom form property in an extended incident class in scsm 2012 R2 -

i'm struggeling understand how map custom enum list custom form property in extended incident class in scsm 2012 r2 using authoring tool. here's want have happen: i going publish request offering on smportal allowing users submit basic incidents. want form include "whom problem affect" (answers(this custom enum list): me, multiple users, whole department or whole company), "what problem about", "description" , "attachments". here's i've done: in authoring tool created mp custom enum list , put list in it. sealed mp , imported it. i created unsealed mp called tst.incident.library storing incident library customizations , extended incident class add extension class called classextension_affected scope custom property called affectedscope. trying set datatype of property "list". in "select list" dialog cannot chose sealed mp custom enum list in it. why? do need scratch sealed mp , put custom enum

javascript - odata query not working in ie 7 -

hi have odata query works fine in internet explorer 8 , above not internet explorer 7. hoping there kind of compatibility line can insert somewhere before go , create different query method. function setpricelistfromcurrency() { var pricelevel = xrm.page.getattribute("pricelevelid"); var currencyid = xrm.page.getattribute("transactioncurrencyid").getvalue(); if (currencyid == null) return; sdk.rest.retrievemultiplerecords("pricelevel","?$select=pricelevelid,name&$filter=transactioncurrencyid/id eq guid'"+currencyid[0].id.substr(1, 36)+"'&$top=1", function (results) { //results handler var pricelevelrecord = results[0]; if (pricelevelrecord != null) { pricelevel.setvalue( [{ id: pricelevelrecord.pricelevelid, name: pricelevelrecord.name, entitytype: 'pricelevel' }] ); }

mysql - how to show list of dates of previous month? -

Image
i want show complete list of last 30 days here query: select distinct date_format(transactions.transaction_date,'%c-%d-%y') transaction_date,sum(amount)as amount transactions group date_format(transactions.transaction_date,'%c-%d-%y') and here query result: but want transaction_date amount 1-01-2014 0 2-01-2014 0 upto on how complete result? the typical approach here first write query gets list of dates want, use outer join associate transaction amounts dates in range on there transactions. my recommendation install common_schema , use common_schema.numbers table generate date list. for example can run query last 30 days (exclusive of today): select (current_date() - interval n day) day common_schema.numbers n between 1 , 30 order day then can combine existing query desired result (i made other small changes query limit relevant date range , use date() instead of date_format() sake of simplicity): select days.day

design patterns - Is it better for decision-making logic to live inside the class that acts on the decision or in a separate class? -

take simplified situation: i've got class job create files @ given path (let's call filecreator). files need created, however, if don't exist @ said path. is better filecreator check whether files exist @ path , create them if don't, or create second class that's responsible checking (filechecker) , let filecreator purely creating (without regard whether exist or not)? situation 1 : decision logic sits in class dependent on decision class filecreator def initialize(path) @path = path end def create_files unless files_exists?(path) #create files @ path end end def files_exists?(path) #check if files exist @ path end end file_creator = filecreator.new('/foo') file_creator.create_files situation 2 : decision logic sits in own class class filechecker def initialize(path) @path = path end def files_exists?(path) #check if files exist @ path end end class filecreator def initialize(path)

sql server - Resources to get independent audit/review/analysis? -

i have sql server database has done wrong. after having 3 separate developers stare @ logic 3 days, we're no closer solving issue. is there place can go, else willing invest time study system in order try find problem? when toyota concerned might bug in firmware, got engineers nasa review system. is there place can go help? why not ask here? the issue not can reproduce; have staring @ stored procedures , views. i'd lay out design of system, 2 tables, 2 stored procedures, , 2 views, there lot of concepts need invest time in learning. since question specific, closed localized . i've tried ask questions around think might happening. no answer fits observations. is there nasa of sql server? edit : if 1 of so-inclined may push programmers ; although it's no more programming related code related; it's both , neither. contact database developer associated consulting firm or staffing agency. use referred talent , ask references. short-term

ruby - Sort by doesn't sort when includes is used in rails -

i've got distance attribute in user model : attr_accessor :distance so when calculate distance each user, , store in distance can sort them : users.sort_by!(&:distance) and users sorted according distance appropriately. when include other associated methods i.e : users.includes(:photo).sort_by!(&:distance) this doesn't sort users @ all, why this? how can sort distance include association well? the ! in sort_by! method indicates object changed rather returns different object. when call users.includes(:photo) method returns different object. so, doing like: users2 = users.includes(:photo) users2.sort_by!(&:distance) this why users object not sorted after call sort_by! . better way might be users = users.includes(:photo).sort_by(&:distance)

java - Dynamically Generate A Form Using an XSD file? -

i have java file has xml annotations , have xsd file related it. want generate form @ web page using xsd file (dynamically). if field required put mark @ form field shows required field. user fill fields. save xml file , validate against xsd file. if non valid situation occurs show user. what can use achieve purpose. suggest architecture?

coldfusion - How can I display each days events? -

i have events page need display events each day. i've gotten point, i'm making progress. the database has 3 tables: fairdays, eventtypes, events fairdays: id, fairdaydate (datetime), daycolor, description eventtypes: id, eventtype <-- table input select in "add event form" events: id, eventname, eventtype, eventday (datetime), eventtime (datetime) my intent display day description, under event types, under each of corresponding events. i haven't worked out how display event type sub heading, individual events under each of those, here's code far. hugely appreciated. <cfquery datasource="fairscheduledb" name="getfairdays"> select * fairdays </cfquery> <cfquery datasource="fairscheduledb" name="getfairevents"> select * events ev inner join fairdays fd on fd.fairdaydate = ev.eventday ev.eventday = fd.fairdaydate </cfquery> <cfloop query="getfairdays&quo

javascript - How do i block specific search words on my website from my search form -

i want block searches search box....the address looks below: http://domain.com/search.php?search=dog how set array or blocks search word "dog"? <form id="headbar-search" action="search.php" method="get" x-webkit-speech="x-webkit-speech"> <input type="text" name="search" id="jsid-search-input" value="<?php echo$_get['search']; ?>" class="ui-autocomplete-input search search_input" placeholder="search&#8230;" tabindex="1"/> <div class="ui-widget"></div> </form> search.php <?php include 'header.php'; ?> <!-- container --> <div id="container"> <div class="left"> <div class="pic" style="overflow:hidden; margin-top:5px;"> <div style="margin:0 0 5px 0;overflow:hidden;border:none;height:auto;">

postgresql - Postgres password authentication issue -

i've installed postgresql 9.1 , pgadmin3 on ubuntu server 13.10. i configured postgresql.conf with: listen_addresses = '*' also configured ph_hba.conf changed peer connections md5 plus reset password of postgres by: sudo password postgres then restarted service sudo /etc/init.d/postgresql restart after tried connect default postgresql template database: sudo -u postgres psql template1 but login failed error message: psql: fatal: password authentication failed user "postgres" then tried login pgadmin, gave me same error. i've read here might password expiry dates bug postgresql user can not connect server after changing password but couldn't solve coz cannot login psql. how resolve issue? edit ph_hba file: local postgres md5 local md5 local trust host 127

.net - Using GoogleApisClient ServiceAccountCredential calling RequestAccessTokenAsync throws Exception -

background: have set service account project on google developer console , using service account email, certificate , secret password , following example provide in googleapissample plus.serviceaccount. snippet below part of windows service application: var list<string> scopes = new list<string> { "https://www.googleapis.com/auth/analytics.readonly" }; var credential = new serviceaccountcredential( new serviceaccountcredential.initializer(serviceaccountemail) { scopes = scopes }.fromcertificate(certificate)); if(credential.requestaccesstokenasync(cancellationtoken.none).result) { authenticationkey = credential.token.accesstoken; } when install , run service on local development machine credential.requestaccesstokenasync fine , receives accesstoken , service carries on , reading of analytics data fine. how

javascript - Concept of Math.floor(Math.random() * 5 + 1), what is the true range and why? -

by multiplying random number (which between 0 , 1) 5, make random number between 0 , 5 (for example, 3.1841). math.floor() rounds number down whole number, , adding 1 @ end changes range between 0 , 4 between 1 , 5 (up , including 5). the explanation above confused me... interpretation below: --adding 5 gives range of 5 numbers --but starts 0 (like array?) --so it's technically 0 - 4 --and adding one, make 1 - 5 i new js, don't know if kind of question appropriate here, site has been great far. thank help! from mozilla developer networks' documentation on math.random() : the math.random() function returns floating-point, pseudo-random number in range [0, 1) is, 0 (inclusive) not including 1 (exclusive). here 2 example randomly generated numbers: math.random() // 0.011153860716149211 math.random() // 0.9729151880834252 because of this, when multiply our randomly generated number number, range 0 maximum of 1 lower number being multiplied (as ma

Why is it allowed to label almost every statement in Java? -

i understand main purpose of labels use them break , continue alter usual behaviour of loop. it's possible label every statement not declaration. int j = 0; label1: j++; label2: (int = 0; < 4 ; i++) { if (i == 3) break label2; } is there purpose labels label1 since it's not allowed break label1 ? an unreleased version of java used have goto. in order jump statement goto, have able label it. then @ point james gosling decided wasn't feature , ripped out. involved grepping through java code existed @ time , rewriting goto usage; there 13 uses. (source: youtube video ) so, goto still being reserved word, it's remnant of goto support.

sql server - Creating a FuzzyLookup object using BIML with BIDs Helper -

Image
i'm trying create fuzzylookup object using biml bids , visual studio 2008. the following code erros , not compile error "could not resolve reference dbo.juniorsurveyresponses". object dbo.juniorsurveyresponses exists , have correct permissions it. if remove fuzzylookup create remainder of code compiles without error. code https://www.varigence.com/documentation/samples/biml/fuzzy+lookup . any ideas error? <biml xmlns="http://schemas.varigence.com/biml.xsd"> <connections> <oledbconnection name="sportsdata" connectionstring="provider=sqlncli10;server=myserver;initial catalog=mycatalog;integrated security=sspi;" delayvalidation="true" /> </connections> <packages> <package name="my package" constraintmode="linear"> <tasks> <dataflow name="my dataflow task">

linux - Arduino SD library arduino-core 1:1.0.0.1+dfsg-7 undefined reference -

i'm trying compile dumpfile example on raspbian using arduino-core , arduino-mk packages. it worked other projects, when comes using sd library have errors @ compilation time, don't know if it's wrong or if it's issue in sd library itself. from changelog of arduino-core package, there nothing fixed in sd library between version of package , recent one. upgrading may not help. i'm copying output of running >make /usr/bin/avr-gcc -c -mmcu=atmega328p -df_cpu=16000000l -darduino=100 -i. -i/usr/share/arduino/hardware/arduino/cores/arduino -i/usr/share/arduino/hardware/arduino/variants/standard -i/usr/share/arduino/libraries/sd -i/home/pi/sketchbook/libraries/sd -g -os -w -wall -ffunction-sections -fdata-sections -fno-exceptions /usr/share/arduino/libraries/sd/file.cpp -o build-cli/libs/sd/file.o mkdir -p build-cli/libs/sd/ /usr/bin/avr-gcc -c -mmcu=atmega328p -df_cpu=16000000l -darduino=100 -i. -i/usr/share/arduino/hardware/arduino/cores/arduino -i/usr/

java - is binary search more relevant while searching for a word in dictionary? -

i have written algorithm searches word in dictionary. searches 1 or 2 letters of specified length of word. ex search:- a** result should be:- aid, aim, i have used linear search algorithm find words matches criteria. want know if binary search can used instead of linear search? if can 1 please give me hint import java.io.file; import java.io.filenotfoundexception; import java.util.scanner; public class cse221labassignment1 { /** * @param args command line arguments */ public static final string wordlistfilename = "e:\\brac uni\\cse lab\\cse221 lab\\cse221labassignment1\\src\\cse221labassignment1\\wordlist.txt"; public static final string searchlistfilename = "e:\\brac uni\\cse lab\\cse221 lab\\cse221labassignment1\\src\\cse221labassignment1\\searchlist.txt"; public static void main(string[] args) { // todo code application logic here string wordlist, searchlist; wordlist = readfile(wordli

html - webpage - text positioning in a header -

Image
i've trying position text along same line, i'm having trouble doing this. want achieve text on top left of screen , top-right of screen, display links other urls. have far: this want achieve: can provide tops on how achieve this? thank you code below: <style type="text/css"> @font-face /* support browsers & ie v10 onwards*/ {font-family:homefont; src: url("font.ttf");} {font-family:headerfont; src: url("playball.ttf");} body {background:url('img/mybackgroundhd.jpg') no-repeat center center fixed;} <!-- make header sticky --> #header_container {background:#00e5ee; border:0px solid #666; height:70px; left:0; position:fixed; width:100%; top:0;} <!-- header text --> #header{padding: 0.3em 0; border-bottom: 0px; overflow: hidden; zoom: 1; line-height:0px; margin:0 auto; width:940px; text-align:left;display:inline-block; float:right;} #wrapper{width:900px;margin:0 auto;} a{color:#444;text-decoration: none;}

Python / Tkinter Is there a way to distinguish a programmatic change to a combo box from a user initiated change? -

i'm building gui front-end network appliance many of parameters (parameter1 , parameter2 example) best displayed combo box. there implicit hierarchy of parameters parameter1 change value of parameter2, parameter2 not change parameter1 , parameter2 may changed independently. i can trap user initiated change parameter1 , parameter2, when user initiated change parameter1 causes programmatic change parameter2 trap on parameter2 invoked. is there clever way work around this? sample code: import tkinter tk import ttk global parameter1 global parameter2 global list1 global list2 list1 = ["apple","bananna","orange"] list2 = ["moe","larry","curly"] def parameter1_changed(arg1,arg2,arg3): print "selection list 1 changed" print "arg1=%s arg2=%s arg3=%s"%(arg1,arg2,arg3) parameter2.set(list2[1]) def parameter2_changed(arg1,arg2,arg3): print "select

html - w3schools did not explain this in PHP can someone explain it to me? -

hey guys learning php , w3schools not have listed purpose if these things. sorry not familiar names , conecepts well, hoping can kind go on me. searched youtube videos, not call correct name. "place "post in here because needs call have in html" $_post? variable? ect <form method="post" action="<?php echo htmlspecialchars($_server["php_self"]); ?>"> <!-- $_server["php_self"] super global variable returns filename of executing script.' so, $_server["php_self"] sends submitted form data page itself, instead of jumping different page. way, user error messages on same page form.--> name: <input type="text" name="name"> <br> e-mail: <input type="text" name="email"> <br> website: <input type="text" name="website"> <br>

grep and/or sed to match a path from a string which has different patterns -

i have big file composed of alot of different lines have 1 commen keyword, storaged. proc:storage123:0702:2108:0,1,2,3,4,5:storage:vers:storaged:storage123:storage 123:storage123:-r /etc/orc/storage123 -e emr123@localhost -p xxx:: proc:storageabc:0606:2108:0,1,2,3,4,5:storage:vers:storaged:storageabc:storage abc:storageabc: -e emabc@localhost -r /etc/orc/storageabc -p 654:: what need grep path can found on storaged keywords comes after -r. want path, nothing after that. -r can found on different places there no pattern it. i created 1 espressionen seemed work, think made complex (and not 100% sure match) should have be. [root:~/scripts/] <conf.txt grep -o 'r *[^ ]*' | grep -o '[^ ]*$' | sed 's/.*r\///' /etc/orc/storage123 /etc/orc/storagerabc the espression hard implement in bash script simpler great. need these paths in script later on. cheers your attempt nice, can simplify using look-behind: $ grep -po '(?<=-r )[^ ]*'

Github DETACHED HEAD error when working with another developer -

a developer , working on using .gitignore add conditions c# projects , solutions committing, since encountered issue of being unable commit result of committing binaries (such .suo ) github well, caused conflicts. we fixed issue of .gitignore , ignores number of conditions. however, when went computer, getting detached head error. did git status , , command line has been giving me these messages. i unsure how solve issue. wondering can/should can go master , commit/sync changes? also, how prevent issue in future? http://puu.sh/6ey9d/ae25db08b9.png i in rebase, ran git rebase --abort out of that. afterwards in master , allowed me commit again.

html - Running imagesnap in PHP with Mac Server -

i trying develop small site take snapshots of house using webcam connected to mac mini @ home. mac mini running os x server . webcam logitech hd pro webcam c920 (usb connected). based on php , html5 (no other code besides css). my development machine macbook pro using internal isight camera. not running os x server ; manually enabled apache , php. while developing site on laptop, worked flawlessly. when installed on mac mini imagesnap program turns on camera never finishes; have manually kill process, , snapshot never created. the following error logged: imagesnap[2363]: *** qtcapturesession warning: session received following error while decompressing video: error domain=nsosstatuserrordomain code=-12903 "the operation couldn’t completed. (osstatus error -12903.)". make sure formats of video outputs configured. this when running site directly. if run same program command-line, works fine... running _www user! sudo -u _www bin/imagesnap images/snapshot_$date.jp

python - Django How to make only one query with queryset exists method? -

i try understand django documentation queryset exists method additionally, if some_queryset has not yet been evaluated, know @ point, using some_queryset.exists() more overall work (one query existence check plus 1 later retrieve results) using bool(some_queryset), retrieves results , checks if returned. what i'm doing: if queryset.exists(): do_something() element in queryset: do_something_else(element) so i'm doing more overall work using bool(some_queryset) does code makes 1 query? if bool(queryset): do_something() element in queryset: do_something_else(element) if yes python puts results ? in queryset variable ? thank you from .exists() docs itself: additionally, if some_queryset has not yet been evaluated, know @ point, using some_queryset.exists() more overall work (one query existence check plus 1 later retrieve results) using bool(some_queryset) ,

Deezer: Artists top songs and Rank -

the top method: http://developers.deezer.com/api/artist/top retrieve top tracks each artist; know answer country-related; possible have "global" top? date range taken consideration answer? i expected, top answer, decreasing (or increasing, depending on order) rank, query http://api.deezer.com/2.0/artist/2276/top?output=xml&limit=20 i can see, first 3 results, following ranks: 1) 425272 2) 434667 3) 401878 is order of "rank" different top? maybe date range different? the rank global indicator of song's popularity on deezer, goes 0 1m. closer 1m, popular track is. rank updated daily based on deezer users' streams.

vb.net - Get image url back in fileupload -

i have created item image now, want update item , image, how can image path file upload please i tried everywhere tell me, not possible picturebox1.image=image.fromfile("url or image") was question didn't it, did mean want change image on runtime? regards

Solving systems of equations in Matlab -

Image
how solve these equations in matlab? lines 1 , 3 independent lines 2 , 4, , can solved easily. regarding lines 2 , 4, can solve them using genetic algorithms gamultiobj (which give set of approximate solutions, aka. pareto frontier ): run_ga.m: fitnessfunction = @objectives; numberofvariables = 2; options = gaoptimset('generations', 100, 'populationsize', 100); [x,fval,exitflag,output] = gamultiobj(fitnessfunction,numberofvariables,[],[],[],[],[],[],options) objectives.m: function y = objectives(x) w = x(1); y = x(2); y(1) = abs(2*w*y-2*w+1); y(2) = abs(2*w+y^2-2*y-1);

windows - error to write text to a text file line by line by appending in C# , but got nothing in the file -

this question has answer here: streamwriter.write doesn't write file; no exception thrown 8 answers i working on c# on win7 vs 2012. i need write text text file line line appending. streamwriter ofile = new streamwriter(@"c:\mypath\my_data_output.txt", true); ofile.writeline(mystring + "\t"); but, there nothing in output file. any appreciated. enclose code in using clause. call dispose method on streamwriter class. dispose method calls flush method, writes stream. your code this: using (streamwriter ofile = new streamwriter(@"c:\mypath\my_data_output.txt", true) { ofile.writeline(mystring + "\t"); } you can call flush method @ time.

excel 2007 (connect to SSAS 2005 cube) taking much long time to refresh -

so have excel 2007 workbook connecting ssas 2005 cube. dragged , dropped dimensions , facts make report. noticed change position of field (click on field in row labels pane , choose move up) report takes long time refresh. @ bottom see 'running olap query...' seems every time make change excel sends out whole query again. guess how excel works? my second question, put mdx in ssms generate same report runs pretty quick. changes order of field did in excel still runs fast. why excel runs slow, guess sends out less efficient query? if query less efficient shouldn't there cache in server, why second time run in excel still takes long?

javascript - jQuery loading empty image first in slideshow -

okay, everyone, total noob @ jquery, i'm learning, , i've tried research , implement simple slideshow. looks thus: <script type="text/javascript"> var imgs = [ '../images/slideshow/01.jpg', '../images/slideshow/02.jpg', '../images/slideshow/03.jpg', '../images/slideshow/04.jpg', '../images/slideshow/05.jpg', '../images/slideshow/06.jpg', '../images/slideshow/07.jpg']; var cnt = imgs.length; $(function () { setinterval(slider, 3000); }); function slider() { $('#imageslide').fadeout(3000, function () { $(this).attr('src', imgs[(imgs.length++) % cnt]).fadein(2000); }); } </script> and have in body down yonder: <img id="imageslide" alt="" src="" height="450" width="450" border="0" /> it runs alright purposes, it's kind

sql server - Why SQL comparison with <> doesn't return the row with NULL value -

this question has answer here: not equal <> != operator on null 10 answers assume table x so: | b ---------------- 2 pqr 3 xyz *null* abc when execute query like: select * x <> 2 i expect result set this: | b ---------------- 3 xyz *null* abc but surprise, result set : | b ---------------- 3 xyz why row null value not appear in result set? can explain behavior ? the ansi-92 sql standard states if 1 of operands null, result of comparison "unknown" - not true or false. for @ how nulls work in sql, see 4 simple rules handling sql nulls sql fiddle ms sql server 2008 schema setup : create table x ([a] int, [b] varchar(3)) ; insert x ([a], [b]) values (2, 'pqr'), (3, 'xyz'), (null, 'abc') ; query 1 : se

How to handle "An Item with the same key has already been added" when adding .jar to dot42 project -

i trying add .jar library dot42 project. ksoap2-android. when add newly created project, error "an item same key has been added". causes , how deal it? this issue solved in version 1.0.1.81, available download.

having trouble for making a linked list in fortran -

i have question creating linked list in fortran . hope 1 has ideas me! want create list contain nodes , every node has 1 function. possible or not? , can use linked list purpose? type node integer :: handle double precision, function :: type(node) , pointer :: next end type nod

ruby - Find the median of an array -

i wrote code returns median of unsorted odd numbered array, not return median of numbered array. i know in order find median of numbered array, have take middle 2 numbers of array, average them, , that's median. can't translate usable code. aside obvious verbosity of code, issue seems lines 7-8 , don't see why. i prefer hints answers, if rather post fixed code, can accept too. def media(array) sorted = array.sort list = sorted.length if list %2 != 0 (list + 1) / 2.0 else = ((list.to_f + 2) / 2) + ((list.to_f / 2) return (even/2) end end i'm going jump in solution here... def median(ary) mid = ary.length / 2 sorted = ary.sort ary.length.odd? ? sorted[mid] : 0.5 * (sorted[mid] + sorted[mid - 1]) end edit - i've incorporated .odd? per broisatse's suggestion.

Zend framework 2 module creation -

i encountered problem while trying create new module: fatal error: uncaught exception 'zend\modulemanager\exception\runtimeexception' message 'module (page) not initialized.' in /home/sc/projects/zf2/vendor/zendframework/zendframework/library/zend/modulemanager/modulemanager.php:175 stack trace: #0 /home/sc/projects/zf2/vendor/zendframework/zendframework/library/zend/modulemanager/modulemanager.php(149): zend\modulemanager\modulemanager->loadmodulebyname(object(zend\modulemanager\moduleevent)) #1 /home/sc/projects/zf2/vendor/zendframework/zendframework/library/zend/modulemanager/modulemanager.php(90): zend\modulemanager\modulemanager->loadmodule('page') #2 [internal function]: zend\modulemanager\modulemanager->onloadmodules(object(zend\modulemanager\moduleevent)) #3 /home/sc/projects/zf2/vendor/zendframework/zendframework/library/zend/eventmanager/eventmanager.php(468): call_user_func(array, object(zend\modulemanager\moduleevent)) #4

Display a simple counter of currently logged in users using php, pdo and mysql -

i have been searching days such simple counter displays number of logged in users on website - however, have had no luck finding anything. , stuff have found relates deprecated *mysql_functions.... :( - sigh... all looking how make work literally cannot figure out - 1 think easy holy crap, after searching , searching, seems there many different ways accomplish , sadly have found mentioned above (stuff using deprecated mysql_functions)... anyway, looking do: 1.) adding lastactivity or lastseen in users table either based on timestamp or perhaps tinyint(1) default 0 equals user logged out of switch 1 if user logged in... 2.) creating class using php version (5.4.24) pdo driver based on in database table users update , select in database table users every 5-10 minutes output number of logged in users. 3.) being able use <?php echo $lastactivity; ?> or <?php echo $lastseen; ?> display number of users logged in on each page place piece of code on... 4.) o

actionscript 3 - How to get the final URL from a redirect in AS3? -

i need final url link gets redirected. (e.g. if using url shortener) bit.ly/foobar ->redirect-> http://example.com what fastest way in as3? you since using air, can listen httpstatusevent.http_response_status event: var urlloader:urlloader = new urlloader(new urlrequest("http://bit.ly/1bddlxc")); urlloader.addeventlistener(httpstatusevent.http_response_status, urlloader_httpresponsestatus); function urlloader_httpresponsestatus(e:httpstatusevent):void { trace(e.redirected, e.responseurl); } the result of above trace true http://www.google.com/ this event gives information whether url redirected , new url is.

android - Warning: This <FrameLayout> can be replaced with a <merge> tag -

i have framelayout contains textview , 2 linearlayout s: <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > ... textview , 2 linearlayouts </framelayout> after running android lint, warning: this <framelayout> can replaced <merge> tag. why warning exist? can fix (other ignore)? to understand this, need understand how layout inflated , placed. let's example, have activity , layout xml use. here layout of activity looks before put layout file. <framelayout // window ... <framelayout> // activity </framelayout> </framelayout> there might few other layers depending on device/os. now when inflate layout file , put in, how look. <framelayout // window ... <framelayout> // activity // layout below <framelayout xmlns:android=&q

javascript - Creating and updating nested objects in Ember -

i got nested json data server this: { name: "alice", profile: { something: "abc" } } and have following model: app.user = ember.object.extend({ name: null, profile: ember.object.extend({ something: null }) }) if app.user.create(attrs) or user.setproperties(attrs) , profile object gets overwritten plain js object, i'm doing this: var profileattr = attrs.profile; delete attrs.profile user.setproperties(attrs); // or user = app.user.create(attrs); user.get('profile').setproperties(profileattrs); it works, i've got in few places , in real code i've got more 1 nested object, wondering if it's ok override user#create , user#setproperties methods automatically. maybe there's better way? based on comment, want automatic merging behaviour models (the sort of thing .extend() ). in case, try registering custom transformer, like: app.objecttransform = ds.transform.extend({ deserialize: function(j

c# - Session timeout -

i have problem in creating session. session.timeout doesn't work. code session["uid"] = uid; session["username"] = username; session.timeout = 10; // ?not responding session.timeout occurs after 3 or 4 minutes you should set session timeout in web.config file this: <sessionstate mode="inproc" cookieless="autodetect" timeout="10" /> taken here: msdn on session state element in web.config