Hi everyone,
I produced a PHP web app for a client some months back that is hosted on their own server.
I have still not been paid for this work, and they are giving me the runaround.
It turns out that I still have remote admin access to their server, so I can make code changes. What I was thinking of doing was to move the core kernel off-site onto one of my own servers, and program in some kind of callback or include that gets the kernel (critical functions) from my server. Give it two weeks or so for their backups to catch this change, and then pull the plug and exercise leverage. If I do this, they will pay immediately, because the site is a critical one for a very large and influential client of theirs.
What is the most effective and easiest way of doing this? What code do I use?
Thanks for any pointers.
Hi,
I know this question has been asked here before, but I don't think those answers were adequate for my needs.
We have a SOAP webservice that is used for an iPhone application, but it is possible that we need an Android specific version or a proxy of the service, so we have the option to go with either SOAP or JSON. I have a few concerns about both methods:
SOAP solution:
Is it possible to generate java
source code from a WSDL file, if so,
will it include some kind of proxy
class to invoke the webservice and
will it work in the Android
environment at all?
Google has not provided any SOAP
library in Android, so i need to use
3rd party, any suggestion?
What about the performance/overhead
with parsing and transmitting SOAP
xml over the wire versus the JSON
solution?
JSON solution:
There is a few classes in the
Android sdk that will let me parse
JSON, but does it support generic
parsing, like if I want the result
to be parsed as a complex type? Or
would I need to implement that
myself?
I have read about 2 libraries before
here on Stackoverflow, GSON an
Jackson. What is the difference
performance and usability (from a
developers perspective) wise? Do you
guys have any experince with either
of those libraries?
So i guess the big question is, what method to go with?
I hope you can help me out. Thanks in advance :-)
Hi
Is there a security risk if an application called page.ashx called internal only page.ashx, can a hacker conclude that another page is called.
I don't want anyone to access this page. it looks stupid I know, but it is a part of more complex problem.
thanks
Ok, this is so weird!!! I am running PHP Version 5.1.6 when I try and run the code below it gives a fatal error of an object that has not been instantiated. As soon as I un-comment this line of code
//$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
everything works. Even though I have declared the $cb_db object as global within in the method. Any help would be greatly appreciated.
require_once ( ROOT_CB_CLASSES . 'db.php');
$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
class cb_user {
protected function find_by_sql( $sql ) {
global $cb_db;
//$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
$result_set = $cb_db->query( $sql );
$object_array = array();
while( $row = $cb_db->fetch_array( $result_set ) ) {
$object_array[] = self::instantiate( $row );
}
return $object_array;
}
}
Hi Guy,
I am using JQuery ajax jsonp. I have got below JQuery Code:
$.ajax({
type:"GET",
url: "Login.aspx", // Send the login info to this page
data: str,
dataType: "jsonp",
timeout: 200000,
jsonp:"skywardDetails",
success: function(result)
{
// Show 'Submit' Button
$('#loginButton').show();
// Hide Gif Spinning Rotator
$('#ajaxloading').hide();
}
});
The above code is working fine, I just want to send the request as "POST" instead of "GET", Please suggest how can I achieve this.
Thanks
Here is my javascript:
$(document).ready(function(){
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: queries["mindex"] }, showData, 'html');
});
function showData(data)
{
var response = $(data).find("#mailing").html();
if (response == null)
{
$("#results").html("<h3>Server didn't respond, try again.</h3>");
}
else if (response.length)
{
var old = $("#results").html();
old = old + "<br /><h3>" + response + "</h3>";
$("#results").html(old);
var words = response.split(' ');
words[2] = words[2] * 1;
words[4] = words[4] * 1;
if (words[2] < words[4])
{
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: words[2] }, function(data){showData(data);}, 'html');
}
else
{
var done = $(data).find("#done").html();
old = old + "<br />" + done;
$("#results").html(old);
}
}
else
{
$("#results").html("<h3>Server responded with an empty reply, try again.</h3>");
}
}
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
After the first line in showData:
var response = $(data).find("#mailing").html();
the javascript stops. If I put an alert before it, the alert pops up, after it, it doesn't pop up. There must be something wrong with using $(data), but why? Any ideas would be appreciated.
I have a relationship like this:
class E {
string name
hasMany = [me:ME]
}
class M {
float price
}
class ME {
E e
M m
int quantity
}
And I'd hate to iterate to achieve this: "obtain the sum of the quantity in ME times the price of the corresponding M for a given E".
Any hints on how to implement it using GORM/HQL ?
Thanks in advance
i am trying to make a uiapplication
If i click on a button then a background thread must start which should run even when my application is exited how can i do that
I created a background thread but it gets stop when the app exits.
I am pulling categories from an xml file. I only have 5 categories but the code below keeps pulling categories indifitely! Weird thing, I dont even have a loop in the xml function.
Test link:
http://www.refinethetaste.com/FLPM/
$.ajax({
dataType: "xml",
url: "/FLPM/content/home/index.cs.asp?Process=ViewVCategories",
success: function(xml) {
$(xml).find('row').each(function(){
var id = $(this).attr('id');
var CategoryName = $(this).find('CategoryName');
$("<div class='tab fleft'><a href='http://www.refinethetaste.com/FLPM/content/home/index.cs.asp?Process=ViewVideos&CATEGORYID="+ id +"'>"+ CategoryName.text() + "</a></div>").appendTo("#VCategories");
CategoryName.find("div.row-title .red").tabs("div.panes > div");
});
}
});
Using Visual C++ with MFC. When a certain event occurs in my code, I want to set a function to be called 10 seconds later to perform some activity. The handling of the event happens in a static library that doesn't have any direct links to MFC (and I'd like to keep it that way).
How can I schedule a function to be called at some point in the future? Use a Timer I guess? How do I decouple the Timer (which is an MFC dependency) so my business code doesn't have a direct dependency on the GUI? Or maybe something else besides a timer?
i have used facebook connect in my site but it is not working properly. when i click on facebook connect button it shows popup after that when i enter my login and password it shows the callback url in the same popup.
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
I've a spring bean with 3 Maps all of which are to be populated incrementally.
First map is an item category list, second map is a product list and third map is a hobby for item type list
All the maps are mapped to and on the JSP.
When the page is loaded only the first map is populated on the onchange event of first map, I need to populate the second map in the bean and similarly on the onchange event of second map, I need to populate the third map in the bean.
Is there a way to do this using Ajax??
I need some code samples to how to render JSON response in second and third dropdown.
Clarification: @Donal: I have a simple JSP page with 3 dropdowns corresponding to 3 maps stored in my commandBean. So when the page loads for the first time only the first map and hence the first dropdown is populated. Now whenever the user selects anything out of the first dropdown, I need to send the same commandbean back with the values of the first dropdown and get the values for the second map and hence the second dropdown and so forth for the 3rd dropdown as well. For each dropdown I 've got 3 maps and 3 variables for storing the selected values. Now I want to understand if this is possible using Ajax. I hope this clarifies whatever you need to know. Thanx
Hi a newb question:
I have a table with a bunch of buttons like so:
<tr class="hr-table-cell" >
<td>REcord 1</td>
<td>
<INPUT type="button" value="Approve" onclick="" />
<INPUT type="button" value="Reject" onclick="" />
<INPUT type="button" value="Delete" onclick="fnDeletePpAppl(222445,704);" />
</td>
</tr>
<tr class="hr-table-cell" >
<td>REcord 1</td>
<td align="center" class="hr-table-bottom-blue-border" valign="middle">
<INPUT type="button" value="Approve" onclick="" />
<INPUT type="button" value="Reject" onclick="" />
<INPUT type="button" value="Delete" onclick="fnDeletePpAppl(237760,776);" />
</td>
</tr>
I have my jquery like so:
<script type="text/javascript"> // JQUERY stuff
$(document).ready(function(){
function fnDeletePpAppl(empno, applno) {
alert('Entering here');
$("form").get(0).empno.value = empno;
$("form").get(0).applNo.value = applno;
$("form").get(0).listPageAction.value = "delete";
$("form").get(0).action.value = "pprelreqlist.do";
$("form").get(0).submit();
}
});
This doesn't seem to work.I thought this means, the function is ready only after the dom is ready. After the dom is ready and i click the button, why is not recognizing the function declaration within the .ready() function? However if i use the function directly:
<script type="text/javascript">
function fnDeletePpAppl(empno, applno) {
alert('Entering here');
$("form").get(0).empno.value = empno;
$("form").get(0).applNo.value = applno;
$("form").get(0).listPageAction.value = "delete";
$("form").get(0).action.value = "pprelreqlist.do";
$("form").get(0).submit();
}
This works. I want to get my fundamentals straight here... If i do the declaration without the .ready() , does that mean i'm using plain vanilla jscript?
If i were to do this with the document.ready - the usual jquery declaration way, what would i have to change to make it work?
I understand there are much better ways to do this like binding with buttons etc, but I want to know why this particular way doesn't seem to be working. Thanks.
Cheers.
K
Im trying to create a loop of items like this...
for each (var btn:Object in ViewButtonData)
{
// build element
var box:HBox = new HBox();
box.styleName = "lefttab";
box.width = "100%";
box.addEventListener("rollOver", HoverTab(btn.id, 1));
box.addEventListener("rollOut", HoverTab(btn.id, 0));
// add element to list
}
I would like to pass in current HBox to the 'HoverTab' function. Is there a way to do that?
This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object
It turns out to have nothing to do with collaborators and is reproducible.
When I bind Label.Content to a property of the DataContext that is declared as an interface type, ToString() is called on the runtime object and the label displays the result.
When I bind TextBlock.Text to the same property, ToString() is never called and nothing is displayed. But, if I change the declared property to a concrete implementation of the interface, it works as expected.
Is this somehow by design? If so, any idea why?
To reproduce:
Create a new WPF Application (.NET 3.5 SP1)
Add the following classes:
public interface IFoo
{
string foo_part1 { get; set; }
string foo_part2 { get; set; }
}
public class Foo : IFoo
{
public string foo_part1 { get; set; }
public string foo_part2 { get; set; }
public override string ToString()
{
return foo_part1 + " - " + foo_part2;
}
}
public class Bar
{
public IFoo foo
{
get { return new Foo {foo_part1 = "first", foo_part2 = "second"}; }
}
}
Set the XAML of Window1 to:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<StackPanel>
<Label Content="{Binding foo, Mode=Default}"/>
<TextBlock Text="{Binding foo, Mode=Default}"/>
</StackPanel>
</Window>
in Window1.xaml.cs:
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
DataContext = new Bar();
}
}
When you run this application, you'll see the text only once (at the top, in the label). If you change the type of foo property on Bar class to Foo (instead of IFoo) and run the application again, you'll see the text in both controls.
Scenario
I have a C# Windows Service that essentially subscribes to some events and if anything is triggered by the events, it carries out a few tasks.
The Thing...
....is that these events are monitoring processes, which I need to restart at certain times of the day.
Question
What's the best way I can go about performing this task at an exact time?
Thoughts so far are:
1)To use a timer that checks what time it is every few minutes.
2)Something that isn't a timer and doesn't suck as an implementation.
Help greatly appreciated.
Hi, what is the best practice for this scenario:
1) User clicks "Sort huge javascript array"
2) Browser shows "Sorting..." through element.innerHTML="Sorting"
3) Browser sorts huge javascript array (100% CPU for several seconds) while displaying "Sorting..." message.
4) Browser shows result.
Pseudo code:
...
<a href="#" onclick="sortHugeArray();return false">Sort huge array</a>
...
function sortHugeArray(){
document.getElementById("progress").innerHTML="Sorting...";
...do huge sort ...
...render result...
document.getElementById("progress").innerHTML=result;
}
When i do that this way, browser never shows "Sorting...", it freezes browser for several seconds and shows result without noticing user...
Thank you for advice.
Hi, I have a question.
Somebody, who was working on my code before me, created some method and passed Runnable as parameter, more likely:
void myMethod(Runnable runnable){ runnable.run(); }
Then calling myMethod out of main looks like:
public static void main(String args[])
{ try
{ myMethod(new Runnable(){ public void run() { //do something...; }}); }
catch (Throwable t) { } }
So, to supply parameter to myMethod I need to instantiate object of (in this case anonymous) class implementing Runnable.
My question is: is it necessary to use Runnable in this example? Can I use any different interface? I mean I can create new interface with single method i.e.
interface MyInterface{ void doThis(); }
then change look of myMethod: void myMethod(MyInterface myObject){ myObject.doThis(); }
And of course client too:
public static void main(String args[]) {
try { myMethod(new MyInterface (){ public void doThis()
{ //do something...; }}); }
catch (Throwable t) { } }
Or maybe something is about Runnable?!
I'm sure that there's an easy answer to this, but I can't find it.
I have a table 'myTable' which I stripe using the following
$("#myTable tr:even").css({ "background-color": "#FEE996" });
$("#myTable tr:odd").css({ "background-color": "#FFEFAF" });
This works fine.
I am also using a table filter plugin as follows
$('#myTable').tableFilter();
This plugin places a blank field at the top of each column into which the filter criteria can be typed. When the table is filtered it removes unmatched rows, which in turn messes up the striping. I would like to be able to re-invoke the lines to re-stripe the table.
Something like
$('#myTable').tableFilter().find("tr:even").css({ "background-color": "#FEE996" }).find("tr:even").css({ "background-color": "#FFEFAF" });
Is this possible please?
Under
(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)
peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier{}
is it possible to get returned the phone number or somewhat the user has clicked?
Hello,
I am happily using Castle's WcfFacility. From Monorail I know the handy concept of Rescues - consumer friendly results that often, but not necessarily, contain Data about what went wrong.
I am creating a Silverlight application right now, doing quite a few WCF service calls. All these request return an implementation of
public class ServiceResponse
{
private string _messageToUser = string.Empty;
private ActionResult _result = ActionResult.Success;
public ActionResult Result // Success, Failure, Timeout
{
get { return _result; }
set { _result = value; }
}
public string MessageToUser
{
get { return _messageToUser; }
set { _messageToUser = value; }
}
}
public abstract class ServiceResponse<TResponseData> : ServiceResponse
{
public TResponseData Data { get; set; }
}
If the service has trouble responding the right way, I would want the thrown Exception to be intercepted and converted to the expected implementation. base on the thrown exception, I would want to pass on a nice message.
here is how one of the service methods looks like:
[Transaction(TransactionMode.Requires)]
public virtual SaveResponse InsertOrUpdate(WarehouseDto dto)
{
var w = dto.Id > 0
? _dao.GetById(dto.Id)
: new Warehouse();
w.Name = dto.Name;
_dao.SaveOrUpdate(w);
return new SaveResponse
{
Data = new InsertData
{
Id = w.Id
}
};
}
I need the thrown Exception for the Transaction to be rolled back, so i cannot actually catch it and return something else.
Any ideas, where I could hook in?
How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee?
Here is the current structure:
CREATE TABLE [dbo].[Employees](
[NodeId] [hierarchyid] NOT NULL,
[EmployeeId] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [varchar](120) NULL,
[MiddleInitial] [varchar](1) NULL,
[LastName] [varchar](120) NULL,
[DepartmentId] [int] NULL,
[Title] [varchar](120) NULL,
[PhoneNumber] [varchar](20) NULL,
[IM] [varchar](120) NULL,
[Photo] [varbinary](max) NULL,
[Bio] [varchar](400) NULL,
[Active] [bit] NULL,
[ManagerId] [int] NULL
)