Posts

Showing posts from March, 2014

python - 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server -

i'm having trouble python odbc code. don't following code work: temp=process_query("select fname, lname employee ssn='%s'" %i) known_hours=process_query("select distinct coalesce(hours,0) works_on essn='%s'" %i) temp.append(known_hours) where process_query takes form: def process_query(query): cursor1.execute(str(query)) (process_query continues more merely printing surposes, when i've searched web problem seems problem lies within how call execute function omitted rest of function here). the error receive when i'm trying execute program is: pyodbc.programmingerror: ('42000', "[42000] [mysql][odbc 5.1 driver][mysqld-5.1.66-0+squeeze1-log]you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'john', [decimal('32.5'), decimal('7.5')], 'yes']'' @ line 1 (1064) (sqlexecdirectw)") would grateful if me out! ps. i

database - Button to copy paste in Excel -

ok write words in cells c3 c9. want button copies , pastes 6 blocks cells h3 h9. i did code this. sub save_click() range("c3:c9").copy range("h3:h9").pastespecial end sub but need program register if cells h3 h9 empty or not , if aren't empty should paste cells i3 i9 , if aren't empty should paste in cells j3 j9 , on , on... i found other forums i'm complete noob in , didn't had do. if knows have thankful. you need rely on simple loop; cells makes things easier range letters on it. here have sample code: sub save_click() range("c3:c9").copy dim currange range dim curcol integer: curcol = 7 dim completed boolean: completed = false curcol = curcol + 1 set currange = range(cells(3, curcol), cells(9, curcol)) if (worksheetfunction.counta(currange) = 0) exit end if loop while (not completed) currange.pastespecial end sub

node.js - Update array in mongodDB collection -

building api node/express. i'm having problem updating array inside collection mongodb. want add reference id useritems array in collection user. user looks this: [ { fbname: "name.name", email: "name.name@hotmail.com", username: "mr.name", useritems: [objectid("51e101df2914931e7f000003"), objectid("51e101df2914931e7f000005"), objectid("51cd42ba9007d30000000001")] }]; in server.js: var express = require('express'), item = require('./routes/items'); var app = express(); app.configure(function () { app.use(express.logger('dev')); app.use(express.bodyparser()); }); app.put('/users/:userid/item/:itemid/add', item.adduseritem); query: exports.adduseritem = function(req, res) { var user = req.params.userid; var item = req.params.itemid; console.log('updating useritem user: ' + user); console.log(&

python - How to trigger a write event? -

i know there 'writable' interface indicate there data written. once asyncore loop enters sleep, when no data write, there no chance wake till timeout. this means data can't sent in real time. i tried change 'writable' method return true , resulted in high cpu usage. isn't there solution trigger write event in real time? btw: i'm using python 2.4.3

.htaccess - url rewriting add prefix www with htaccess -

i created website symfony , want rewrite url. url apprears this: domain.com/web/ i removed web/ adding code .htaccess file: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(.*)$ web/$1 [qsa,l] </ifmodule> this worked perfectly. my target add www. prefix. solved adding code: rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] the result ok. in fact, the url domain.com becomes www.domain.com (perfect!!!) the url domain.com/something/ becomes www.domain.com/something/ (perfect!!!) the url domain.com/web/ stays same (it's url not change) is there idea redirect domain.com/web/ www.domain.com ??? thanks... this behavior caused condition existing files won't rewritten: rewritecond %{request_filename} !-f

java - Unexpected Crash Android Sensors -

whenever try run crashes. not know problem be. missing or in wrong place?in logcat says system services not avaliable activities before oncreate. import android.os.bundle; import android.app.activity; import android.hardware.sensor; import android.hardware.sensorevent; import android.hardware.sensoreventlistener; import android.hardware.sensormanager; import android.os.handler; import android.view.menu; import android.widget.*; import android.*; import java.math.*; import java.text.*; import java.util.*; public class mainactivity extends activity implements sensoreventlistener { private final sensormanager msensormanager; private final sensor mrotationvector; public float x,y,z; public mainactivity(){ msensormanager = (sensormanager)getsystemservice(sensor_service); mrotationvector = msensormanager.getdefaultsensor(sensor.type_rotation_vector); } @override protected void oncreate(bundle savedinstancestate) { super

php - Merge multidimesional and associative arrays -

i'm trying merge 2 given arrays new one: first array: array ( [0] =>; array ( [label] => please choose [value] => default ) ) second array: array ( [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 ) i want generate arrays looks this: array ( [0] => array ( [label] => please choose [value] => 14.09.2013 - 27.09.2013 ), [1] => array ( [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 ) ) i tried merge arrays: array_merge($array1,$array2); which results in: array ( [0] => array ( [label] => please choose [value] => default ) [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 ) what appropriate function use-case? if pass in

php - Merging multiple objects -

i have mysql query goes through framework (wolfcms). $sql_query = 'select distinct country ' . $tablename . ' order country asc'; $countries = record::query($sql_query, array()); //execute query but returned array of objects this array ( [0] => stdclass object ( [country] => canada ) [1] => stdclass object ( [country] => france ) ) i wondering if there way php merge object array simple possible like array ( [0] => canada [1] => france ) i know parse array foreach loop once data , create custom array way needed wondering if there way directly data it's final form database. i want simple array use parameter autocomplete function on text field. * edit * i found better way. had avoid executing query record class. here's how //create sql statement $sql_query = 'select distinct country' . ' ' . record::tablenamefromclassname(__class__) . ' order country asc&#

grails - gorm domain class shared property -

i have 4 classes class process { string status } class request { string status = "incomplete" belongsto = [parent: parent] } class response { string status = "incomplete" static belongsto = [parent: parent] } class confirmation { string status = "incomplete" static belongsto = [parent: parent] } then status of request, response or confirmation updated. how can achieve autoupdate process.status status of last updated of other 3 classes ? is there particular grails-way accomplish ? without details on how domains mapped - relationship process request, response , confirmation - i'll assume have access process other domains. with assumption, can use gorm events achieve update process.status on afterupdate event in other domains. for example, in request, response , confirmation, can define like: def afterupdate() { .. //get process how process.status = this.status }

c# - issue attaching/adding an entity object which is detached from the DB Context? -

i new ef , seem have become bit stuck following issue.. i have following situation. two applications using same database, , have both loaded context @ same time displaying same information. application 1 goes , deletes entity , updates database savechanges. application 2 goes , saves same modified entity. we using updategraph recurse through tree , save entities database context. however, when come saving deleted entity, doesn't exist in db context obtained database want add database. i have tried doing add, gives multiplicity error trying add full tree context! any ideas please? the following code snippet updategraph extension method. ( http://github.com/refactorthis/graphdiff ) private static void recursivegraphupdate<t>(dbcontext context, t datastoreentity, t updatingentity, updatemember member) t:class { if (member.iscollection) { // dealing collection var updatevalues = (ienumerable)member.accessor.getvalue

javascript - JSP output to IFrame -

i have posted relative question: java servlet: delete temporary file as per suggestion of @balusc, have been trying implement different, no success. therefore, want ask following: possible "inject" html contents iframe @ runtime? just clarify, working servlets , jsp. have 1 servlet on dopost populates , displays jsp page. page follows: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <script> function disp() { alert(document.getelementbyid('ifrm').contentdocument.documentelement.innerhtml); } </script> <style type="text/css"> html, body, div { margin:0; padding:0; height:100%; } iframe { display:block; width:100%; height:90%; border:none; } </style> <meta http-equiv=

kernel - I/O APIC external IRQ static distribution -

i'm reading ulk3, , got following statement “interrupt requests coming external hardware devices can distributed among available cpus in 2 ways: static distribution irq signal delivered local apics listed in corresponding redirection table entry. interrupt delivered 1 specific cpu, subset of cpus, or cpus atonce (broadcast mode).” i know linux don't use static distribution question is: if os init 1 entry of interrupt redirection table using static distribution, , irq raised , multi-apic system selects 2 of cpus (here, it's example 2 cpus listed in entry) , delivers signal corresponding local apic, , 2 local apics both accept interrupt. just 1 cpu handle interrupt? or both? if one, how select? is there os using static distribution? if yes, please show me example if no, why exist? because of historical issue? original reason of design? here link describe mechanisms of local apic, io apic , icc bus. http://syszux.com/book/kernel/

ruby - Get the last Sunday of the Month -

i'm using chronic last sunday of month of given year. gladly give me n ‌th sunday, not last. this works, not need: chronic.parse('4th sunday in march', :now => time.local(2015,1,1)) this need, doesn't work: chronic.parse('last sunday in march', :now => time.local(2015,1,1)) is there way around apparent limitation? update : i'm upvoting 2 answers below because they're both good, i've implemented in "pure ruby" (in 2 lines of code, besides require 'date' line), i'm trying demonstrate management ruby right language use replace java codebase going away (and had dozens of lines of code compute this), , told 1 manager in 1 line of ruby, , readable , easy maintain. i not sure chronic (i haven't heared before), can implement in pure ruby :) ## # returns date object being last sunday of given month/year # month: integer between 1 , 12 def last_sunday(month,year) # last day of month date = dat

backbone.js - backbone-extend.js doesn't seem to load my method -

i added backbone-extend.js file resides in same folder backbone-min.js... _.extend(backbone.view.prototype, { getformdata: function(form) { var unindexed_array = form.serializearray(); var indexed_array = {}; $.map(unindexed_array, function(n, i){ indexed_array[n['name']] = n['value']; }); return indexed_array; } }); however, when call this.getformdata in view code, method not defined error. missing? help! edit: here view. have uncomment getformdata method make work. can't see getformdata otherwise... define([ 'jquery', 'underscore', 'backbone', 'models/member', 'text!templates/memberedittemplate.html' ], function($, _, backbone, member, memberedittemplate) { var membereditview = backbone.view.extend({ el: $("#page"), model: 'member', initialize: function(args)

android - When can I recycle a Bitmap? -

i'm having serious issues memory, , i'm looking forward recycle bitmaps. however, app doing atm, building gallery (yeah, deprecated) several bitmaps, , then, several galleries. so @ end of day, app looks (linearlayout style): *some webviews *a gallery 7 images. *some webviews *a gallery 10 images and on. so i'm thinking is... once i've displayed images, , them on screen, can bitmaps recycled? is there way recycle whole gallery component? thank much. edit: i've tried soo many things. i'm still getting error java.lang.illegalargumentexception: bitmap size exceeds 32bits this actual code: bitmapfactory.options bfoptions=new bitmapfactory.options(); bfoptions.indither=false; //disable dithering mode bfoptions.inpurgeable=true; //tell gc whether needs free memory, bitmap can cleared bfoptions.ininputshareable=true; //which kind of reference used recover bitmap data after being clear, when used in futu

asp.net mvc 3 - Returning a .csv file error on prod, but not on test -

we have system in asp.net mvc3 , running on iis7. my controller looks this: public actionresult display(string reportid) { string fullname = service.initiategistaxjurcsvgeneration(); string filename = path.getfilename(fullname); return file(fullname, "text/csv", filename); } the service creates , saves .csv file users local windows temp directory. next 2 lines of code return file user in browser can downloaded. the download of file works fine on local web server (the 1 build visual studio). have test environment , production environment. on same server , instance of iis. test , prod different websites on same instance of iis. returning file works fine our test website, prod website returning code http500. this makes me think there has setting somewhere in iis server different between 2 different websites (prod , test). cannot find different between two, knowledge of iis not deep. there can think of may have missed possibly cause proble

python - Making a second address in Django -

i have code: class vendorprofile(models.model): name = models.charfield(max_length=256) address = models.charfield(max_length=256) address2 = models.charfield(max_length=256) is there better way address line2? reason have address2 because apartments have line of address. there better way this? need thinking power, feel doing better way.

javascript - Making a Session service available to my SessionsController in AngularJS -

this matter of me not handling dependency injection proper, i'm trying make 'session' service available sessionscontroller. here's sessionscontroller: angular.module('app.controllers').controller('sessionscontroller', ['$scope', '$location', '$cookiestore', 'session', function($scope, $location, $cookiestore, session) { $scope.foo = function() { console.log("clicked foo.."); } $scope.session = session.usersession; $scope.create = function() { if ( session.signedout ) { $scope.session.$save() .success(function(data, status, headers, config) { $cookiestore.put('_app_user', data); }); } }; $scope.destroy = function() { $scope.session.$destroy(); }; }]); here's actual session service definition: angular.module('app.services').service('session',[ '$cookiestore', 'usersession', 'userregistr

tags - Netsuite Show Purchase Order in Email Template -

i trying show customer's purchase order number in order-fulfilled email template. it's own template design standard tags netsuite provides. i sent them ticket asking if have tag that, , apparently not. said feature in unavailable. is there way can put code email template when customer reads email, can view purchase order number? that's our customer's #1 question in regards calls purchase order is. can out. i'm new netsuite still not know how code around or create new tag. should work - live version use. said, nltranid...but our po reference them our internal number...your client wants clients' reference po numbers b2b transaction transparency. to: <nlbilladdress> sending purchase order no <nltranid> pdf attachment try 1 too: <nlotherrefnum>

c - Hotmail/Outlook.com connection failure on AUTH commands -

i'm working on embedded application (running mqx rtos, written in c) has smtp functionality. recently, tls support added using mocana nanossl library. i'm able send emails using gmail, yahoo, , private exchange servers. unfortunately, hotmail not work. here's connection parameters i've used: server: smtp.live.com port: 25 , 587 auth method: plain , login basically, i'm able connect server, perform ssl/tls handshake (using starttls), , send encrypted ehlo message server (receiving response). according response, server supports both auth plain , auth login. however, once send either of these commands, following ssl_recv() call make response fails either timeout or connection reset peer . update: ok, after experimentation appear issue lies @ ssl library level , not microsoft's smtp server. tried replacing ssl_recv() calls standard rtcs socket recv() calls , able receive , view encrypted data. disabling response verification, able continue thro

regex - How negative lookbehind works in below example? -

why on applying regular expression(rx) on data(d) gives output(o) ? regular expression (rx): s/(?<!\#include)[\s]*\<[\s]*([^\s\>]*)[\s]*\>/\<$1\>/g data (d): #include <a.h> // 2 spaces after e output (o): #include <a.h> // 1 space still there expected output is: #include<a.h> // no space after include the condition (?<!\#include) true you've passed first of 2 spaces, therefore match starts there. #include <a.h> ^^^^^^- matched regex. that means space not removed replace operation. if use positive lookbehind assertion instead, desired result: s/(?<=#include)\s*<\s*([^\s>]*)\s*>/<$1>/g; which can rewritten use more efficient \k : s/#include\k\s*<\s*([^\s>]*)\s*>/<$1>/g;

c# - Getting Ptr Value of a Function -

i have api function in application: <runtime.interopservices.dllimport("kernel32.dll", setlasterror:=true, charset:=runtime.interopservices.charset.ansi, exactspelling:=true)> private shared function getprocaddress(byval hmodule intptr, byval procname string) intptr end function i want learn pointer 'intptr' value of function. how can it? note: show exact thing want in c++ void* fngetprocaddress; fngetprocaddress = getprocaddress; well, can continue using p/invoke... (note, in c#, convertible) [system.runtime.interopservices.dllimport("kernel32.dll")] public static extern intptr getprocaddress(intptr hmodule, string procname); [system.runtime.interopservices.dllimport("kernel32.dll")] public static extern intptr getmodulehandle(string modulename); var hmodule = getmodulehandle("kernel32.dll"); var procaddress = getprocaddress(hmodule, "getprocaddress");

Android V7 Support Library Popup Menu -

i'm trying implement popupmenu support v7 library. compiles fine when try call: popupmenu popup = new popupmenu(this, v); popup.getmenu().add(menu.none,menu_share_a,1,r.string.a); popup.getmenu().add(menu.none,menu_share_b,2,r.string.b); popup.show(); an error occurs on call: 07-31 17:23:53.365: e/androidruntime(14128): java.lang.runtimeexception: binary xml file line #17: must supply layout_height attribute. which refers think "abc_popup_menu_item_layout.xml" element: <android.support.v7.internal.view.menu.listmenuitemview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="?attr/dropdownlistpreferreditemheight" android:minwidth="196dip" android:paddingright="16dip"> is bug or do wrong? you might want check if have appropriate theme specified in manifest file: &l

jquery - How to paste image in chrome, then upload it to a server with PHP -

i want upload image server. achieve this, want user paste image chrome (the image print screen in fact), , post stream php page, convert stream image, , upload it. how can achieve web application ? today have develop differents parts : used this script , , create upload.php page gets post variable , try create , image. the problem have, when post data, blob. base64 stream. can me ? in advance. i'm not sure why looking "base 64 stream". if sending blob server via ajax, far server concerned, it's file. treat no different other upload server-side. blob file without name property. that's perhaps bit overly-simplistic, point that, again, nothing more file far server knows. assuming sending multipart-encoded request, i'd point out user agents set filename property of item's content-disposition header in request "blob" when item uploading blob instead of file. possible change value in some browsers via 3rd argument in

google app engine - How to flip to previous page with ndb cursors? -

i cant manage 'previous page' in ndb paging. i have checked documentation , similar question here without success. def show_feedback(kind, bookmark=none): """renders returned feedback.""" cursor = none more_p= none if bookmark: cursor = cursor(urlsafe=bookmark) q = feedback.query() q_forward = q.filter(feedback.kind==feedback.kinds[kind]).order(-feedback.pub_date) q_reverse = q.filter(feedback.kind==feedback.kinds[kind]).order(feedback.pub_date) feedbacks, next_cursor, more = q_forward.fetch_page(app.config['feedback_per_page'], start_cursor=cursor) if cursor: rev_cursor = cursor.reversed() feedbacks2, prev_cursor, more_p = q_reverse.fetch_page(app.config['feedback_per_page'], start_cursor=rev_cursor) next_bookmark = none prev_bookmark = none if more , next_cursor: next_bookmark = next_cursor.urlsafe() if more_p , prev_cursor:

Android list usb devices -

hy out there try list usb devices connected android tablet. use https://play.google.com/store/apps/details?id=hu.sztupy.android.usbhostcontroller&hl=en check if device decteds usbkeyboard , yes on both tablets , tastatur working on both tablets. code looks like usbmanager musbmanager; musbmanager = (usbmanager) getsystemservice(context.usb_service); musbmanager.getdevicelist(); hashmap<string, usbdevice> devicelist = musbmanager.getdevicelist(); iterator<usbdevice> deviceiterator = devicelist.values().iterator(); this.outputtext.append(devicelist.size()+"geräte gefunden"); this.outputtext.append(musbmanager.tostring()); usbdevice device=null; while(deviceiterator.hasnext()){ device = deviceiterator.next(); this.outputtext.append( device.getdevicename()+" vendorid: "+device.getvendorid()+" productid"+device.getproductid()); } the strange th

jquery - How to properly call Javascript Function from Gridview Selected Index Changed -

i have user control --> aspx page--> master page scenario. user control contains gridview. want able call javascript function when gridview "select" linkbutton clicked. i able work first time linkbutton clicked, every other subsequent click fails call javascript function. i registering javascript function using asp.net scriptmanager/scriptmanagerproxy method - proper way use jquery when using masterpages in asp.net? any ideas on why fails after first try? without code i'm not sure implementation, here's i'd do: linkbutton , button has onclientclick property can set call client-side javascript before running postback. don't have access when using commandfield . first, convert commandfield (the 1 select button) templatefield . should given linkbutton or button , can set onclientclick property for. i think lot simpler doing registerscripts, etc.

How do you clean up three.js (or WebGL) on page refresh -

we have extensive three.js application using quite few materials, scenes, render buffers etc. refresh/restart couple of times , fail on 1 of several issues; of amounted running out of webgl resources. i have added cleanup routine on window.onbeforeunload, calls dispose() methods on objects support it; materials, renderbuffers , geometries. i'm not convinced have caught resources; seems have been enough have been able refresh every 5 seconds half hour. the questions are: [1] best way trigger such cleanup? window.onbeforeunload seems quite effective, maybe there reason choose alternative? [2] best way perform such cleanup? have dispose on renderer cleaned webgl resources. (i'm not concerned javascript objects, browser seems quite capable of cleaning up.) i have seen related questions here; eg on cleaning scenes, interested in complete cleanup. guess answer @ lower webgl level work global cleanup; might not three.js resources wouldn't able work out scope of

window - Send parameter to an already open foxpro program -

i have program i've made in visual foxpro , can open parameter. shortcut properties: target: c:\data\test.exe "5035246" that opens program , opens form i've created , shows me info id 5035246. now if want open different id shortcut (while first window still open) opens instance of program, want open in open program (and later change displaying id in form). so how can send parameter open program? edit: have found code checks if instance of exe running , if quits, not solve other question; pass parameter open program. if want send multiple signals executing foxpro program outside source, need either utilize com reference object, or can instead use intermediary data store (dbf, txt file) program checks on regular basis. the best solution, if have use foxpro, have commmand-line program job accept arguments, obtain refernce seperate, main exe, , send programs. following: parameters tcarg oapp = getobject("yourapp.mainclass") oapp.se

intl - Why can't PHP on Windows see extension php_intl.dll even though it exists? -

i've been trying intl extension working on test workstation (php 5.5.1, apache 2.2.4, windows 7 32-bit). seems no matter try can't , running. i've uncommented line "extension=php_intl.dll" in php.ini. i've verified extension_dir directive pointing @ correct directory (c:\wamp\php5.5\ext). i've verified php_intl.dll in c:\wamp\php5.5\ext. i've verified icu*.dll files present in php root directory (c:\wamp\php5.5). i've verified c:\wamp\php5.5 in path. and yes, copy of php.ini i'm editing correct one, 1 specified phpinidir directive in httpd.conf. i've checked apache error log , found line every time i've restarted apache: php warning: php startup: unable load dynamic library 'c:\wamp\php5.5\ext\php_intl.dll' - specified module not found.\r\n in unknown on line 0 i repeat myself, c:\wamp\php5.5\ext\php_intl.dll exist! i'm tempted try pointing @ windows explorer , shouting @ computer, "look! stinkin&#

angularjs - Can't run angular app -

i'm trying run angularjs page. i've created controller not work. i've reduced code as can spot problem can't found it, there 2 files: index.html <html np-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="main.js"></script> </head> <body ng-controller="runmectrl">{{hi}}</body> </html> main.js function runmectrl($scope) { console.log('running!!!'); $scope.hi="asjklfdkajsfkl"; } console.log('script loaded'); the console logs script loaded , controller not invoked , don't know why. page displays "{{hi}}" in browser. no error shown. any idea? update: angularjs loading correctly since can found angular object on javascript console: > angular object {element: function, bootstrap: function, copy: function, extend: function, equals: funct

c++ - how to parse the following file -

i have little issue transfer python code c++ have file format like: ============================== there 0 element ============================== there 62 element 1vtz0 13 196 196 13 196 196 184 2520 2buka 1 1vtz0 1 195 1vtz1 13 196 196 13 196 196 184 2520 2buka 1 1vtz1 1 195 1vtz2 13 196 196 13 196 196 184 2350 2buka 1 1vtz2 1 195 1vtz3 13 196 196 13 196 196 184 2470 2buka 1 1vtz3 1 195 1vtz4 13 196 196 13 196 196 184 2560 2buka 1 1vtz4 1 195 1vtz5 13 196 196 13 196 196 184 2340 2buka 1 1vtz5 1 195 1vtz6 13 196 196 13 196 196 184 3320 2buka 1 1vtz6 1 195 1vtz7 13 196 196 13 196 196 184 2820 2buka 1 1vtz7 1 195 1vtze 13 196 196 13 196 196 184 2140 2buka 1 1vtze 1 195 what want skip line ===================== there 0 element . in original python code need use if condition: if (not "=====" in line2) , (len(line2)>30):

html - Browser scrollbar not appearing -

i have problem browser scrollbar doesn't appear when web content extends beyond browser window. i'm pretty sure problem located in container div , not footer, removing footer doesn't change anything. suggestions? here's html part. <html> <head> <link rel ="stylesheet" type="text/css" href="style.css"></link> <style> body {background-color:#64b6b1;} </style> </head> <body> <div id="container"> <div class="box"> </div> <div class="box"> </div> <div class="box"> </div> <div class="box"> </div> <div class="box"> </div> </div> <div id="footer"> <div class="icon"><h2>ab</h2></div> <ul> <li><a href="webdesign.html"><div class="webdesign" style=&q

php - Bulk Email using form not working -

i trying send bulk email gmail using php in address,to address , message set form. not working..shows error mail.php <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>phpmailer - gmail smtp test</title> </head> <body> <?php date_default_timezone_set('etc/utc'); require '../mail/class.phpmailer.php'; $mail = new phpmailer(); $mail->issmtp(); $mail->smtpdebug = 2; $mail->debugoutput = 'html'; $mail->host = 'smtp.gmail.com'; $mail->port = 587; $mail->smtpsecure = 'tls'; $mail->smtpauth = true; $mail->username = "username@gmail.com"; $mail->password = "passwrd"; $mail->setfrom("$_post('from')","$_post('from_name')"); $mail->addreplyto("$_post('from')","$_post('from_name')"

javascript - On Check one input gets disabled and the other gets enabled -

i'm coding form gets value search process .. i'm coding 2 text fields user give input on 1 of them.but 1 of them enable @ time .. user can chose option checking check box. default 1 of field should b enable, when check-box checked it(the 1 enable) gets disabled , other gets enabled, , vice versa when check-box unchecked. here is fiddle: http://jsfiddle.net/awbvq/224/ this fix problem html : <input type="text" name="" /> <input type="checkbox" name="" /> <input type="text" name="" disabled="'disabled'"/> js : $(':checkbox').change(function(){ if ($(this).is(':checked')) { $(this).prev().attr('disabled','disabled'); $(this).next().removeattr('disabled'); } else { $(this).next().attr('disabled','disabled'); $(this).prev().removeattr('disabled'); } });

java - What type of line delimiters does wsimport use? -

i working on client application using eclipse , having kinds of problems committing, merging, comparing, etc. cvs (i know cvs bad). i'm thinking since on windows running issues line delimiters. our cvs server runs on windows (again know, comments welcome show our current dev environment broken , i'm not blowing smoke here). currently of our projects using cp1252 windows style delimiters. change default text file encoding utf-8 , unix style delimiters, , wonderng if has gone through transition comment. also, since use wsimport create our client web services trying figure out type of line delimiters uses. 1 know? thanks, jd since write java source codes, wsimport use instance of java.io.printwriter , , each line write method java.io.printwriter.println , depends of enviroment. import com.sun.tools.internal.ws.wsimport; public class main { static { system.getproperties().put("line.separator", "\n"); \\ or "\r\n"

perl - Regex find a substring in a string containing a pattern -

so if string $a = "blah bluh bu.du" check if string has du in using: if( $a =~ /\.du+/) now confirmed string has ".du" in it. how can word budu saved new string $b? using perl sorry, du supposed file extension surround part want capture in parenthesis. if( $a =~ /([a-za-z]*?du[a-za-z]*?)/){ if ( defined $1 ) { $word = $1; print "$word\n"; } }

javascript - console.log not showing expected object properties -

i have following code in javascript in node.js application. objects not stored in variable appointment . if set them, when directly access them works: console.log(appointment.test); what have done wrong in code? var appointment = { subscribed: false, enoughassis: false, studentslotsopen: false }; console.log(appointment); (var key in appointmentsdb[i]) { appointment[key] = appointmentsdb[i][key]; } appointment.test= "res"; console.log(appointment.test); console.log(appointment); and here produced output: { subscribed: false, enoughassis: false, studentslotsopen: false } res { comment: 'fsadsf', room: 'dqfa', reqassi: 3, maxstud: 20, timeslot: 8, week: 31, year: 2013, day: 3, _id: 51f957e1200cb0803f000001, students: [], assis: [] } the variable console.log(appointmentsdb[i]) looks as: { comment: 'fsadsf', room: 'dqfa', reqassi: 3, maxstud: 20, timeslot: 8, week: 31, year:

php - use preg_replace to replace whole words using associative array -

i have replacement array named $initialdata : array ($initialdata) 'd' => string '1.40' (length=4) 'a' => string '1.67' (length=4) 'vi' => string '0' (length=1) 't' => string '?' (length=1) then have string : $str = "-(vi + sqrt(2*a*d + vi^2))/a)"; when : str_replace(array_keys($initialdata),array_values($initialdata),$str); i : -(0 + sqr?(2*1.67*1.40 + 0^2))/1.67) what happened "t" of "sqrt" replaced value of "t" on $initialdata array. know happens because i'm using str_replace , , need match whole words using preg_replace , never saw implementation of preg_replace using associative arrays match whole word. how can achieved if possible? in regex, \b word boundaries. should work: $data = array( '/d/' => '1.40', '/a/' => '1.67', '/vi/' => '0', '/\bt\b/'

angularjs - ng-animate slide animation misaligned -

i've got working (animation) doesn't pretty. when animation/slide triggered. "leaving" slide pops left of screen , hugs "entering" slide. it overshoots endpoint during animation snaps back. ng-animate css follows: css : .slide-leave, .slide-enter { -webkit-transition: 5s linear all; /* safari/chrome */ -moz-transition: 5s linear all; /* firefox */ -o-transition: 5s linear all; /* opera */ transition: 5s linear all; /* ie10+ , future browsers */ /* animation preparation code */ opacity: 0.5; } .slide-enter { position: relative; left: -100%; } .slide-enter.slide-enter-active { left: 0; opacity: 1; } .slide-leave { opacity: 1; } .slide-leave.slide-leave-active { position: relative; opacity: 0; left: 100%; } here's semi-working plunkr. notice "leaving" view hugs "entering" view. can animation started pressing black square in header. http://plnkr.co/edit/fg44cpj65s4gr6qzpm1x?p=preview

Microsoft Visual Studio 2005 has stopped working? -

Image
crashes on startup of vs2005 or vs2005 project. not sure has changed... other our departement keeps doing updates... still no clue why? problem signature: problem event name: appcrash application name: devenv.exe application version: 8.0.50727.42 application timestamp: 4333e699 fault module name: stackhash_b07c fault module version: 0.0.0.0 fault module timestamp: 00000000 exception code: c000041d exception offset: 777e1221 os version: 6.1.7601.2.1.0.256.49 locale id: 1033 additional information 1: b07c additional information 2: b07c9f334ed23629f31261200e2152db additional information 3: c5e2 additional information 4: c5e2938eff61fd2d71b1da696b2907b3 read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 if online privacy statement not available, please read our privacy statement offline: c:\windows\system32\en-us\erofflps.txt tried debugging , this:(and cycles original

c# - Wix: How far can I go with custom action? -

i want build wix installer detect few programs of mine , update them. i have c# code (using dll) check few things on system, want download table of recent version of apps, decide app need update, , download & update selected ones. so question is, can wix preform following actions: 1) run dll call using c#? 2) download file web , parse (let's - using c#)? 3) go link , download msi\exe? 4) install msi\exe (let's run on silent mode)? 5) uninstall old other apps system? 1) yes keep in mind if have dependency on .net 3.5 , on box .net 4 custom action not able run. besides custom action dll unpacked msi %temp% folder. if have dependency other dlls not stored in gac fail load. if bring in e.g. c++ dll have embed resource in c# dll , unpack find it. 2) can whatever have rights for. 3) sure 4) 1 msi installation can run @ 1 time. have spawn child process wait until current installation over. 5) yes sure. easiest way add upgrade table msi unin

java - The Necessity of dispatching simple events with the EDT -

before go on discussing basic query first state aware of question being against standards of awt/swing framework. query meant merely academic experience , should (hopefully) never applied real world applications. the awt/swing framework built upon event based model uses single thread dispatch events. awt/swing related events events must processed on event dispatcher thread (edt) , custom events programmer has programmed must queued through functions invokeandwait() , invokelater(). while model ensures framework never suffers sort of thread concurrency issues gives big pain programmers trying write code around (search swing issues on stackoverflow... quite handful). however... years ago, before got more familiar awt/swing model , edt used write code violates many many java standards (code that'll make reasonable programmer recoil in horror). 1 of these standards violated calling methods updated gui through thread thats not edt. precise standard "long" task resided

html5 - schema.org - q&a website markup -

i'm using rich snippets on of websites now, schema.org. have 1 site has lot of question , answer type content, , decided try tagging up... haven't found examples of snippets seem applicable kind of structure. since there quite lot of q&a content on web, i'm curious if i'm overlooking tagging or if not included in spec? there isn't in schema.org q&a sites there a proposal add schema support them. i'm curious, sort of structured data want surface site , how envision showing in search? i'm working on updated proposal , i'll post w3c public-vocabs list soon.

d3.js - D3.Geo.Circle with Canvas -

i'm using d3 create mercator projection using canvas rather svg. i've got path of land working can't work out how (if possible) add d3.geo.circle @ specific long/lat positions. if svg i'd use like var group = svg.append('g'); group.append('circle') .attr('cx', coords[0]) .attr('cy', coords[1]) .attr('r', 10) .style('fill', 'red'); but can't work out how translate canvas , i'm not finding in way of resources d3 using canvas rather svg. any suggestions? you have create manually using canvas arc command: var coords = [50, 50]; var r = 10; ctx.beginpath(); // make arc 0 math.pi*2, aka full circle ctx.arc(coords[0], coords[1], r, 0, math.pi*2, false); ctx.fillstyle = 'red'; ctx.fill(); live example: http://jsfiddle.net/9kmv3/ edit: appears mean expressing latitude , longitude appropriate transformation on canvas, have @ instead: var coords = [47.61, -122.33];

scala - Building Inverted Index exceed the Java Heap Size -

this might special case after pounding on head while thought stackoverflow community. i building inverted index large data set (one day worth of data large system). building of inverted index executed map reduce job on hadoop. inverted index build of scala. structure of inverted index follows: {key:"new", productid:[1,2,3,4,5,...]} these written in avro files. during process run java heap size issue. think reason terms "new" showed above contain large number of productid(s). have a, rough idea issue take place in scala code: def toindexedrecord(ids: list[long], token: string): indexrecord = { val javalist = ids.map(l => l: java.lang.long).asjava //need convert scala long java long new indexrecord(token, javalist) } and how use method (it used in many locations same code structure , login use) val titles = textpipedump.map(vf => (vf.itemid, normalizer.customnormalizer(vf.title + " " + vf.subtitle).trim)) .flatmap {

cordova - Initialising fastclick with requirejs -

i use requirejs fastclick. following error: uncaught typeerror: cannot set property 'trackingclick' of undefined in fastclick.js line 30 does: this.trackingclick = false; in config.js run app.js: require.config({ paths: { fastclick:'fastclick' } )}; require(['app'], function (app) { app.initialize(); }); in app.js do: define(['fastclick'], function(fastclick){ var app = { initialize: function () { var attachfastclick = require('fastclick'); attachfastclick(document.body); } } return app; } the browser starts fine , in debugger fastclick library instantiated , resolved still this in fastclick.js cannot resolved. i tried fastclick(document.body); did not seem have effect. any ideas? looking through fastclick code found following functions works: fastclick.attach so, instead of calling: var attachfastclick = require('fastclick&

widget - ASP.NET MVC toolkit -

i coming desktop dev background, wpf/slight, , looking @ switching mvc application. given absolutely rubbish @ making stuff "pretty" best toolkit/widgets invest in me on way? looking ease of use; ui , feel; price? i have experience following control toolkit. jquery jquery ui : http://jqueryui.com/ free , open source. lot of community support, lot of plugin extend. have more control on plugins , code. light. have extensively use several mvic projects , recommend. mvc controls toolkit . : http://mvccontrolstoolkit.codeplex.com/ - free , open source code plex projects can use mvc application. devexprss mvc extension . http://mvc.devexpress.com/ : commercial product necessary control mvc application. learning curve bit high. can nice application easily. customization difficult. have support technical issues. have use projects. kendo ui : http://www.kendoui.com/ commercial product telerik. haven’t use in commrical project seems good.

automation - Code Editor for IEC61131 -

i automation engineer , work beckhoff (structured text) , thinking if there way create "custom language" in of code editors, can minimize repeating of syntax , reduce minor syntax errors missing semi-colon @ end of line. i have seen fair few number of code editors, , quite amazingly beautiful ones, night mode editors , great support used languages. love use them since lack support twincat or structured text, feel missing out. any or advice if possible great. thank :) i don't know it helps, because question asked in july... i'll give try... unfortunately beckhoff uses codesys ide editing twincat 2.x plc-programs. new twincat 3.x, beckhoff switched microsoft visual studio 2010 (and 2012) ide. there lot more features added language (iec61131-3) example object oriented programming. these features supported in new ide , code editing features lot better old were... as advice can give 1 change twincat 3.1. can download beckhoff website (www.beckhoff.co

web deployment - How is deploying a django application easier when app was developed in Linux? -

i've heard few people deploying apps easier when use linux. starting develop app using django (and python) , want know, easier me deploy app when used linux os when developing app? if yes, how? how process of deploying django app developed in windows different process of deploying django app developed in linux? most due fact servers hosting python/django linux, developing in similar os can make life easier. develop in environment. being easier because there less os-related differences between linux , server linux. why suggested have staging server, can work out os-related differences on server before move production. the main "gotchas" of os-differences can be differences in default paths libraries/packages certain packages/libraries may not have readily available windows binaries other stuff... i'm sure there more. you code in online ide cloud9 let work in browser , directly on machine going deploy to.

tfs2010 - Require a file to be checked in / merged in to two places in TFS 2010 -

we have our development branch has multiple revisions of our code. looks like: development r1.0 r2.0 r3.0 rx we working on multiple releases simultaneously. so, team work on r2.0 while team b work on r3.0. while team making changes in r2.0, need make sure these changes reflected in r3.0. there way require developer check in file r3.0 if he/she attempting check file in r2.0? edit 8/1/2013 after reading several articles on branching , merging strategies, have idea of how should approach issue. want run , ask if i'm headed in right direction. so, instead of having development branch , copies of releases, should have main (development) branch, , branch off of each release. then, defined in our branching , merging strategy, merge changes in our r1.0 , r2.0 branches main. , when want work on r3.0, fresh merge of r1.0 , r2.0 main, , create new branch main. then, need hotfix r1.0, create r1.1 r1.0 , merge r1.0 main, main r2.0 , r3.0. work o

java - Hadoop. How to get Job from Mapper -

i'm new in hadoop. time i'm realising word counter inputted keyword. read using job class better jobconf . have code main class: ... configuration conf = new configuration(); conf.set("keyword", args[0]); job job = new job(conf); ... so how can keyword in mapper back? understand need job object , job configuration object using getconfiguration() method , call get("keyword") method. but how need job mapper class? thank's time. when map called on mapper implementation passed context object exposes getconfiguration method. give want.