520 Posted Topics
import pymongo uri = "mongodb://127.0.0.1:27017" client = pymongo.MongoClient(uri) database = client['fullstack'] collection = database['students'] students = [student['mark'] for student in collection.find({}) if student['mark'] == 99.0] print(students) In the program above how does this work? Why is the `if` statement after the execution code? I would expect the `if` to be … | |
When I tried to start MongoDB with the `mongod` command I got the following. garrett@mint-desktop ~ $ mongod mongod --help for help and startup options Sun Jan 10 14:50:55.049 [initandlisten] MongoDB starting : pid=23327 port=27017 dbpath=/data/db/ 64-bit host=mint-desktop Sun Jan 10 14:50:55.050 [initandlisten] db version v2.4.9 Sun Jan 10 14:50:55.050 … | |
I'm trying to align 3-5 items up in a table cell, three are on the top and two are on the bottom. In each of my table cells I want the first item to be at the top left of cell and the third item I want to be at … | |
http://www.w3schools.com/php/php_forms.asp On the page above I read that GET variables are send via the url and POST variables are sent as an HTTP request. When I tried POST with a simple php script all of my POST variables were still in the URL which is what I was expecting for … | |
I'm reading 'C++ For Dummies 7th Edu' and I'v ran into this little snipet that's confusing me. BOOK You can add const-ness, however, as in the following void fn(char* pName) { // declare following is allowed even though // declared Student(const char*) Student s(pName); // ...do whatever... } The function … | |
I followed this site -> https://www.box.com/blog/how-to-debug-php-with-vim-and-xdebug-on-linux/ but I'm not having much luck. I followed the firections and my phpinfo() functions is showing that xdebug is up and running but I see don evidence of xdebug from within vim. I typed in my localhost url, localhost/mysite.php?XDEBUG_SESSION_START=1 and then wen to vim … | |
I hot the following program from the book 'C++ For Dummies' but have two questions about it. First I compiled the program but I'm afraid to run because the memery created from the heap does not appear to me to get de-allocated. Am I correct in not wanting to run … | |
I get the following in my web browser when I try to connect to my mariaDB database. `Error!: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)` It also doesn't matter if I use mariaDB root or a regular users credentials, I get the same thing. The error above … | |
Re: I'm not a professional programmer by any stretch of the imagination so here are my novice thoughts for what they are worth. I've played around with VS a few years ago but I found it's vast array of options daunting and I also realized that it makes you dumber when … | |
Linux Mint I logged into phpmyadmin and set the password option to 'no password' and now I can't log in. If I enter the password I was using I get this error -> `#1045 Cannot log in to the MySQL server` and if I don't user a password at all … | |
garrett@mint-desktop /var/www/html/udemy/php-oop/gallery/backups $ tar --exclude-tag-all=backups -cf lesson20.tar ../* tar: Removing leading `../' from member names I have an empty file called backups in my backups directory to keep the tar file from trying to backup itself. Does anyone know why I'm getting this output? -> `tar: Removing leading ../' from … | |
I need some suggestions on a good cloud server I could use to backup my computer. I want to backup my data (music, pictures, videos, etc...) and I also want to make it better and easier to sync between my desktop and laptop for my coding projects. I currently have … | |
I am trying to create a PDF file that has typeable text boxes, so I guess I'm trying to create a PDF form. I'm using MS Word 2010 to create the document then I select Save As and select PDF. After doing this the text box does not show up … | |
The php/html file I am working on is laid out in this way. <?php // connect to DB $connection ?> html html html <?php foreach($connection-query($sql) as $row) do stuff ?> I'm getting the error 'Invalid argument supplied for foreach()' when I run this page. Can I not break out of … | |
Linux Mint 17 I have recently download the SFML library but I don't know where to put the files. There is a lib directory and an include directory. The lib directory appears to have a lot of sym links in it. garrett@mint-desktop ~/Desktop/SFML-2.3.2/lib $ ls -l total 904 lrwxrwxrwx 1 … | |
When I try to compile the program below in Eclipse I get two erros, ‘const class Fraction’ has no member named ‘n’ & ‘const class Fraction’ has no member named ‘d’ When I compile it on the command line with g++ -Wall FloatFraction2.cpp Fract7.cpp -o FloatFraction I get more errors … | |
I see that daniweb.com has been updated but now I don't see a solved button on any of my threads. Also, could someone tell me why I don't get any spelling feedback while typing a post on daniweb? Every other site I'm on I get spelling feedback. Thanks. | |
So I recently had a catastrophe with using the Mega cloud service with my Linux Mint desktop and I got my whole home directory wiped out. Everything got wiped out about an hour into syncing my 151 Gig home directory to the cloud so needless to say most of my … | |
I recently purchased a 200 GB cloud drive from http://mega.nz but now it's wrecked havoc on my local machine. To give you an idea of what happened I'll start by saying this, when I first purchased my cloud account I didn't realize that it was set to sync in both … | |
I have recently installed LMDE (Linux Mint Debian Edition) onto my laptop but I can't isntall anything because it can't find the sources. I'm assuming I need to edit the /etc/apt/sources.list file but I'm not sure. And if so I don't know in what way I should edit the file. | |
I'm working on a small web project (MariaDB LAMP stack) on my desktop but I'd like to be able to continue working on the project when I am away from home computer. I think I can sync my /var/www/html/ directory without a problem but does how can I export my … | |
The program below is just a simple test to see if I can get it to fetch the correct data from MariaDB and then display it on the screen but so far I'm not having any luck. I left the action attribute's value blank because I want the PHP form … | |
When I look up connectin an html form via 'action' & 'submit' to php code I see that I am supos to give the form's action attribute the value of the php file I want to run upon submit. But what do I do if the php I want executed … ![]() | |
I'm working with MariaDB through PHPMyAdmin and I have a question about how I need to set up my database. For eash person in the table I am currently building I'll also need an array of date values. I don't think there is a way for me to setup a … ![]() | |
In the page below if the screen is to small or is resized it causes the data in the table cells to be out of sight. I would either like there to be a scroll bar at the bottom of the page or I'd like for the data in the … | |
I just installed phpmyadmin with `sudo apt-get install phpmyadmin` but now I can't figure out how to get it started. The installation did place a phpmyadmin directory in /etc/ but I don't have anything in /var/www/html/ . I installed this several years ago and it placed a start icon in … | |
Below is something like what I get when I try to install anything on my just installed OS Linux Mint Debian Edition. Reading package lists... Building dependency tree... Reading state information... The following extra packages will be installed: apache2-data apache2-utils Suggested packages: apache2-doc apache2-suexec-pristine apache2-suexec-custom The following NEW packages will … | |
When I try to create a database with a non root user of MySQL I get this error. -> MariaDB [(none)]> create database cl_db; -> ERROR 1044 (42000): Access denied for user 'garrett'@'localhost' to database 'cl_db' How do I allow my recular username to create databases? Thanks. ![]() | |
body { background-color: gray; } h1 { color: blue; text-align: center; } #courtstable { border: 1px solid black; position: absolute; top: 75px; left: 0px; width: 25%; background-color: yellow; } #medicaltable { border: 1px solid black; position: absolute; top: 75px; left: 25%; width: 25%; background-color: green; } #punativetable { border: 1px … | |
In the following code, why is neither "Connected Successfully" nor "Connection failed" ever displayed on my page? Also, I'm trying to place for table side by side in one large table. Does anyone have any idea why Eclipse is giving me warnings about my four tables and my comments? Thanks. … | |
In an php/html document could I create a loop to create html table rows as long as there is a rows to be read from a MySQL database table? I could then populate the html table with the data but I first need to know if I can make a … | |
I just purchased an HP Envy 5642. I can print to it from Linux without a problem but I don't see a way to scan. When I hit scan on the printer it tells me to turn on the appropriate HP application in Windows which I am not running. I … | |
My head is starting to hurt just thinking about all the possabilities and impossabilities of mixing html and css with php and I'd like to understand how's this works. I did a php project for a guy one time and I came close to shooting myself in the face and … | |
[Linux] When using gcc and or g++ is there a way I can have two output files, one with and one without debugging symbols in one gcc/++ command? I don't want to have to write `g++ --Wall program.cpp -o program`, then have to immediately run `g++ --Wall -g program.cpp -o … | |
At my current job me and the rest of the staff that work in my area are uisng a lot of files that when opened look like PDF files but there not. They're actually .exe files and the the program that opens them is called Omni Form Mailable Filler. I've … | |
I just purchased an HP all in one printer and scanner but because I use Linux I can't scan directly to my desktop. As a result I'm having to scan to email and I just noticed that my picture file size was only 244 KB. That's seems small to me … | |
#include <iostream> #include <stdlib.h> #include <cstring> #include <stack> using namespace std; #define MAX_CHARS 100 int main(int argc, char* argv[]) { char input_str[MAX_CHARS + 1], *p; stack<double> num_stack; int c; double a, b, n; cout << "Enter RPN string: "; cin.getline(input_str, MAX_CHARS); p = strtok(input_str, " "); while(p) { c = … | |
Two of my USB sticks have stopped auto mounting. I can still mount them manually by running `mount | grep /dev/sd` and then looking for the device name to mount from but that's having to go a little out of the way. Not all USB stick have stopped auto mounting, … | |
I'm looking at some towers on newegg and I'm trying to pick one out. I'm open to a full tower but I'd like to know if I can get away with a smaller case, mainly because of the price. I'd like to build a media server so the first priority … | |
When I want to sync my music directory to my SDcard I use the command `rsync -a --delete /home/garrett/Music /media/garrett/6BF6-AC8A` and everything works just fine. I got tired of typing all that in every time so I placed that command in the script ~/bin/music-sync and this is what the file … | |
Take a look at the following lsit of files from my media server root@media-server:/home/garrett/Videos/Movies# ls -l total 16 lrwxrwxrwx 1 root root 46 Jun 27 22:17 Adventures In Babysitting.mkv -> ../Movies-Secure/Adventures In Babysitting.mkv lrwxrwxrwx 1 root root 36 Jun 27 22:17 A Far Off Place.mkv -> ../Movies-Secure/A Far Off Place.mkv … | |
There's a few things I'm confused about when it comes to the .mkv file format. It's the file format I use for my media server for several reasons. I'm told it's the format to go with for quality because it can hold HD (which I assume means it's video files … | |
I'm reading the book 'C++ Without Fear 2nd Edu' and I'm a little confused on the subject of shallow copies. The book says the problems can arise if you make a shallow copy of an object and something happens to the original, goes out of scope, is deleted, etc... I … | |
I have ripped the TV show Pushing Daisies Blu-Ray disk as up to 3 episodes on one track. So now my ripped file is one file containing 3 episodes. Is there a good program that would allow me to split the file up into 3 different mkv files? Thanks. | |
#include <iostream> #include <cstring> using namespace std; class String { private: char *ptr; public: String(); String(char* s); ~String(); operator char*() { return ptr; } int operator==(const String &other); }; int main() { String a("STRING 1"); String b("STRING 2"); cout << "The value of a is: " << endl; cout << … | |
I've always been able to navigate through my Windows drive after booting up in my Linux OS but ever since I got Windows 8 there seems to only my a 50/50 change of a successful mount. When I type this command sudo mount -t ntfs -o uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177 /dev/sdd4 /media/garrett/Windows I … | |
#!/usr/bin/env python3 tm = open('./timemachine.txt', 'r') Dict = {} for line in tm: line = line.strip() line = line.translate('!"#$%&'()*+-./:;<=>?@[\\]^_`{|}~') line = line.lower() List = line.split(' ') for word in List: if word in Dict: count = Dict[word] count += 1 Dict[word] = count else: Dict[word] = 1 for word, count … | |
When setting up an NFS server and setting up the 'ro' or 'rw' permissions, how do the ext4 permissions come into play? Thanks. | |
I just built my first computer and instlled headless on it. When I boot it up there are a few problems on the black and white screen with all the BS. It usually starts but it takes forever. All the parts are right out of the box via amazon and … |
The End.