Daily Archives

Articles indexed Monday June 14 2010

Page 22/108 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Client configuration to consume WCF JSON web service

    - by Grzenio
    Hi, I have configured the web service to use Json as described on this blog: http://www.west-wind.com/weblog/posts/164419.aspx and various other blogs, but I couldn't create a client to consume this service. I tried various things, but invariably I got meaningless exceptions. What is the correct way to implement the (WCF I should add) client?

    Read the article

  • Printing the address of a struct object

    - by bdhar
    I have a struct like this typedef struct _somestruct { int a; int b; }SOMESTRUCT,*LPSOMESTRUCT; I am creating an object for the struct and trying to print it's address like this int main() { LPSOMESTRUCT val = (LPSOMESTRUCT)malloc(sizeof(SOMESTRUCT)); printf("0%x\n", val); return 0; } ..and I get this warning warning C4313: 'printf' : '%x' in format string conflicts with argument 1 of type 'LPSOMESTRUCT' So, I tried to cast the address to int like this printf("0%x\n", static_cast<int>(val)); But I get this error: error C2440: 'static_cast' : cannot convert from 'LPSOMESTRUCT' to 'int' What am I missing here? How to avoid this warning? Thanks.

    Read the article

  • jquery attr problem

    - by shanmugam
    function rotateimg(ulid,showid,linkid) { var cur = $("#"+ulid+" li.current"); var nxt = cur.next("li"); if (nxt.length == 0) { nxt = $("#"+ulid+" li:first"); } cur.removeClass("current"); nxt.addClass("current"); var img_value=nxt.attr("id").substring(11); var img_title=nxt.attr("title"); var img_id = nxt.attr("name").substring(17); var alink=nxt.attr("rel"); $("#"+linkid).attr("href",alink); $("#"+ulid+" li div").css("background-color", "#000000"); nxt.find("div").css("background-color", "#333333"); setimg(img_value,showid,img_title); } var lt=setInterval("rotateimg('lnews','show_images_event','lnewslink')", 5000); in this code. i am getting this error nxt.attr("id") is undefined pls any one help me

    Read the article

  • getting the url of the page and the url of the selected hyperlink

    - by Dan
    Hi This is pretty hard to explain but i'll give it a shot. Working with Safari to create an extension as is now possible with Safari 5 - how would I go about getting the URL of the current page with using JavaScript and the Safari API? I would also like to be able to get a hyperlink that is selected. For instance in Safari when you right click on a hyperlink and it says open in a new tab, open in a window etc - clicking opens that hyperlink. What part of the API is used to get access to the link itself, and how does it know its a link in the first place? I hope thats clear enough. Thanks

    Read the article

  • Why does this Assert fail?

    - by Peter Goras
    IEnumerable<ReportReceipt> expected = new List<ReportReceipt>() { new ReportReceipt("fileName1","Hash1","some comments1") }; IEnumerable<ReportReceipt> actual = new List<ReportReceipt>() { new ReportReceipt("fileName1","Hash1","some comments1") }; Assert.IsTrue(expected.SequenceEqual(actual)); I'm running MSTest with VS 2008.

    Read the article

  • Bare-metal virtualisation for the desktop

    - by Andrew Taylor
    Hi, Does anyone have any knowledge about bare-metal virtualisation products? I'm interested in building a new desktop machine for home, I've been looking at the Intel Quad Core processors and I'd like to put 8GB of RAM in there, but, it got me thinking about making the most out of the available resources. I thought if I could get a good 64bit machine, put some bare-metal virtualisation on, then have a primary system, I'd also be able to bring up some extra virtualised systems as and when I needed. I know most of the bare metal systems are designed for the server market, but, is there anything out there that works well for a desktop. What are the caveats? I presume I won't be able to make the most out of any video cards I could buy, what about just getting a decent screen resolution, will this be a problem? I run a single 24" screen. What about DVD/CD writing, is this possible? I'd like to re-rip my CD collection, I was hoping the quad 64Bit goodness would help me out with the encoding. I currently use a Mac and couldn't go back to windows so that leaves Linux, I was thinking a primary OS of ubuntu. Does this make a difference? Thanks Andrew

    Read the article

  • Winform problem with autoscrolling of the ScrollableControl

    - by BobLim
    Hi guys, I have a problem with autoscrolling of the .NET ScrollableControl. I am using TabPage which inherited from ScrollableControl in the class hierarachy. Every TabPage object has only 1 UserControl derived control which draws the landscape; there is no other control on the tabpage. The usage of my application is its user will drag a file from windows explorer and drop into the TabPage. As more files are dragged and dropped, the UserControl derived control will expand to accomodate the drawing of the files and auto-scrolling will be enabled. The problem I have is when I mouse-click on the UserControl control, the vertical and horizontal scrollbars will scroll back to (0,0) position. I want the vertical and horizontal scrollbars to remain at their original scrolled position whatever happens. I believe when I mouse-click on the UserControl control, the UserControl control comes into focus and that triggers the auto-scrolling to (0,0) position. Please help. Thanks in advance!

    Read the article

  • Json_encode Charset problem

    - by Oguz
    When I use json_encode to encode my multi lingual strings , It also changes special characters.What should I do to keep them same . For example <? echo json_encode(array('sügçö')); It returns something like ["\u015f\u00fc\u011f\u00e7\u00f6"] But I want ["sügçö"]

    Read the article

  • jQuery script to move an attribute of matched element to their children

    - by UserControl
    I have a set of anchors like <a class="lb" href="#">text</a> <a class="lb" href="#" style="width:200px">text</a> <a class="lb" href="#" style="color: reen; width:200px">text</a> that needs to be transformed to the following: <a class="lb" href="#"><span>text</span></a> <a class="lb" href="#"><span style="width:200px">text</span></a> <a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a> I have no problem creating child span but don't know how to move parent's width styling.

    Read the article

  • how to identify an html div id which starts with some pattern using jquery

    - by dexter
    normally we use something like this to identify Id using jquery $("#PhotoId").html('some html'); here we get the html (say div) having id 'PhotoId' what if the id is partially dynamic i.e. lets say there are multiple photoes each id would start with 'PhotoId' EX. $("#PhotoId" + result.Id).html(some html'); NOW, i want to identify html(div) which starts with 'PhotoId' how can it be done

    Read the article

  • HTTP basic authentication via URL doesn't work with Firefox?

    - by Peter
    Normally you can login to sites that require HTTP basic authentication by passing the username and password in the URL, e.g.: http://myusername:[email protected]/mypath On my Linux machine, I could access this website without problems with my Konqueror browser as well as with my Opera browser. But with Firefox it doesn't work? It always displays the "Authentication Required" dialog window? Any ideas why it would work with the other browsers but not with Firefox? Peter

    Read the article

  • If .net sha1 hash expects a byte array, and php sha1() wants a string, can I match the results?

    - by lynn
    I have a set of bytes I want to apply an sha1 hash to. One hash will be in .net, the other in PHP. Then I'll test to see if they match. In .net, you can create a byte array and use sha.ComputeHash(). byte[] data = new byte[DATA_SIZE]; byte[] result; SHA1 sha = new SHA1CryptoServiceProvider(); // This is one implementation of the abstract class SHA1. result = sha.ComputeHash(data); In PHP, you call sha1($string). I can't do anything about the .net side of the code, but how can I get the same hash out of PHP that .net will generate? Please note: I am ONLY able to work on the PHP side of this. The .net stuff is fixed and can't be modified. Thanks!

    Read the article

  • Letting Wcf data service implement another contract

    - by Wasim
    Hi all , I have a wcf data service with the standart configuration . I want to add another functionality to it , so I built a contract interface and let my wcf data service implements it . Now I see in the service the InitializeService method , and the contract interface methods . When I come to connect the service , I get an error , that there is no end point declared to the contract I added . How can do that ? examples ? links ? I choosed to add the contract interface to the wcf data service and not adding another service , because the client application uses the wcf data service generated objects , and I want to use the same obkject to make operations not related to data , for more coplex processing . If I do the methods in another service , then I have types incompatibility . Thanks in advance ...

    Read the article

  • how to dissect string values

    - by nhoyti
    how can i dissect or retrieve string values Here's the sample code that im working on now private void SplitStrings() { List<string> listvalues = new List<string>(); listvalues = (List<string>)Session["mylist"]; string[] strvalues = listvalues.ToArray(); for (int x = 0; x < strvalues.Length; x++) { } } now that i'am able to retrieve List values in my session, how can i separately get the values of each list using foreach or for statement?

    Read the article

  • cos result incorrect

    - by suk
    I import "math.h". I can use the cos function, but when I execute cos(0.321139585333178) the result is 0.948876 If I use the calculator in Mac or use a normal calculator, the result is 0.999984292347418 Can anyone help me to solve that problem?

    Read the article

  • Consistency in placing operator functions

    - by wrongusername
    I have a class like this: class A { ...private functions, variables, etc... public: ...some public functions and variables... A operator * (double); A operator / (double); A operator * (A); ...and lots of other operators } However, I want to also be able to do stuff like 2 * A instead of only being allowed to do A * 2, and so I would need functions like these outside of the class: A operator * (double, A); A operator / (double, A); ...etc... Should I put all these operators outside of the class for consistency, or should I keep half inside and half outside?

    Read the article

  • jQuery script to move an attribute of matched elements to their children

    - by UserControl
    I have a set of anchors like <a class="lb" href="#">text</a> <a class="lb" href="#" style="width:200px">text</a> <a class="lb" href="#" style="color: reen; width:200px">text</a> that needs to be transformed to the following: <a class="lb" href="#"><span>text</span></a> <a class="lb" href="#"><span style="width:200px">text</span></a> <a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a> I have no problem creating child span but don't know how to move parent's width styling.

    Read the article

  • Model-View-Controller in JavaScript

    - by Casey Hope
    tl;dr: How does one implement MVC in JavaScript in a clean way? I'm trying to implement MVC in JavaScript. I have googled and reorganized with my code countless times but have not found a suitable solution. (The code just doesn't "feel right".) Here's how I'm going about it right now. It's incredibly complicated and is a pain to work with (but still better than the pile of code I had before). It has ugly workarounds that sort of defeat the purpose of MVC. And behold, the mess, if you're really brave: // Create a "main model" var main = Model0(); function Model0() { // Create an associated view and store its methods in "view" var view = View0(); // Create a submodel and pass it a function // that will "subviewify" the submodel's view var model1 = Model1(function (subview) { view.subviewify(subview); }); // Return model methods that can be used by // the controller (the onchange handlers) return { 'updateModel1': function (newValue) { model1.update(newValue); } }; } function Model1(makeSubView) { var info = ''; // Make an associated view and attach the view // to the parent view using the passed function var view = View1(); makeSubView(view.__view); // Dirty dirty // Return model methods that can be used by // the parent model (and so the controller) return { 'update': function (newValue) { info = newValue; // Notify the view of the new information view.events.value(info); } }; } function View0() { var thing = document.getElementById('theDiv'); var input = document.getElementById('theInput'); // This is the "controller", bear with me input.onchange = function () { // Ugly, uses a global to contact the model main.updateModel1(this.value); }; return { 'events': {}, // Adds a subview to this view. 'subviewify': function (subview) { thing.appendChild(subview); } }; } // This is a subview. function View1() { var element = document.createElement('div'); return { 'events': { // When the value changes this is // called so the view can be updated 'value': function (newValue) { element.innerHTML = newValue; } }, // ..Expose the DOM representation of the subview // so it can be attached to a parent view '__view': element }; } How does one implement MVC in JavaScript in a cleaner way? How can I improve this system? Or is this the completely wrong way to go, should I follow another pattern?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >