simple

PROLOG: basic question: duplicate solutions

I have a problem trying to get some code that returns unique answers to my query. For example, defining stuff(A,B,C) :- A=C ; B=C. morestuff([],[],[]). morestuff([A|AA],[B|BB],[C|CC]) :- stuff(A,B,C), morestuff(AA,BB,CC). then running morestuff([A,A],[A,B],[a,b]). gives the output: A = a B = b ? ; A = a B = b ? ; yes. As you c...

How can I use Simple Modal to scroll to the top of my page just before the modal launches?

I'm successfully using Simple Modal to launch a modal when a button is clicked, however, I want the page to scroll to the top first. I tried placing an anchor tag at the top of the page and referencing it in my link using , but it didn't work. The Simple Modal still worked, but it didn't scroll to the top of the page first. Is there a...

Permutation generator on C

I need a simple Algorithm of permutation generator which could be apply on simple C language. ...

Simple jQuery css background "chooser" problem

Hi, I wrote this very simple backgroung chooser. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="http://aj...

Simple HTML/CSS positioning question

Hi, For some reason I think I'm forgetting something here. Below is my code: <style type="text/css"> #content { width: 400px; height: 100px; background: orange; padding: 10px; } </style> <div id="content"> <h1>what</h1> foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofo...

Select latest entry from MySQL database error

<?php mysql_connect("localhost", "user", "password") or die(mysql_error()); mysql_select_db("jmvarela_jacket") or die(mysql_error()); $query = 'SELECT * FROM `quote` ORDER BY `id` DESC LIMIT 1'; $row = mysql_fetch_array( $query ); echo $row['frase']; ?> I cant get this to work. I get this error: Warning: mysql_fetch_array(): s...

Integrating 'Simplegallery' Jquery Plug-in with multiple gallery instances

Hello all, My developer friend told me of this site, and I'm hoping that perhaps someone might be able to help me solve a problem that I'm running into on any and all browsers while building the portfolio section of this website for my friend at her website which is (sorry for only being able to link one thing.... www - jennaschweitzer ...

Can someone please help me with some basic boolean minimization ?

Hey guys, Sorry to be annoying, but I am doing a little bit of work at the moment, and am trying to simplify the following piece of boolean algebra so that I can construct the circuit : A'.B'.C.D + A'.B.C.D' + A'.B.C.D + A.B'.C'.D + A.B'.C.D + A.B.C'.D + A.B.C.D' + A.B.C.D So far I have gotten it to : (C.D) + (B.C) + (A....

Recursive directory list/analyze function doesn't seem to recurse right

I wrote what I thought was a straightforward Python script to traverse a given directory and tabulate all the file suffixes it finds. The output looks like this: OTUS-ASIO:face fish$ sufs >>> /Users/fish/Dropbox/ost2/face (total 194) === 1 1 - === css 16 ----- === ...

Are C++ static simple types initialized in order?

My experience tells me that given an object: class Object { private: static int array[]; public: Object(int id); }; int Object::array[] = { 2937, 892 }; Object::Object(int id) { // do something } The initialization of array will happen before the invocation of any method on Object or the invocation of any method on an...

How to write a simple compiler in C/++?

Possible Duplicate: Learning to write a compiler Hi Stack Overflow, now don't get me wrong, I don't intend to write a compiler for C++(though I intend to write it in C++) or Java or some other high level complex programming language. I just want to learn the basics of converting a basic instruction set into a Windows Executab...

Under what scenarios would one want to connect to a host other than localhost?

What I mean is when: mysql_connect('localhost', 'root', 'root'); I provide 'localhost' as the first argument without ever stopping to think what purpose it serves. I guess the opposite would be remote host, but when would you actually use it? Hope it is not a too stupid question, but I really dont know why its there... ...

SimpleModal: Once modal is closed it won't open again

This is how I instantiated the modal, with 'btnModalAddGroup' as the div that acts as a button: <div id="btnModalAddGroup" class="button">Add New Group</div> $('#btnModalAddGroup').click(function() { $("#addGroupModal").modal({ appendTo: 'form', escClose: false, persist: true, onOpen: function(dialo...

How can I mimic a multi-tiered menuing system using Java enums?

I need to accomplish the following (this is a simplified version): enum Animals{ enum Cats{tabby("some value"), siamese("some value")}, enum Dogs{poodle("some value"), dachsund("some value")}, enum Birds{canary("some value"), parrot("some value")} private String someValue = ""; private ShopByCategory(String someValue) { th...

how to fetch custom google search results by simple html dom parser ?

Hi I have custom google search included on a html page. like http://www.*.com/search.htm?cx=partner-pub--00000000000-c77&amp;cof=FORID%3A10&amp;ie=ISO-8ds3-1&amp;q=software&amp;sa=Search&amp;siteurl=www.*.com%2#1342 When I am using same url in browser i get results. I want to call it by simple dom html parser then it is returning blank...