Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
80% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
Ranked #4K
~19.0K People Reached
Favorite Tags
php x 65
php-4 x 37
mysql x 26
c x 18
c++ x 16
Member Avatar for dancks

I was testing this in prompt mode: import re def checkurl(url): check = re.match(r'^(:?https?://)?[^\/#?&]+\.[^\/#?&]+.*$',url) if check == None: print “NNOOOOOO!!!!” else: print “YESSSS!!!!!” checkurl("javascript:void(0);") checkurl("/account/general?ru=https%3a%2f%2fwww.bing.com%3a443%2fsearch%3fq%3dukraine%2bcrisis&FORM=SEFD") checkurl("/?FORM=Z9FD1") checkurl("http://choice.microsoft.com") I have no idea why this won't work. Ignore the regex its only supposed to weed out relative paths and fragments of strings. …

Member Avatar for Gribouillis
0
991
Member Avatar for dancks

I'm using beautifulsoup to grab text from HTML files. Buts its not perfect: For example it seems to keep css and javascript code that was added haphazardly. My overall goal is to make a list of words and their frequency to compare and contrast html files to categorize them. Dealing …

Member Avatar for Gribouillis
0
277
Member Avatar for Jsplinter

I have an mxn matrix, that is stored in memory in an array: matA = new float[m * n]; // ... Assign values matA[0] = 1; matB[1] = 2; // ... After I finish with this array, I then need to create very similar array to store a new mxn …

Member Avatar for Jsplinter
0
266
Member Avatar for dancks

