Posts

Showing posts from January, 2010

java - Create a WAR file with version using ANT -

i have problem trying build war file version number. build.properties jboss.home=d\:\java\jboss-as-7.1.1.final version=2.0 and part of ant task <project name="as2-jboss7" basedir="../" default="deploy"> <!-- configuraciones del proyecto --> <property name="project.distname" value="as2" /> <!-- paths locales del sistema --> <property file="${basedir}/ant/build.properties" /> <property name="webroot.dir" value="${basedir}/webcontent" /> <property name="webinf.dir" value="${webroot.dir}/web-inf" /> <property name="build.dir" value="build" /> <!-- build project --> <target name="build" depends="prepare,compile" /> <target name="rebuild" depends="clean,prepare,compile" /> <!-- crea el war de la aplicacion --> <target name="war"

javascript - What's the best way to determine a route's template based on $cookies value in AngularJS? -

i'd root url, / , of angularjs app display template based on cookie value. example, when login cookie present display dashboard. when login cookie absent, display login screen. i tried inject $cookies app.config determine template property of $route based on it, didn't work. var myapp = angular.module('myapp', ['ngroute', 'ngcookies']); myapp.config([ '$routeprovider', '$locationprovider', function ($routeprovider, $locationprovider) { $routeprovider. when('/', { templateurl: function() { // read cookies here? return '../../connect.html'; }, controller: "getauthurl" }); $locationprovider. html5mode(true). hashprefix('!'); } ]); answering own question... after further investigation, found out $routeprovider not should u

Split arrays of natural numbers according to a requirement -

i have 2 arrays {a i } , {b i } of natural numbers. sums of elements equal. i need split each element of 2 arrays 3 natural numbers: a i = a1 i + a2 i + a3 i b i = b1 i + b2 i + b3 i such sum of elements of a1 equal sum of elements of b1 , same other pairs. the important part forgot about: each element a1 j , a2 j , a3 j should between a j /3-2 , a j /3+2 or @ least equal 1 of these numbers each element b1 j , b2 j , b3 j should between b j /3-2 , b j /3+2 or @ least equal 1 of these numbers so elements of arrays must split in equal parts i more elegant solution calculating possible variant both arrays. i more elegant solution calculating possible variant both arrays. it should possible divide them sums of a1, a2 , a3 near third of a, , same b. easy make values exact third, that’s not possible natural numbers. have floor results (trivial) , distribute remainders uniformly on 3 arrays (manageable). i don't know whether it’s solution,

php - Contact Form Fields not being sent -

the project , phone fields in contact form script arent working. ideas i'm doing wrong every other field works great: <? php include('contact-config.php'); $contact_form_version = strtolower($contact_form_version); if (empty($to) || empty($contact_form_version) || ($contact_form_version != 'php' && $contact_form_version != 'html')) { die('error: contact form has not been setup correctly.'); } else { if ($contact_form_version == 'php') { $formlocation = 'contact.php'; } else if ($contact_form_version == 'html') { $formlocation = 'contact.html'; } } if (!empty($_post['isajax']) && $_post['isajax'] == '1') { $ajax = true; } else { $ajax = false; } if (empty($_post['name']) || empty($_post['project']) || empty($_post['email']) || empty($_post['phone']) || empty($_post['message'])) { if ($ajax || $contact_form_version == 'h

node.js - Load data into ExtJS app at loadtime -

i have database of users , security credentials. i'm using passport (node authentication middleware) authenticate users before serving main extjs app.js . there way configure app.js user's security credentials i'm serving app.js ? i.e, if bob authenticated security clearance 4, how can configure ext js app reflect security level? i'm quite unfamiliar web programming..(but learning!)

Plugin to write a patch file while editing files in vim -

i have edit config files on server , @ same time document changes. had idea have plugin automatically log changes file external patch file. before try hack myself - there plugin already? i'm thinking command ala :logchanges /tmp/changes.patch after changes in (all files|the current file) logged said patch file.

Adding a scroll bar for oversized picture to powerpoint -

i have oversized picture want add powerpoint slide. want picture fit within box , have vertical scroll bar. this not answer looking can make faux scrolling bar shapes , action buttons. explanation described in office page: http://office.microsoft.com/en-us/powerpoint-help/create-a-scrolling-effect-in-powerpoint-2007-ha010245145.aspx this allow feeling of scrollbar. can add separate sections of picture becomes visible/invisible when click action button instead of showing next page. can alter action right-clicking action button , changing action or use regular button shape of action button added hyperlink .

php - Apache htaccess rewrite condition to root folder on server -

i need create rewrite condition route different folder on server. something http://mydomain.com/newapp/(.*)$ should rewrite /var/www/mynewapp/index.php/$1 i can't life of me figure out how write conditions, no matter stays in current app.... rewriteengine on rewriterule ^newapp/(.*)$ /var/www/mynewapp/index.php/$1 [l,qsa] that's i've tried said keeps redirecting original app. if /var/www/mynewapp/index.php not within original documentroot (which seems case), symlink /var/www/myoldapp/newindex.php /var/www/mynewapp/index.php , use like rewritecond %{request_uri} ^newapp rewriterule ^newapp/(.*)$ newindex.php [l] to redirect requests.

How to find all disconnected graphs in a node/edge sql representation? -

given nodes , edges tables, how find disconnected graphs using tsql ? references : http://techportal.inviqa.com/2009/09/07/graphs-in-the-database-sql-meets-social-networks/ http://apps.cytoscape.org/apps/subnetworkcreator

android - changing layout image dynamically more then once -

Image
in linear 1,3 i'm displaying transparent buttons , 1 want linear 2 parent layout , set image continuously change 3-4 times i thought of using setbackgroundresource but change once ,**how show images in flow like image 1,image2....so on** ,if use relative layout still same prob ,new in development kindly guide i not sure if got correctly if want change images 1 after other can try animation drawable http://developer.android.com/reference/android/graphics/drawable/animationdrawable.html for showing stuff 1 on other should use frame layout. can elaborate question bit

compilation - How to compile less css files using brunch -

i'm looking best way compile less files using brunch. since i'd in server side, thinking have compile using bash script (or that). i noticed there plugin using less + brunch, i'm not sure how use it. i'd great if edit less files , automatically update when brunch watch --server running anyone knows how it? thanks in advance all info official site: http://brunch.io/#plugins-list 1. to install new plugin, execute npm install --save plugin-name . install node.js dependencies , save package.json. 2. all plugins available @ plugins wiki page . 3. https://github.com/brunch/less-brunch 4. npm install --save less-brunch

angularjs - Get editable row of data from angular and sending it to WEB api -

how send 'save' event complete object including ever user has typed in row? now, 2 fields null no matter do. (the temp comment) put this? want item data when 'save' clicked if put in there how refer specific row? the example started used separate pages list/edit problem having how combine functionality 1 page. var listctrl = function($scope, $location, msa) { $scope.items = msa.query(); //temp: since not know how value specific row var id = 1; $scope.msa = msa.get({id: id}); $scope.save = function() { msa.update({id: id}, $scope.msa, function() { $location.path('/'); }); } }; <tbody> <tr ng-repeat="msa in items"> <td>{{msa.placeid}}</td> <td>{{msa.name}}</td> <td> <div class="controls"> <input type="text" ng-model="msa.previousplaceid" id="previou

Simple Day / Date PHP not working? -

i'm using following show div on day , @ time , it's not working properly. seems recognising time (and displays correctly when should) ignoring day altogether. <?php $current_time = date(g); $current_day = date(l); if ($current_day = "thursday" && $current_time >= 19 && $current_time <= 21) { ?> <div id="content">content here</div> <?php } ?> if strip out time reference altogether still doesn't work. shows div regardless of day is. <?php $current_day = date(l); if ($current_day = "thursday") { ?> <div id="content">content here</div> <?php } ?> i'm sure super simple can't see it. any ideas? you're using = instead of == in if statement. it assign, true, except if assign false , 0 , null or empty string.

keyboard shortcuts - Can I assign the TAB key to Zen coding's Expend Abbreviation command in Microsoft Visual Studio 2010? -

i installed zen coding microsoft virtual studio 2010. zen coding v0.7 sergey chikuyonok visual studio plugin v0.7 danny su http://visualstudiogallery.msdn.microsoft.com/924090a6-1177-4e81-96a3-e929d7193130 i able use tab key in order use zen coding's expend abbreviation command (instead of alt-z) when editing html documents in sublime text 2. i go tools/options/environment/keyboard , choose zencoding.expandabbreviation when type tab key in box assign key doesn't work. any idea? possible? many time , help.

eval - Create variables from an array of cells in Matlab -

i have array of cells, example, cells = {'a', 'b', 'c', d', 'e'}; which inside loop of 1 5. i want create variable e depending on loop index, 1 a, 2 b... when try ( i index), eval(cells{i}) = values; gives me error, undefined function or method 'eval' input arguments of type 'a' here answer: eval(sprintf([cells{i} '=values;'])) and can remove ; if want see display in command window. in answer comment : cells = {'a', 'b', 'c', 'd', 'e'}; values = 4; = 1; eval(sprintf([cells{i} '=values;'])) this works fine on computer, , no warning or error messages.

c# - load external aspx into div using jQuery load() function -

when i'm using jquery load function show external external.aspx page in div, server controls (placed outside div in original page) cause postbacks redirecting me external.aspx. bizarre bug. the jquery command i'm using is: $(function () { $("#mydiv").load("external.aspx"); }); example server control: <a href="#" id="a" runat="server" onserverclick="a_click">click me</a> the a_click method: protected void a_click(object sender, eventargs e) { a.innertext = "hello"; } i have tried using $.get , it's doing same problem iframe not option since it's messing css in ie , other browsers. i've been looking on web 2 days , found no solution. thanks time.

android - Holo template for javadoc -

i'd ask if there css, template, doclet or else give android javadoc generated eclipse holo appearance; best example know official android api reference ( http://developer.android.com/reference/packages.html ); so, there way emulate android reference (and android 4.x, obviously) holo appearance, or better, utilize theme? (which google released template or has extracted it) best solution found google's doclava, nice, not i'm talking about...

ios - Using deep index paths in UICollectionView data source -

i trying uicollectionview's data source data structure (for reasons) more 2 layers deep. in other words, data can broken sections, not of sections contain items. contain arrays of items (or "nested sections", speak). these items can referenced index path three indices long (3.2.4, instance), uicollectionview's data source methods seem support index paths two indices long. all of uicollectionview apis use nsindexpaths reference collection view items, in theory should work number of indices. challenge getting collection view "know" ask cells, layout attributes, etc. items @ these deeper indices when data source protocol provides collectionview:numberofitemsinsection: , numberofsectionsincollectionview: specify indices needs ask for. is there way around doesn't require me (a) subclass uicollectionview, apple explicitly discourages (second point under "tips implementing custom layouts") or (b) flatten data structure, less ideal, , see

asp.net - Internal server 500 error with 958 records (not maxRequestLength issue) -

i have system.web.ui.webcontrols.gridview control. running in asp.net sharepoint web part application using .net 3.5. on form submit, if grid has 957 rows, works fine. if has 958 rows, fails. i'm confident not maxrequestlength overflow because have changed in web.config, , i've loaded 957 records of large size, , 958 records of smaller size , same behavior occurs. it's not 1 record either because load more records , randomly eliminate them before returning view client (which how found magic number of 958). it's never random; 957 records submit no matter total size , despite delays while debugging (no timeout occurs). 958 fail. actual server error returned is: uncaught sys.webforms.pagerequestmanagerservererrorexception: sys.webforms.pagerequestmanagerservererrorexception: unknown error occurred while processing request on server. status code returned server was: 500 i beyond stumped. has run before or have ideas? the issue turned out 1000 key

sql server - SELECT - SQL vs T-SQL? -

my book says there’s interesting difference between standard sql , t-sql in terms of minimal >select query requirements. according standard sql, select query must have @ minimum , select clauses. conversely, t-sql supports select query select clause , without clause. such query if issued against imaginary table has 1 row. example, following query invalid according standard sql valid according t-sql. select 10 col1, 'abc' col2; col1 col2 10 abc how feature possibly useful ? not data coming database might database/table. perhaps want metadata, or server-side variable: select @server_side_variable; other dbs around restriction having virtual table named dual , have from clause, doesn't point @ 'real' table in database: select @server_side_variable dual;

python - Web page already open (in source format); just need to read that text, using Selenium -

let's have tab open in browswer. url is: view-source:http://www.google.com/webhp?source=search_app now it's open , displayed, want read text that's in client window. (get context page, or obtain object (as opposed creating new browser object), or whatever. read page.) is there methodology in selenium, splinter allows that? help. if asking if can attach open browser, believe answer "no".

html - SVG rendering on android browsers -

i'm having issue long time , can't find solution. i have svg image css background on top left corner of div. svg graphics should seamlessly merge on div background, instead produces thin borders around rendered graphics. works fine on desktop browsers (tested on chrome, firefox , opera) fails on android stock browser, chrome android, , firefox android. here little test case : http://jsfiddle.net/sdjha/1/ (the svg code on javascript frame comment) the css code : .cont{ background-color : #7ac943; width : 300px; height : 300px; } .elementone{ background-image: url("data:image/svg+xml;utf8,%3csvg%20version%3d%221.1%22%20id%3d%22layer_1%22%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20xmlns%3axlink%3d%22http%3a%2f%2fwww.w3.org%2f1999%2fxlink%22%20x%3d%220px%22%20y%3d%220px%22%20width%3d%22100px%22%20height%3d%22100px%22%20viewbox%3d%220%200%20100%20100%22%20enable-background%3d%22new%200%200%20100%20100%22%20xml%3aspace%3d%22preserve%22%3e%3cpolygon

javascript - Check if multiple arrays of the same variable name contain any items -

the example code below uses mix of razor , javascript. renderchart function takes in dates. dates var returns array of dates. i'm wondering how can check date arrays combined see if of them contain items or in case date strings. foreach (measurementtypegroup group in model.measurementtypegroups){ var dates = @(html.raw(dates)); // dates returns [] renderchart( dates); console.log(dates); //console display " [] [] [] or [] [3/2/12] [] } initially using if condition check length if(dates.length === undefined || dates.length === 0) { //do } this partially works, on every iteration in foreach loop rather on total of date arrays. i'm guessing need return variable , push contents of 1 other i'm having issue figure out how this. help! you can use concat combine arrays single one. http://www.w3schools.com/jsref/jsref_concat_array.asp var alldates = [] foreach (measurementtypegroup group in model.measurementtypegroups){ v

java - JRE 7 JVM updates and optimizations -

do know how oracle things under hood, e.g. jvm performance optimizations don't end in official java update release notes? if don't mention every nook , cranny changed in jvm each update, 1 find such exhaustive list? i wondering since there trying justify upgrading java 7 update 7 latest update , rest of programming team vary of upgrade (we're running single-user desktop app jre don't think security fixes overly important us). edit: since old http://bugs.sun.com down quite time, i'd ventured searching similar , have stumbled upon seems exhaustive issue list when comes jdk - it's hosted on openjdk jira; future reference, here link jdk 7: https://bugs.openjdk.java.net/browse/jdk#selectedtab=com.atlassian.jira.plugin.system.project%3achangelog-panel from experience switching application 1.5, 1.6 1.7 on years can find of in update release notes not clear input changes have performance or heap space. notice increased heap space in java 1.6 update

r - Increment a date by some time period -

when using "+" operator increment date (or date-time), how specify increment in days (or months, or weeks, or years)? > sys.date() [1] "2013-08-23" > sys.date() + 1 [1] "2013-08-24" > isodate(2013,8,23) [1] "2013-08-23 12:00:00 gmt" > isodate(2013,8,23) + 1 [1] "2013-08-23 12:00:01 gmt" use lubridate::days > require(lubridate) > sys.date() [1] "2013-08-23" > sys.date() + days(1) [1] "2013-08-24" > isodate(2013, 8, 23) [1] "2013-08-23 12:00:00 gmt" > isodate(2013, 8, 23) + days(1) [1] "2013-08-24 12:00:00 gmt" with lubridate, can use years() , seconds() , etc., or define own duration .

winapi - which language can compile independent exe file -

i wonder if can suggest me on language can compile exe file indepdent nsis more powerful. can run on win xp+ without framework (.net / whatever), external dlls accepted. thanks. by mentioning "nsis" understand want create self-extracting installer executable. right? "nsis" seems 1 of powerful ones available if want have more powerful you'll have write installer in regular programming language. if not interested in installers: there many programming languages available windows can generate stand-alone executables: c, c++, pascal, visual basic, ... (note latest version of visual basic generate .net executables) the open-source , free variants of programming languages are: c, c++, assembler: gcc (available in different variants: mingw, cygwin, dev-cpp, ...) pascal: freepascal (a variant graphically-oriented "lazarus") of course can buy professional compiler. (using c , c++ can create dll libraries.)

html - Hiding the secondary child menu behind its parent -

i want secondary menu scroll down when go on hover parent. don't want secondary menu go on first menu items while openning up. how can fix that? html: <ul id="top-menu"> <li><a href="index.php" title="homepage"><img src="img/menu/home.png" alt="homepage" /></a></li> <li><a href="#" title="list & print tenants"><img src="img/menu/list-print.png" alt="list & print tenants" /></a> <ul> <li><a href="list-tenants-by-name.php" title="list tenants name">list name</a></li> <li><a href="list-tenants-by-lot.php" title="list tenants lot number">list lot number</a></li> </ul> </li> <li><a href="#" title="modify tenants

Disadvantages of Using ThreadPool -

can please elaborate disadvantages of using threadpools . one disadvantage found task starvation . please add if think there more disadvantages you have no control on state , priority of thread in thread pool can't give stable identity , keep track on if need single thread single task thread pool not needed

django - Setting Primary key in ModelForm -

this code load editscreen user model. @login_required () def getuser (request, userid): if request.method == "get": my_record = user.objects.get(user_id=userid) form = userupdateform (instance=my_record) print "registration page loading..." return render(request, "en/updateuser.html", {'form': form } ) but 'user_id' (primarykey) not going part of 'form' when request update user i'm not able object instance update it. how set along form should able read it. thought of setting through hidden value felt not safe way. please suggest. why want send part of form? have in url (and therefore userid argument view), there's no need anywhere else.

java - MediaPlayer playing and replaying issue -

i trying set media player sound can played , replayed many times desired. getting error while playing audio first time: 08-23 14:48:52.613: e/mediaplayer(24194): error (1, -2147483648) 08-23 14:48:52.613: v/preschool basics(24194): prepare failed.: status=0x1 my code calls play is: btnplay = (button) findviewbyid(r.id.soundbutton); btnstop = (button) findviewbyid(r.id.stopbutton); mpsound = mediaplayer.create(this, r.raw.a); mpsound.setlooping(false); btnplay.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { //mpsound.start(); uri uri = uri.parse("android.resource://com.test.testing/" + r.raw.a); //toast.maketext(getapplicationcontext(), uri.tostring(), 2000).show(); playsong(uri.tostring()); btnplay.setvisibility(view.gone); btnstop.setvisibility(view.visible); btnstop.setonclicklistener(stopsound);

Java encode string to UCS -

i need encode utf-8 string ucs 'q' '\u0071' or 'é¾¥' '\u9fa5' in java. have tried code wrong result ... new string(inputstring.getbytes("iso8859_1"), "utf-8"); if don't mind apache commons, try: org.apache.commons.lang.stringescapeutils#escapejavastylestring

java - Assigning variable to column with same name as another in a different table from JOIN -

i doing join retrieve data database , assigning variables rs = select.executequery("select pk_task, pointperson, task.scrumid, story.scrumid, product.scrumid [task] " + "inner join [story] on storyid=pk_story inner join [product] on productid=pk_product product.deleted!=1"); to retrieve data: while(rs.next()) { string taskid = rs.getstring("pk_task"); } but how data columns have same name on different tables: while(rs.next()) { long taskscrumid = rs.getlong("task.scrumid"); } results in: com.microsoft.sqlserver.jdbc.sqlserverexception: column name task.scrumid not valid. either use getstring(int) or use task.scrumid task_scrum_id , getstring("task_scrum_id"). prefer latter approach. so, in case, task be string taskid = rs.getstring(3) or query select.executequery("select pk_task, pointperson, task.scrumid task_scrum_id, ... string taskid = rs.getstring("task_scrum_id")

c++ - How to redirect qml's console.log() to cpp stdout -

i using qml( qtcreator ) , cpp (visual studio). usually error messages shown console, both cpp , qml. my requirement should not have console. so wrote window application. but when flag has been set, should launch console. , show corresponding error messages there. i have used following code in function set this. handle handle_out = getstdhandle(std_output_handle); int hcrt = _open_osfhandle((long) handle_out, _o_text); file* hf_out = _fdopen(hcrt, "w"); setvbuf(hf_out, null, _ionbf, 128); // redirecting buffers file handle *stdout = *hf_out; *stderr = *hf_out; //attach std input console handle handle_in = getstdhandle(std_input_handle); hcrt = _open_osfhandle((long) handle_in, _o_text); file* hf_in = _fdopen(hcrt, "r"); setvbuf(hf_in, null, _ionbf, 128); *stdin = *hf_in; this print error log stdout , stderr console. to redirect qt error logs can use. how redirect qdebug, qwarning, qcritical etc output? but how redirect output console.log()

android - No suitable method found to override C# MonoDroid -

'cms_template.picturecallback.onpicturetaken(byte[], android.hardware.camera)' marked override no suitable method found override. i'm trying own onpicturetaken working, i'm getting above error. i'm passing picturecallback argument camera.takepicture. my code: public class picturecallback : java.lang.object, android.hardware.camera.ipicturecallback { public override void onpicturetaken(byte[] data, android.hardware.camera camera) { console.writeline ("onpicturetaken called."); } } ipicturecallback.onpicturetaken method: public void onpicturetaken (byte[] data, camera camera) what missing here? thanks in advance. it not override because implementing method signature in interface rather overriding method in parent class. take override keyword out.

r - Properly Configuring the PI ODBC Client so that RODBC can be used -

i trying use osisoft's pi odbc client. on 64 bit windows 7 machine. because of issues 32 64 bit connecions, osisoft came this workaround. after following directions able see pi-odbc driver in odbc data source administrator , able configure it. problem when open r , use package rodbc error. code used , error generated: > library("rodbc", lib.loc="c:/program files/r/r-2.15.3/library") ch <- odbcconnect("piwhi") warning messages: 1: in odbcdriverconnect("dsn=piwhi") : [rodbc] error: state im014, code 0, message [microsoft][odbc driver manager] specified dsn contains architecture mismatch between driver , application 2: in odbcdriverconnect("dsn=piwhi") : odbc connection failed i'm lost why not working. know setting odbc client worked...a rep osisoft confirmed this. i'm not sure why r isn't able connect it as turns out pi odbc driver 32 bit driver. because using 64 bit version of r,

actionscript 3 - ENTER_FRAME event idle occurrence or was gotoAndPlay called? -

i have mc frame labels jumped through. currently, can detect when starts new label, want able restart actions should current label called gotoandplay() without enter_frame calling 30 times per second. idea how filter out? private function onnewframe(e:event) { if(e.target.currentlabel != _currentlabel) { // started new label (working) trace("new label: "+ e.target.currentlabel); }else if(e.target.currentframe == _currentframe && e.target.isplaying) { // repeated frame (doesn't work) trace("repeated label: "+ e.target.currentframe); } _currentframe = e.target.currentframe; _currentlabel = e.target.currentlabel; } as far understand, need know next 2 things: 1). when movieclip advances next frame new frame label; 2). when next frame has same label previous. first of movieclip doesn't has "isplaying" property. sounds unrealistic,

java - Android: Disable checkboxes without graphical change? -

is possible -subject- ? right if set checkboxinstance.setenabled(false); checkbox gets "disabled graphics", grayed out , more transparent. trying same, need keep checkbox active-looking. the reason have onclicklistener on parent element. works alright seems when checkbox touched, checkbox gets un/checked without firing off listener of parent (and of course fire always). thanks! edit: looking (code in as3, of course there no graphics wouldn't work ...but theory): var s:sprite = new sprite(); var cb:sprite = new sprite(); //let's assume checkbox s.addchild(cb); //cb inside of s addchild(s); //s added display list s.mousechildren = false; s.addeventlistener(mouseevent.click, fireclick); //cb have mouse listener well, nothing happen s.mousechildren set false gosh, easy... setclickable(false) or android:clickable="false" . that's it.

php - I don't know what's wrong with this code SQL -

i'm new php , mysql, reason checks statement if($email == $result2 ) wether input username or email. don't know why? can explain logically, i'm stuck hours figuring out. :( please kind. <?php session_start(); include_once("connect.php"); $email = $_post['email']; $username = $_post['username']; //echo $_post['email']; if(isset($_post['email']) ) { $extract= mysql_query("select username, email users"); $resultq = mysql_num_rows($extract); while($row= mysql_fetch_array($extract)) { $result = $row['username']; $result2 = $row['email']; //$pass = $_post['pass']; if($email == $result2 ) { //check if there entry username echo "email address used!"; exit(); //break; } if ($username == $result ) { echo " username taken!"; //mysql_query("insert users (username, password) values ('$user', &#

Google Maps Javascript - unable to load -

i beginner javascript , trying load simple google map in browser (firefox). however, map not load. below html: <!doctype html> <html> <head> <title>can guess country?</title> <meta charset="utf-8"> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key={my_api_key}&sensor=true"></script> <script src="mapgame.js"></script> </head> <body> <div id="map"> </div> </body> </html> below linked mapgame.js: var map; function initialize() { var mapoptions = { zoom: 8, center: new google.maps.latlng(-34.397, 150.644), maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid('map'), mapoptions); } google.maps.event.adddomlistener(window, 'load', initialize); any appreciated!

How can I include address bar variable in this javascript line? -

can please tell me how can add in address bar variable javascript? the website address reads: www.example.com/index.php?user=74 and javascript needs include 'user = 74' is: xmlhttp.open("get","../profile/" + pagename + ".php",true); function get_query(){ var url = location.href; var qs = url.substring(url.indexof('?') + 1).split('&'); for(var = 0, result = {}; < qs.length; i++){ qs[i] = qs[i].split('='); result[qs[i][0]] = decodeuricomponent(qs[i][1]); } return result; } xmlhttp.open("get","../profile/" + pagename + ".php?user=" + get_query()['user'],true);

jquery - Browser returning HTTP 200 with an empty responseText -

i use following code retry operations return http 502, 503 or 504: /** * @function retrydelayfunction * returns amount of time wait after failure. * * @param {number} retries number of times operation has been retried * @return {number} number of milliseconds wait before retrying operation */ /** * @typedef {object} retryajaxoptions * * @property {number} retries number of times retry failed operation * @param {retrydelayfunction} delayfunction maps failure count delay in milliseconds * @param {array} errorcodes http response codes should trigger retry */ /** * retries http requests using exponential back-off in case of http 502, 503, 504. based on * https://github.com/execjosh/jquery-ajax-retry , http://javadoc.google-http-java-client.googlecode.com/hg/1.15.0-rc/com/google/api/client/util/exponentialbackoff.html * * $.ajax() settings object must contain {@code retry} key enable functionality. * object of type {@link retryajaxoptions} , may used override defaul

android - Click anywhere in EditText to show keyboard -

Image
i trying make hello world notepad app, , have click right on cursor in edittext bring soft keyboard. able click anywhere in edittext show keyboard. here edittext declaration in layout: <edittext android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputtype="text" > </edittext> edit: i using galaxy nexus emulator, , here get: i have click in area above blue marker keyboard. try : <edittext android:id="@+id/text" android:layout_width="match_parent" android:layout_height="match_parent" android:inputtype="text" > </edittext>

php - Perform function after Facebook share -

i wonder if there way confirm user has shared post website, i'm trying have email sent out user after share post. emails collected site, not facebook api. need know if there way call confirmation on sharing system. <a href="#" onclick=" window.open( 'https://www.facebook.com/sharer/sharer.php?u='+encodeuricomponent(location.href), 'facebook-share-dialog', 'width=626,height=436'); return false;"> share on facebook </a> just add new "myfunction(); after first one. onclick="window.open();myfunction();"

perl - automated scripting telnet or portqry -

need advise on how create automate script check connectivity multiple servers 1 server (db) within windows server environment either telnet/portqry , script create .txt file unsuccessful connection thanks in advance claudia take @ ipsentry. we've been using number of years in mixed windows/unix/linux environment , found works well.

java - how to quickly create a test database for Cucumber-jvm? -

i using cucumber-jvm test behaviour of legacy system i'm working on @ work. have use java 1.5 , hibernate 3.3, upgrading not option. since, during tests, stores objects in database, have created new development database. what bothers me have manually drop records (using sql script) everytime i'll rerun tests, or they'll fail. , else wanting run them have same. want , automatically clean test database, either: creating empty database , populating need, or using existing database, droping records before starting tests. what have far: i'm using cucumber-junit plugin, , runtests class redirects test database: @runwith(cucumber.class) @cucumber.options( features = "test/resources/cucumber", format = "html:target/cucumber" ) public class runtests { private static configuration configuration; @beforeclass public static void preparabase() { // gets mapped configuration db configuration = hibernateutil.getco

ios - Assign UIImage to UIImageView between classes -

* i need viewcontroller have copy of image hold onto disappearing after presentviewcontroller dismissed – * i have uiviewcontroller i'm calling presentviewcontroller (modalviewcontroller) xib. inside xib, have uiimageview , can markup marker (draw onto). problem when dismiss presentviewcontroller, variable set (a uiimage ) goes nil , , can't set markup image onto uiimageview on main uiviewcontroller . drawing code: uitouch *touch = [touches anyobject]; currentpoint = [touch locationinview:drawimage]; uigraphicsbeginimagecontext(drawimage.frame.size); [drawimage.image drawinrect:cgrectmake(0, 0, drawimage.frame.size.width, drawimage.frame.size.height)]; cgcontextsetlinecap(uigraphicsgetcurrentcontext(), kcglinecapround); cgcontextsetlinewidth(uigraphicsgetcurrentcontext(), 5.0); cgcontextsetrgbstrokecolor(uigraphicsgetcurrentcontext(), red, green, blue, 1.0); cgcontextbeginpath(uigraphic

mysql - Need Suggestion about google map filtering and saving data to DB -

im starting create project google maps..i have created map own api key..but adding markers bit dizzy me..so, went go , switch 3rd party google map have created maps. is there 3rd party google map can used , there way, on how can connect database.using php , mysql?? anyone suggestion on how?? thank you first need set computer phpmyadmin. there couple of sources can download free. turn computer server. then need spend time google tutorial here . that's first step. cutting corners not down road.... see people prefer json xml. google tutorials bring xml if not mistaken. tutorials never work out of box.... struggle, learn. there tutorials mike williams here . the filter part more complex stuff, can done in end php/mysql or front end @ browser. simple filters part of many tutorials in net (like radius). still trying figure out how complex filters. seems depends on load, speed, etc. brief summary of last 6 months , first 6 months programming. working 80 hours week

asp.net mvc - View Model Identifier -

i attempting started on new asp.net mvc4 project , have few questions regarding view model security. say have class represent application users public class user { public int userid { get; set; } public string name { get; set; } } and class represent tasks application user public class usertask { public int taskid { get; set; } public int userid { get; set; } public string task { get; set; } } my coworker seems think view model representation of usertask class should not contain userid security purposes (to prevent people tampering userid). example public class usertaskviewmodel { public int taskid { get; set; } public string task { get; set; } } i can not life of me find documentation supporting claim , haven't been able straight answer. is common thing? should viewmodel "hide" specific properties view security purposes? understand if data comes model binding tampered with, trying figure out preferred method/best practic

node.js - Sort the list and insert a new column in mongodb -

i need sort states , figure out highest temperature each state in weather data residing in mongodb. how iterate through each record in javascript , insert new column 'month_highest' when figure out highest temperature state ? day time state airport temperature humidity windspeed 1 54 vermont btv 39 57 6 1 154 vermont btv 39 57 4 1 254 vermont btv 39 57 5 1 354 vermont btv 38 70 5 1 454 vermont btv 34 92 11 16 53 florida orl 46 71 9 16 153 florida orl 47 71 8 16 253 florida orl 46 73 8 16 353 florida orl 47 74 8 16 453 florida orl 46 79 7 16 553 florida orl 46 79 5 16 653 florida orl 46 83 4 mongodb map-reduce db.temps.mapreduce( /* map */ function() { emit( this.state, this.temperature); }, /* reduce */ function key(key, values) { var ret = 0; (var i=0; i<values.length, i++) { if (values[i] > ret) ret = values[i]; } return ret

c - Is PellesC strictly-conforming to standard C99? -

i have found in http://en.wikipedia.org/wiki/c99 pelles c has full support c99. have doubts. as know, gcc project has not yet reached full support c99. details in gcc conforming or not documented. however, cannot understand means pelles c conforming. is conforming every computer , operating system? for example, gcc (under command line option -std=c99) compliant iso/iec ieee 60559 (floating point standard) if hardware compliant. http://gcc.gnu.org/c99status.html is pelles c concerned level of detail? don't feel sure claims pelles c c99 conforming. according this article , wikipedia , pelles c has full support c99 (and c11). unless have evidence showing doesn't, think 1 can conforms c99 standard. as support iec 60559 floating-point arithmetic, note it's optional in c99 (and in c11): c99 §6.10.8 predefined macro names the following macro names conditionally defined implementation: __stdc_iec_559__ integer constant 1, intended ind

php - zip file protection on server -

i have zip files in website , made log in system users valid passwords can download zip files once . but there possibility can download zip files directly entering file path in browser address bar. you can link of zip file viewing source code. how can deny people downloading zip files posting file link in browser address bar? possible? instead of placing file in web accessible folder ( /var/www/ example), place above users can't browse (like /var/files ). serve users, after type password, php script, have script set headers if file, , use readfile output contents of file user.

c - strange leading "f" when print out a char -

hi guys, wrote following code: union endian { char a; int b; } test; char c; test.b = 0xaabbccdd; c = (char)test.a; printf("0x%x\n", c); printf("0x%x\n", test.b); printf("0x%x\n", test.a); printf("0x%x\n", (char)test.a); but output is: 0xffffffdd 0xaabbccdd 0xffffffdd 0xffffffdd i want know why there leading 0xffffff before char variable. %x interprets argument unsigned int . integers passed variadic function promoted int , signed char values being promoted signed int s using sign extension, interpreted unsigned int %x . you can work around casting unsigned char or uint8_t .

neo4j - Spring Data @Query on fields -

the @query on property retrieves values if retrieve entity db. @nodeentity public class team { @graphid private long nodeid; @relatedto (type = "previously_known_as") private team previouslyknownas; @query ("start t=node({self}) match t-[:previously_known_as]-other return other") private iterable<team> aliases; } the below test works if uncomment line read explicitly db. why necessary? see query being run after save(t) alias field null if doesn't read db uncommenting line @test public void alias() { team t = new team(); t.setname("alpharetta one"); team prev = new team(); prev.setname("previous name"); teamrepo.save(prev); t.setpreviouslyknownas(prev); teamrepo.save(t); //t = teamrepo.findone(t.getnodeid());//only works if uncomment assertnotnull(t.getaliases()); } try t=teamrepo.save(t); i dont think save operation update pojo give it, while

javascript - jQuery access DOM on https - mixed-content security -

html: <section id="playing" class="gradient"> <div id="playing-header"> … </div> <div id="playing-carousel"> … </div> <div id="playing-info"> <a id="radio-star" class="" href="radio:star"></a> <div id="radio-track-info"> <h2 id="radio-track"> … </h2> <h2 id="radio-artist"> <a class="outgoing"> jay z </a> </h2> </div> <div id="thumb-container"> … </div> </div> <div id="loading" style="display: none;"></div> <div id="loading-throbber" style="display: none;"></div> <div id="station-error" style="visibility: hidden;"> … </div> jquery: alert($('#radio-artist .outgoing').te

spring - How to get mvc RequestMappingHandlerMapping reference in a service? -

my application need aware mapped url's since username, or other resource types dynamically mapped. even been able current mapping, can on controller: @autowired requestmappinghandlermapping handlermapping; public void showhandlersmapping() { map<requestmappinginfo,handlermethod> map = handlermapping.gethandlermethods(); iterator<?> = map.entryset().iterator(); while (it.hasnext()) { map.entry pairs = (map.entry)it.next(); system.out.println(pairs.getkey() + " = " + pairs.getvalue()); } } but have reference in root-context other bean query against it. how accomplish once mvc context gets loaded after root-context? my solution (till now): added @postconstruct controller call apiservice.registerhandlersmapping(handlermapping); i'm not sure drawbacks approach appreciate advice. i can't think of different solution other approach have mentioned of injecting in mappings web layer services la

c++ - ambiguous template pattern matching when using variadic template arguments of function overloads -

this should common situation variadic templates example when tree walking children variadic template arguments. find many related questions , answers either different thing or same thing , did not it. problem. have non variadic tuple this template <class e, class t1, class t2, class t3, etc...> struct x; and overloading functions have specialized behaviour depending on first element of such tuple being pointer type or vector pointer type. works fine if pack template arguments single variadic template argument, overloads become ambiguous. here error message: variadic.cpp:42:17: error: ambiguous overload ‘operator<<’ in ‘std::cout << y’ variadic.cpp:42:17: note: candidates are:... the compiler should prefer x<vector<v*>*,t*...> on x<h*,t*...> when tries match vector<double*>* first element of tuple. i can disambiguate using enable_if , things work again. understand error , if possible find other means enable_if. here code: #inc

function - error: Iso c++ forbids comparison between pointer and integer [c++] -

i'm getting error in title when trying compile. #include <iostream> using namespace std; int chance() { return rand()%11; } int main() { if (chance > 5) cout << "you win." << endl; else cout << "you lose." << endl; return 0; } this full code, i'm attempting have output win or lose, 50-50 you comparing function pointer integer(5) , guess want call chance() function, try if (chance() > 5) ^^

jquery - Make a 3D CSS3 element rotate continously -

i have implemented simple two-sided element rotates y axis using css3 transform: rotatey() property based on examples @ http://css3playground.com/flip-card.php . i can make rotate on hover or set interval, i'm trying make spin continuously. have following script, i'm having trouble "resetting" transform appears spin in 1 direction, far rocks , forth. setinterval(function() { $('.hover').removeclass('reverse').addclass('flip'); settimeout(function() { $('.hover').removeclass('flip').addclass('reverse') }, 1500); }, 3000); i'll spare css, it's same what's on example page. however, .reverse class clone of .flip , values transform: rotatey() try bring start in same direction. you need use keyframe animations. should this. @-webkit-keyframes rotate-full { 0% { -webkit-transform: rotatey(0deg) rotatex(0deg) rotatez(0deg); }

Adding Jquery to WordPress Menu -

i have demo site set located @ http://www.threecell.com/demo . currently, fadein rollover state menu set using css3. i'm hoping assistance using jquery duplicate animation effect site displayable in ie9. i'll honest in saying i'm unsure simplest , best jquery script use seemingly simple this. code attempted use needed on integrating existing wordpress theme. in area appreciated. var hovercolour = "green"; $(function(){ $("a.hoverbtn").show("fast", function() { $(this).wrap("<div class=\"hoverbtn\">"); $(this).attr("class", ""); }); //display hover div $("div.hoverbtn").show("fast", function() { //append background div $(this).append("<div></div>"); //get link's size var wid = $(this).children("a").width(); var hei = $(this).children("a").height();

Android Gmap v2 infowindow click load activity with data based on id of marker -

i have gmap v2 android class populating points on gmap parsing data xml file. xml file contains 3 things want: coordinates name description on marker click want see info window name in it. can that. on infowindow click, want start new activity name , description in textviews. i lost @ how can click on infowindow show new activity description corresponding name. tried creating class called mapmarkers , adding each "entry" it, returns string , cannot figure out how grab title it, still have desc available next activity: public class mapmarkers { private latlng coor; private string title; private string desc; public mapmarkers() { super(); } public mapmarkers(latlng coor, string title, string desc) { super(); this.coor = coor; this.title = title; this.desc = desc; } @override public string tostring() { return coor + title + desc; } public latlng getcoor() { ret