Is there any technique available in Java for intercepting messages (method calls) like the method_missing technique in Ruby? This would allow coding decorators and proxies very
easily, like in Ruby:
:Client p:Proxy im:Implementation
------- ---------- -----------------
p.foo() -------> method_missing()
do_something
im.foo() ------------------> do_foo
p.bar() --------> method_missing()
do_something_more
im.bar() -------------------> do_bar
(Note: Proxy only has one method: method_missing())
In the latest Hadoop Studio the 0.18 API of Hadoop is called "Stable" and the 0.20 API of Hadoop is called "Unstable".
Now given the fact that we'll start coding a new Hadoop project in the next few weeks; which API should we use and which Hadoop distribution (Apache, Cloudera, Yahoo, ...) should we use?
Thanks for your insights.
I have setup an .htaccess and .htpasswd file correctly and my password gets accepted, but only on the second attempt. I have read somewhere what to do about this, but I lost the page. Any suggestions?
Hi
I was discussing this at work, and was wondering where people start their designs? We tend to start with designing code to solve the problem presented to us, but that is probably all of us are (or were) programmers.
I was wondering where other people and organisations start their design. Do they start with solving the problem as a coding problem, sit down and design what UI to use, or map out the data or workflow?
Thanks
Hello,
The code below is for a login that I'm using. It works fine, but when I first try logging in after turning on my computer, it only works the second time that I hit the "Login" button. Any idea how I can make it not require hitting the "Login" button twice in this situation?
Thanks in advance,
John
function isLoggedIn() {
if (session_is_registered('loginid') && session_is_registered('username')) {
return true; // the user is loged in
} else {
return false; // not logged in
}
return false;
}
if (!isLoggedIn())
{
if (isset($_POST['cmdlogin']))
{
if (checkLogin($_POST['username'], $_POST['password']))
{
show_userbox();
} else
{
echo "Incorrect Login information !";
show_loginform();
}
} else
{
show_loginform();
}
} else
{
show_userbox();
}
function show_loginform($disabled = false)
{
echo '<form name="login-form" id="login-form" method="post" action="./index.php">
<div class="usernameformtext"><label title="Username">Username: </label></div>
<div class="usernameformfield"><input tabindex="1" accesskey="u" name="username" type="text" maxlength="30" id="username" /></div>
<div class="passwordformtext"><label title="Password">Password: </label></div>
<div class="passwordformfield"><input tabindex="2" accesskey="p" name="password" type="password" maxlength="15" id="password" /></div>
<div class="registertext"><a href="http://www...com/sandbox/register.php" title="Register">Register</a></div>
<div class="lostpasswordtext"><a href="http://www...com/sandbox/lostpassword.php" title="Lost Password">Lost password?</a></div>
<p class="loginbutton"><input tabindex="3" accesskey="l" type="submit" name="cmdlogin" value="Login" ';
if ($disabled == true)
{
echo 'disabled="disabled"';
}
echo ' /></p></form>';
}
EDIT: Here is another function that is used.
function isLoggedIn()
{
if (session_is_registered('loginid') && session_is_registered('username'))
{
return true; // the user is loged in
} else
{
return false; // not logged in
}
return false;
}
I'm searching for a library to edit already existing PDF's and add a watermark to each page, for example. Could also be blank every other page etc.
There seem to be a few PDF libraries out there, but only very few of them can edit existing PDF's and I'm a bit lost on which way to go.
Any recommendations?
Thank you.
Hello,
I started learning DBIx::class and I reach the point where you have to create the Objects that represents tables. Should this classes be created manually ( hard coding all the fields and relationships.....) or there is a way to generate them automatically using the database schema. I read something about loaders, but i did not know where they are really used.
Please advice.
Thanks
I've setup some background colors for my Labels in order to position them. Now that they are well in place, I vould like to reset their background color to none, or clearColor.
But I don't find any way to achieve this in IB, I don't gind any "no color" color...
Any way to do this without re-coding color at runtime?
Thanks,
Jérémy
Hi,
I'm trying to understand bayesian network. I have a data file which has 10 attributes, I want to acquire the confusion table of this data table ,I thought I need to calculate tp,fp, fn, tn of all fields. Is it true ? if it's then what i need to do for bayesian network.
Really need some guidance, I'm lost.
I'm trying to implement a hook when text is edited in a bespin embedded instance. Ideally, I'd simply like to know when the instance has gained or lost focus to capture the user action.
Hi,
Hi my designer made a fla file where he has animated layers loads of them. All the images inside those animations are loaded from outside the swf.
Now, the issue is at one point in time I want some of the objects to go under another object ( current their on top) . If I do this visually the images inside the swf(loaded) are lost.
Any ideas?
Fahim.
There is a mouseUpEvent listener attached to the stage, while dragging the movieClip the mouseUpEvent doesnot trigger the handler somehow the mouseUp gets lost. While the item is being dragged and the mouse is moved away from the movieClip i.e somewhere not on the item but on the stage the mouseUp is detected. Any ideas!!
I know Internet Explorer is a huge irritating thing for a lot of us - especially IE6.
What is the most interesting/extreme thing you've done/fantasized-doing as a result of outrage for (re-)coding for Internet Explorer?
Label tag coding style.
Can I write my label tag like this.
<input type="text" name="lname" id="ln" />
<label for="ln">Last Name:</label>
Instead of like this.
<label for="ln">Last Name:</label>
<input type="text" name="lname" id="ln" />
Hi,
I am developing the application in asp.net mvc with c#. I want the functionality that , a div will popup, so that i can facilate to use to upload the image file from his browser to server , in application domains file system. as usual. This question may be repeat , but i expect something more like
how to build this scenario, and what are the security issues may come?
and what care have to take while coding in the security perspective ?
My PHP code has stopped working on my computer. It was working okay, running under XAMPP server. I was testing Python code and installed PostgreSQL and changed my computer environment for PYTHONPATH - would this affect my PHP coding?
I currently have a MapToolKit.html , and two .js files namely map.js and search.js. When i search places like starbucks, they will return me addresses and coordinates stored into an array. I would like to display those multiple values into the html page, not just one value which i currently did it on my coding now.
Here's the source code:
http://www.mediafire.com/?0minqxgwzmx
I'm developing my first web-app, and I'm working through logistics.
New users (At first login) need to complete a few things before they can use the app fully.
For example, they need to complete their profile before they can move on to step 2, which is taking a test.
What's the best way to go about creating a "new-user" checklist? I want it to be as simple as possible, coding wise, and as easy as possible for the user.
Hello,
I am interested in theory to scale web applications in a distributed nature, i.e. when there is some platform/stack can be extended by others applications running on different servers, etc.
I am researching this field and feels the lack of the right keywords :)
Interesting concepts found so far:
opensocial
through API, like shopify does (shopify it's a hosted ecommerce solution)
semantic web not quite sure about this one
Am I on the right way or am I lost anything? :)
Thanks.
When looking to get data from a web page whats the recommended method if the page does not provide a structured data feed? Am I right in thinking that its just a case of doing an NSURLRequest and then hacking what you need out of the responseData(NSData*)? I am not too concerned about the implementation in Xcode, I am more curious about actually collecting the data, before I start coding a "hunt & peck" through a list of data.
gary
Are lexers and parsers really that different in theory ?
It seems fashionable to hate regular expressions: coding horror, another blog post.
However, popular lexing based tools: pygments, geshi, or prettify, all use regular expressions. They seem to lex anything...
When is lexing enough, when do you need EBNF ?
Has anyone used the tokens produced by these lexers with bison or antlr parser generators?
I'm coding a website with:
background-color:#070707;
That color should be a very dark gray, just the way I see it in photoshop.
Now when I launch this in my browser (the background-color is set on the body using CSS, so it's not an exported image), the color is darker than in Photoshop.
I know there can be differences when exporting images due to color profiling, but when setting the color code, how can this be different from photoshop?
Thanks a lot for helping
You are a super-hero in the year 2222 and you are faced with this great challenge: starting from your home planet Ilop you must try to reach Acinhet or else your planet will be destroyed by evil green little monsters.
To do this you are given a map of the universe: there are N planets and M inter-planetary connections ( bidirectional ) that bind these planets. Each connection requires a certain time and a certain amount of fuel in order for you to cover the connection from one planet to another.
The total time spent going from one planet to another is obtained by multiplying the time past to cover each connection between all the planets you go through.
There are some "key planets", that allow you to refuel if you arrive on those certain "key planets". A "key planet" is the planet with the property that if it disappears the road between at least two planets would be lost.(In the example posted below with the input/output files such a "key planet" is 2 because without it the road to 7 would be lost)
When you start your mission you are given the possibility of choosing between K ships each with its own maximum fuel capacity.
The goal is to find the SHORTEST TIME CONSUMING path but also choose the ship with the minimum fuel capacity that can cover that shortest path(this means that if more ships can cover the shortest path you choose the one with the minimum fuel capacity). Because the minimum time can be a rather large number (over long long int) you are asked to provide only the last 6 digits of the number.
For a better understanding of the task, here is an example of input/output files:
INPUT: mission.in
7 8 6
1 4
6 5 9 8 7 10
1 2 7 8
1 4 14 9
1 5 3 1
2 3 1 2
2 7 7 1
3 4 2 2
4 6 4 1
5 6 3 7
On the first line (in order): N M K
On the second line :the number for the starting planet and the finishing planet
On the third line :K numbers that represent the capacities of the ships you can choose from
Then you have M lines, all of them have the same structure: Xi Yi Ti Fi-which means that there is a connection between Xi and Yi and you can cover the distance from Xi to Yi in Ti time and with a Fi fuel consumption.
OUTPUT:mission.out
000014 8
1 2 3 4
On the first line:the minimum time and fuel consumption;
On the second line :the path
Restrictions:
2 = N = 1 000
1 = M = 30 000
1 = K = 10 000
Any suggestions or ideas of how this problem might be solved would be most welcomed.
I have heard developers say that people who write code should not be the ones testing it. I am looking for peoples experience in this situation. Many times I have done my share of development, then released to the QA dept and had the code sent back to me becuase some aspect of the application was broken due to my coding, regardless of how much I had tested it prior to QA release.
Does anyone on this board have a process to follow, that enables them to throughly test their code before releasing to QA?