How to get perpendicular vectors given a line segm

Question:How to get point A, B , C, and D?if AB and CD are perpendicular to p0p1.Assume p0A, p0B, p1C, and p1D have normalized lengthAnswer1:The direction of the line is given by d = normalize(p1 - p0). To calculate a perpendicular vector we can use the c

How to get perpendicular vectors given a line segm

Question:How to get point A, B , C, and D?if AB and CD are perpendicular to p0p1.Assume p0A, p0B, p1C, and p1D have normalized lengthAnswer1:The direction of the line is given by d = normalize(p1 - p0). To calculate a perpendicular vector we can use the c

Python TypeError: sequence item 0: expected str instance, NoneType found

:I copied this code from a book:lyst = {'Hi':'Hello'}def changeWord(sentence): def getWord(word): lyst.get(word, word) return ''.join(map(getWord, sentence.split()))I get this error:Traceback (most recent call last): File "

Reading function from a file in Fortran 90

:I have an optimization solver in Fortran 90. So, if I want to change the objective function I have to modified the main file and write the objective function in this way: subroutine fobj(n,x,f) implicit none integer :: n real(8) :: f real(8)

executing a .class from a java file with java commands in it

:import java.io.*;public class chk {String command;public String getMsg(String fileName,File Path1) { String dir,name=" "; int x; x=fileName.indexOf(".class");name=fileName.substring(0, x); command ="java " + name +" < C:\\iptest\\

Why Function declaration needed in this? [duplicate]

: This question already has an answer here: Implicit function declarations in C 6 answers Code:#include int navin(); //function declarationint main(){ int i = na

Wait until fs.readFileSync is done

:In my file functions.js i have two functions:var email, url1function getFile(_callback){ email = fs.readFileSync("C:/Emails/" + items[2]) _callback(email); }function getUrl(){ getLatestMail(function(email) { email.split(/\n/).fo

Pop Under on Click for RSS Feed - Javascript

:I want to set up the site so when users click on RSS feed links (which I display in part of the site), the feed link appears in a pop under. It makes sense on the site. It's something my users want.What I can't figure out is how to populate the rss l

500 Internal Server Error on XHR Request

:Here is my code:var fd = new FormData(document.querySelector('#form-step1'));var xhr = new XMLHttpRequest();xhr.open('POST', '/Handlers/newAccount_handler.php', true);xhr.send(fd); // this line is causing a 500 Internal Server Error and the data is

Zend Framework2 using Zfcuser & Bjyauthorize routing

:I'm a beginer zend framework programmer. I did use ZfcUser for authentification and Bjyauthorize for authorization. I have to type of users : normal users and administrator . So what i want to do is to route the user to page A and admin to page B after

perl: using push() on an array inside a hash

:Is it possible to use Perl's push() function on an array inside a hash?Below is what I believe to be the offending part of a larger program that I am working on. my %domains = ();open (TABLE, "placeholder.foo") || die "cannot read domtblout file\n"

Getting the number of documents returned to from a viewEntry

:I have a panel on which I have defined a Domino view and called it viewEntry and attached it to a view in the current database. In the Data definition I have it set to filter by Category Names, all of which it does very nicely. Now I want to know how man

AttributeError: 'module' object has no attribute 'startfile'

:Trying to run this program, I got this error:Traceback (most recent call last): File "piltk.py", line 84, in os.startfile(filename)AttributeError: 'module' object has no attribute 'startfile'How to fix this ? 1:On Linux you can use:

Chrome developer tool Array length [duplicate]

: This question already has an answer here: Is Chrome's JavaScript console lazy about evaluating arrays? 6 answers Why chrome developer tool showing 0 array length (first lin

Psycopg2 under osx works on commandline but fails in Aptana studio

:I have been developing under Python/Snowleopard happily for the part 6 months. I just upgraded Python to 2.6.5 and a whole bunch of libraries, including psycopg2 and Turbogears. I can start up tg-admin and run some queries with no problems. Similarly, I

Has Many Through two models

:I have two models of importance here. There's more models interacting with them too, but only these should be relevant.class Image < ActiveRecord::Base belongs_to :user belongs_to :tripendclass Mission < ActiveRecord::Base belongs_to :user belongs_t

Python: Passing coordinates from text file to Turtle

:I have a test file that has coordinates on it my aim it to create a function that takes the text file and turns it into coordinates to plot in turtle to draw an image:river, 5500, 500-500, 360400, 500shadow, 4500, 3005, 500300, 400so far I have the follo

unexpected T_ELSEIF [closed]

:$pages = array("grac", "zamknij", "dolaczyc");$pagesid = array("showNews", "showThread", "showProfile");foreach ($pagesid as $page) { if (isset($_GET[$page])) { include('sobra/'.$page.'.php'); }}// just pageselseif (in_array($_GET['pa

ActiveStorage big file uploads triggers Google::Execution::Expired

:While implementing ActiveStorage at work we found out that when uploading big file, 12GB , the operations hangs for about 10 minutes and the I get the error Google::Execution::Expired or sometimes HTTPClient::SendTimeoutError: execution expired.I am run

How to fill a vector of lists?

:I'm trying to put ascii codes and names into a vector of lists: So ideally what it would be like is this:97: "awesome", "all"98: "best" , "boom", "bomb"99: "cat"I haveclass index_table{public: index_table() { table.resize(128);} void ins

CodeIgniter + Smarty = Error

:Here's what I did:Downloaded and unzipped CIDownloaded and unzipped Smarty in /application/libraries/Smarty-3.1.4Saved https://github.com/kzhiwei/codeigniter-smarty/blob/master/application/libraries/Smartylib.php to /application/libraries/Smartylib.php

.htaccess stopping URL Parameter

:I'm having issues with passing a parameter over the url and I think it is related to the .htaccess file. This page:site.com/apprenticeships/current_vacancieshas a link to this page:site.com/apprenticeships/current_vacancies?id=1on the page I have:$id =

Detecting shapes in a “bitmap”

:So,preparing myself for the next ieextreme competition I was going through some past problems.I found one that really troubles me,since I can't figure out what to do.I could probably make it using some bruteforce 300 lines code,but I think that this is

How to prevent a style sheet in qgroupbox from being applied to the buttons inside?

:I'm writing a application using Qt. Make a clean program and Only added a groupbox and two push buttons.The only line of code I added is this:ui->groupBox->setStyleSheet("background-image: url(/home/ariela/test.png)");The problem is that the backgroun

Displaying php results on current page

:I have this coding that allows me show the .txt file contents of whatever file is selected from the drop down. Choose a file: