n this article, I will show you How to create a REST based service, How to host a REST,based service in Console application and How to consume a REST Service at client.
If I were to define two objects myDataStore and myDrawer something like this:
var myDataStore = function(myObjectRef) {
this.myInternalObject = myObjectRef;
};
var myDrawer = function(myObjRef) {
this.myInternalObject = myObjectRef;
};
And if I were to create an object like so:
(function(){
var myObject = window.myObject = function(){
this.dataStore = new myDataStore(this);
this.drawer = new myDrawer(this);
}
})();
Then myObject.dataStore.myInternalObject, and myObject.drawer.myInternalObject, would simply be pointers back to the original 'myObject' - not taking up any additional memory in the browser. Yes?
I am interested in implementing techniques like this - as it makes it easy for objects to communicate with each other.
Hi there!
In some apps I see an EditText widget combined with a Button on the right side (e.g. the search field in the twitter app).
How can I create a widget like that?
Regards,
Marco
Hey,
I have this asp.net code in my page :
<div id="prx">ABC</div>
And I want to change the value "ABC" to something when for example the user type a value in TextBox.
How can I do that using Ajax ?
Thanks
Hi All
I need to start using unit tests in my code . The problem is that i never written unit tests . Can you please recommend me some good sites and book how to write correctly unit tests and to use nunit application .
Thanks a lot for help.
Hi Friends,
In my application i have done to record the voice and playing in the device.
Now i want to find the audio frequency of that recorded voice(While recording). How can i find?.I dont have any idea. I have downloaded "aurio Touch" program.But its too difficult to understand me. So is there any tutorials are avilable(in iPhone)?. How can i achieve this?
Please guide me.
Thanks.
Hi,
I want to export my data from grid view to the excel. Unfortunately i came to know that there is no excel software on server side. Is there any way that i can still export data in excel format without having excel software on server side.
Thanks.
Hi there,
I'm back to C/C++ after some break.
I've a following problem:
I've a solution where I've several projects (compilable and linkable).
Now I need to add another project to this solution which depends on some sources from other projects.
My new project compiles without any problems (I've added "existing sources" to my project).
the error:
1>Linking...
1>LicenceManager.obj : error LNK2019: unresolved external symbol "int __cdecl saveLic(char *,struct Auth *)" (?saveLic@@YAHPADPAUAuth@@@Z) referenced in function "public: void __thiscall LicenceManager::generateLicence(int,char *)" (?generateLicence@LicenceManager@@QAEXHPAD@Z)
1>LicenceManager.obj : error LNK2019: unresolved external symbol "void __cdecl getSysInfo(struct Auth *)" (?getSysInfo@@YAXPAUAuth@@@Z) referenced in function "public: void __thiscall LicenceManager::generateLicence(int,char *)" (?generateLicence@LicenceManager@@QAEXHPAD@Z)
Functions saveLic, and getSysInfo are defined in files which I've added to my new project from existing ones. There is object file created during compilation with those functions in target dir, but my LicenceManager class doesn't want to link.
I use some
extern "C" , and #pragma pack
somewhere, but no more fancy stuff. I think every directory, lib and other necessary dependencies are visible in settings for this project.
Thanks for any advice.
The problem is straight forward:
1) We have a photon traveling from Point 1 (x,y,z) to Point 2 (x,y,z), both of which could be located anywhere in 3D space.
2) We have a polygon that is both rotated randomly on the x-axis and/or y-axis and also located anywhere in 3D space.
3) We want to find: a) if the photon will collide with the polygon at all and b) if it does where will that be (x,y,z)?
An image of the problem: http://dl.dropbox.com/u/3150177/Programming/3D/Math/Photon%20Path/Photon%20Path.png
The aim of this is to calculate how the photon's path should be altered from an interaction(s) with the polygon(s).
I am reading up on this subject now but I was wondering if anyone could give me a head start. Thanks in advance.
For an instance of SQL Server 2005/2008, how can one determine the date and time when a service pack was applied to the instance? Is there a system table or view that stores that information?
Hi,
I have a confirmation message box for the user in one of my apps. Below is the code for that,
MessageBoxResult res= System.Windows.MessageBox.Show("Could not find the folder, so the D: Drive will be opened instead.");
if (res == MessageBoxResult.OK)
{
MessageBox.Show("OK");
}
else
{
MessageBox.Show("Do Nothing");
}
Now, when the user clicks on the OK button, I want certain code to execute but when they click on the red cross at the upper right corner, I just want the messagebox to close without doing anything. In my case I get 'OK' displayed even when I click on the red cross icon at the upper right corner. Is there a way I can have 'Do Nothing' displayed when I click on the cross. I not want to add any more buttons.
Hello, I have a problem with memory management.
I am developing an application that makes heavy use of UIWebView. This app generates dynamically lots of UIWebViews while loading content from my server. Some of these UIWebViews are quite large and have a lot of pictures.
If I use instruments to detect leaks, I do not detect any. However, lots of objects are allocated and I suspect that has to do with the UIWebViews.
When the webviews release because no longer needed, it appears that not all memory is released. I mean, after a request to my server the app creates an UITableView and many webviews (instruments say about 8Mb). When user tap back, all of them are released but memory usage only decrements about 2-3 Mb, and after 5-10 minutes using the app it crashes.
Am I missing something?
Anyone know what could be happening?
Thank you!
Hello guys. I've got SOA which processing data for diff clients(asp,sl). The base of this design is domains of my business model. For transporting,showing it to clients I use DTO. For mapping domain to DTO I use AutoMapper. Now I should persist new entities from clients. I want use my DTO's at this scenario too. So i've got some questions as I'm not much familiar with this design
1) Is it a good practice build DTO on client and send it to web-service on the wire? MayBe i should pass my domains?
2) Is it possible have several DTO's to one domain (one show at grid, and one to save). For saving I need set all nonprimitive props at client.
3) DTO - to Domain. If I've got int can I use AutoMapper to generate NHibernate Proxy for this ID, or I should do i manually.
Your expierence and practice are very interesting.
Thanks for answer!!!
I have an SSL certificate that is valid for mysite.co.uk but not www.mysite.co.uk it seems. If I use mod_rewrite or .htaccess to redirect from one to the other will this prevent browsers from displaying an invalid certificate security warning if someone tries to access www.mysite.co.uk?
(I've tried redirection but still get the warning if I type https://www.mysite.co.uk directly into the address bar of my browser. I want to know if this is because the redirection isn't working or if the browser will display the warning anyway.)
I hope that makes sense.
I have used Puttygen to create a public and a private key, and then is ready to let TortoiseHg on Windows 7 do a clone by going to
ssh:[email protected]/somecode
but there seems to be no where to add the private key to TortoiseHg?
The file is already some where on hard disk as somefile.ppk Does someone know how to add it?
I am trying to compile KDE from sources and I get this error when trying to make kdelibs:
Could NOT find Phonon: Found version "4.3.1", but required is at least
"4.3.80"
I am running Kubuntu karmic ... and I have the latest phonon dev files. How can I upgrade it to the version that kdelibs needs?
My question is simple. What (if anything) does Ubuntu Server Edition have to offer to home users?
This question is mostly out of curiosity really, but I like asking. I've got a home network set up here with some 6 to 7 machines (most Windows, one Linux). And I was wondering how useful would it be to have a dedicated computer in my house running Ubuntu Server full time. We've had an awful experience with file sharing so far, would it simplify file sharing/transferring? Would I be able to limit the internet bandwidth granted to each PC? Would I be able to monitor in/out internet traffic (both real time and monthly statistics)?
Last, and most important, if I'm completely off as to what Ubuntu Server actually is, please say so. I am completely new to it.
I have UIScrollView with multiple UIVIew subviews. I would like to update the data that is displayed by each UIView when they appear in the visible portion of the UIScrollView.
What is the callback that gets triggered? I tried viewWillAppear, but it does not seem to get called.
Thanks. :)
I have an application built with the MinGW C++ compiler that works something like grep - acommand looks something like this:
myapp -e '.*' *.txt
where the thing that comes after the -e switch is a regex, and the thing after that is file name pattern. It seems that MinGW automatically expands (globs in UNIX terms) the command line so my regex gets mangled. I can turn this behaviour off, I discovered, by setting the global variable _CRT_glob to zero. This will be fine for bash and other sensible shell users, as the shell will expand the file pattern. For MS cmd.exe users however, it looks like I will have to expand the file pattern myself.
So my question - does anyone know of a globbing library (or facility in MinGW) to do partial command line expansion? I'm aware of the _setargv feature of the Windows CRT, but that expands the full command line. Please note I've seen this question, but it really does not address partial expansion.
I am trying to have a title bar appear when the user clicks on a box. It works perfectly in I.E. 8.0 but not at all in firefox 3.6.3.
HTML
[code]
@import url('style.css');
blah blah blah
save changes
[/code]
Javascript
[code]
$(document).ready(function(){
$("#edit2").live('click',function(){
if($("#menu").length == 0){
$("#edit2").before('');
}
if($("#menu2").length == 0){
$("#edit2").after('');
}
this.contentEditable = true;
this.focus();
});
$("#edit2").live('blur',function(){
$("#menu").remove();
//$("#menu2").remove();
this.contentEditable = false;
});
});
[/code]
Could anyone suggest why it's not working? I have managed to use similar code to add/remove new table rows in both browser but I just can't see why this doesn't also work.
I have a flash application (a game) and it needs to pass data to a php page to save the user, and the user's score. However I don't want the user to be able to alter the score him/herself or to initial a scoring without using the application.
What is the best way to do this?
Apologies for the rather vague nature of this question, I've never been taught programming and Google is rather useless to a self-help guy like me in this case as the key words are pretty ambiguous.
I am writing a couple of functions that encode and decode a list of options into a Long so they can easily be passed around the application, you know this kind of thing:
1 - Apple
2 - Orange
4 - Banana
8 - Plum
etc.
In this case the number 11 would represent Apple, Orange & Plum.
I've got it working but I see this used all the time so assume there is a common name for the technique, and no doubt all sorts of best practice and clever algorithms that are at the moment just out of my reach.