I wrote this test program to test the binary tree for a particular purpose. The intent is to make 2 new tree nodes with new data and destroy the data of the parent data, as its no longer needed (essentially its supposed to imitate "splitting" but my design calls for …

0
149
Member Avatar for dancks

I need to apply some code changes to a source code file I don't have access to. I write code but rely on someone else to test it for me because my old computer has trouble with VMs. Most of the changes are fixing small syntax errors, but I think …

Member Avatar for rubberman
0
194
Member Avatar for dancks

I'm writing a basic sudoku solver. I have a simple method that looks for squareas with only 1 possible number and fills them in before trying to solve the puzzle. the method look like this: def fillinones(sq): table = {1:1,2:2,4:3,8:4,16:5,32:6,64:7,128:8,256:9} for i in range(0,80): p=checkpossible(sq,i) print "p: ",p if p …

Member Avatar for TrustyTony
0
165
Member Avatar for dancks

It seems like a simple, straightforward question, but I've been monkeying around for way too long trying to get a folder to execute simple folder action scripts to no avail. I know I have them attached, Folder Action Setup app indicates that Folder Actions are enabled, I went in and …

0
200
Member Avatar for dancks

I am trying to make something similar to a symbolic link type setup for a folder. I have a folder on my desktop, place_on_server, and several folders that match up to folders on my linux server so place_on_server/tutorials would match up to /var/www/media/tutorials or place_on_server translates to /var/www/media Basically I …

Member Avatar for dancks
0
1K
Member Avatar for dancks

From an exercise in a cocoa programming book I'm trying to make a to do list app that simply adds, removes and change the entries in the table. I have a lot of things wrong with it. relevant info: * add button: add entry with text from text field. If …

Member Avatar for dancks
0
739
Member Avatar for Harvey_10

Hello daniWeb, i have a question, i am trying to implement a live Ticker for my iOS app but i am stuck in a very frustating situation. So my app should have live internet connection to connect to a sever which has a ticker that Updates continuosly. So here is …

Member Avatar for dancks
0
136
Member Avatar for dancks

I'm having trouble with a binary tree algorithm. A test program I wrote calls for the top node to only be altered in another method outside main (A simple guessing/learning game scenario). I wrote a smaller test of that exercise here: #include <stdlib.h> #include <stdio.h> #include <time.h> struct binary { …

Member Avatar for dancks
0
279
Member Avatar for dancks

So, as an exercise I wanted to make a simple binary tree as practice before moving on to other, harder things. I tried to implement a binary tree in a simple guessing game scenario. I can't test it due to issues I'm having with taking in input. But I can't …

Member Avatar for dancks
0
131
Member Avatar for dancks

I'm going through an exercise in a mac programming in cocoa book, where there is a GUI and from a textfield I enter and to a list of strings displayed on a table. There are plenty of things that aren't working, the most confusing of which is I keep leaking …

Member Avatar for dancks
0
257
Member Avatar for dancks

I made a website in php4 that I want to swtich over for my database, I'm a linux newb, I just thought I would write a simple sed script to change the username and password used in mysql_connect: #!/bin/bash for f in * do sed 's/mysql_connect('localhost','user1','pass1')/mysql_connect('localhost','user2','pass2')/' <$f >$f done exit …

Member Avatar for dancks
0
166
Member Avatar for Proglearner

I have two <div> elements nested within a <p> element and want them both displayed on the same line. Currently, no matter what I do, they get displayed one under the other. How do I get them to display on the same line? Progz

Member Avatar for dancks
0
405
Member Avatar for dancks

I decided the best way to learn css was to try to recreate pages of web sites. I chose youtube, because the layout seemed challenging but doable from a noobie perspective, and I get to watch youtube vids in the process. I am having trouble recreating the part under the …

Member Avatar for AleMonteiro
1
210
Member Avatar for dancks

I am creating a basic PM system for my website. I have just a basic table for a pm: mysql>describe PM; +--------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+----------------+ | PMID | mediumint(9) | NO | PRI | NULL | auto_increment | | …

Member Avatar for dancks
0
307
Member Avatar for dancks

My code technically works, as it registers the user, but it won't keep the user logged in. (yes, once a registration is successful, they should be logged into their new account). It should go right to the index page on success and have the user logged in. On failure it …

Member Avatar for Zagga
0
2K
Member Avatar for dancks

I'm not sure why I suck so bad at this. I was recommended by my prof to use date as opposed to timestamp. I'm starting to think going back to timestamp would be easier due to built in php functions I can use. so in my original addproduct.php form I …

Member Avatar for diafol
0
389
Member Avatar for dancks

A lot of code here. Basically I'm making an auction type site. This segment of code is for a user to upload a product: I'm pretty sure there isn't anything wrong with addproduct.php but for completeness I feel like I should post it. addproduct.php: <?php require_once('checklogin.php'); require_once('validate.php'); if(!isset($_SESSION['user'])) { //die("redirect"); …

Member Avatar for diafol
0
254
Member Avatar for dancks

My school has an apache/mysql server that we make and host websites from as projects. I am doing an ebay type site where people bid on a product until time runs out. Problem is I don't know how to trigger that the product should be delisted and the buyer and …

Member Avatar for smantscheff
0
213
Member Avatar for dancks

addproduct.php snippet (there are lots of other inputs, not sure if that matters): <form method="POST" action="add.php" enctype="multipart/form-data"> <p>Picture:<input type="file" id="pic_upload" name="pic" /> <input type="submit" /> </form> add.php: if(isset($_FILES["pic"])) { if($_FILES["pic"]["error"]==0) { $name = explode(".",basename($_FILES["pic"]["name"])); $target = realpath(dirname($_SERVER['PHP_SELF']))."/images/".$name[0].session_id().".".$name[1]; $temp = $name[0].session_id().".".$name[1]; if(!move_uploaded_file($_FILES["pic"]["tmp_name"],$target)) { add_error("Picture specified did not upload"); } $_POST['pic']=$temp; } …

Member Avatar for dancks
0
105
Member Avatar for dancks

This is based on advise given ina previous thread I posted awhile ago for protecting data. I tried the following: <?php function base_encode($text) { $size = strlen($text); $str=""; for($i=0;$i<$size;$i++) { $str=$str.slide_left(substr($text,0,1),4); $text=substr($text,-1); } return $str; } function base_decode($text) { $size = strlen($text); $str=""; for($i=0;$i<$size;$i++) { $str=$str.slide_right(substr($text,0,1),4); $text=substr($text,-1); } return $str; …

Member Avatar for pritaeas
0
194
Member Avatar for dancks

Hey guys its me again: Basically everything on this page, at least the parts I'm able to test, are working, problem is addproduct.php is supposed to print errors when error checking the form and repopulate the data fields with the previously submitted data. I'm doing this by populating $_SESSION. addproduct.php: …

Member Avatar for gavinflud
0
408
Member Avatar for dancks

I'm on the school server. So before I start I need to say I don't have a choice. I'm tired of reading post with nothing more than "Tell your administator to upgrade". I know. Stop. If I see it its getting flagged as spam. I don't really understand what about …

Member Avatar for diafol
0
154
Member Avatar for AbaianitCristian

I'm calling a c++ project from c# , the process is like this , i enter some numbers in a textbox and when i push a button it calls a c++.exe program and run it with the numbers i've inserted in texbox ,after this return the result in another textbox. …

Member Avatar for BobS0327
0
201
Member Avatar for dancks

Based off some stuff from my last thread I tried to write a search results page using maximum 3 parameters. I used a couple of function to try and get everything organized. One: sort_mysql_results has no defined parameters so I can put in as many parameters as needed. The code …

Member Avatar for dancks
0
325
Member Avatar for dancks

I am making a basic craigslist type website with a search function. There is a field where you can enter what you think the name of the product might be and my search function is supposed to find names of products that match. so for example a user can enter: …

Member Avatar for diafol
0
339
Member Avatar for lewashby

Just got the book C++ Programming in easy steps. I just did the following program and although I ran it with now problems the book and this program really do not at all help understand how an enum or a typedef are usefull in the real world. #include <iostream> using …

Member Avatar for dancks
0
205
Member Avatar for joeyliew7

i have this problem for checking for duplicate username in database. this error appear whether the username is duplicate and does not duplicate. Please help. Warning: mysql_num_rows() expects parameter 1 to be resource, boolean in <?php include_once 'db/db.php'; include_once 'admin-class.php'; $admin = new itg_admin(); if(isset($_POST['Submit'])) { $con = mysql_connect("localhost","username","password","tablename"); if …

Member Avatar for dancks
0
223