Daily Archives

Articles indexed Thursday April 8 2010

Page 27/125 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Is it an MD5 digest in this Python script?

    - by brilliant
    Hello, I am trying to understand this simple hashlib code in Python that has been given to me the other day on "Stackoverflow": import hashlib m = hashlib.md5() m.update("Nobody inspects") m.update(" the spammish repetition here") m.digest() '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' m.digest_size 16 m.block_size 64 print m I thought that "print m" would show me the MD5 digest of the phrase: "Nobody inspects the spammish repetition here", but as a result I got this line on my local host: <md5 HASH object @ 01806220> Strange, when I refreshed the page, I got another line: <md5 HASH object @ 018062E0> and every time when I refresh it, I get another value: md5 HASH object @ 017F8AE0 md5 HASH object @ 01806220 md5 HASH object @ 01806360 md5 HASH object @ 01806400 md5 HASH object @ 01806220 Why is it so? I guess, what I have in each line flowing "@" is not really a digest. Then, what is it? And how can I display MD5 digest here in this code? My python version is Python 2.5 and the framework I am currently using is webapp (I have downloaded it together with SDK from "Google App Engine")

    Read the article

  • Why do pure virtual base classes get direct access to static data members while derived instances do

    - by Shamster
    I've created a simple pair of classes. One is pure virtual with a static data member, and the other is derived from the base, as follows: #include <iostream> template <class T> class Base { public: Base (const T _member) { member = _member; } static T member; virtual void Print () const = 0; }; template <class T> T Base<T>::member; template <class T> void Base<T>::Print () const { std::cout << "Base: " << member << std::endl; } template <class T> class Derived : public Base<T> { public: Derived (const T _member) : Base<T>(_member) { } virtual void Print () const { std::cout << "Derived: " << this->member << std::endl; } }; I've found from this relationship that when I need access to the static data member in the base class, I can call it with direct access as if it were a regular, non-static class member. i.e. - the Base::Print() method does not require a this- modifier. However, the derived class does require the this-member indirect access syntax. I don't understand why this is. Both class methods are accessing the same static data, so why does the derived class need further specification? A simple call to test it is: int main () { Derived<double> dd (7.0); dd.Print(); return 0; } which prints the expected "Derived: 7"

    Read the article

  • Posting a JSON array to webservice in Android

    - by Sam
    I am having some problems with what should be a rather simple task. I simply need a JSON array with a single JSON object within it to be posted to my webservice. The entire URL request needs to be formatted like this: http://www.myserver.com/myservice.php?location_data=[{"key1":"val1","key2":"val2"....}] I cannot for the life of me figure out how to append the 'location_data' bit using HttpPost. Here is a code snippet to demonstrate the HTTP connection method I am using: HttpClient hClient = new DefaultHttpClient(); HttpPost hPost = new HttpPost(url); try { hPost.setEntity(new StringEntity(string)); hPost.setHeader("Accept", "application/json"); hPost.setHeader("Content-type", "application/json"); //execute request HttpResponse response = (HttpResponse) hClient.execute(hPost); HttpEntity entity = response.getEntity(); I don't have any syntax errors, and my code is accessing the server fine, just not in the exact format the server needs. Any help on how to format my request to look like how I need it would be greatly appreciated!

    Read the article

  • xslt reading multiple instances of a tag

    - by shashank saket
    hello, my xml file is smth like this.. now in my xsl sheet i need to retrieve the values of all the "j.0:property" tags.. i am using something like this: </xsl:template> but then it returns the same value 3 times..the value being the value of the first property encountered.. kindly help as to how i can get the value for each property.

    Read the article

  • How can I embed images in an ASP.NET Generated Word File

    - by Nikos Steiakakis
    Hi everyone! I have a quite common problem, as I saw in the various user groups but could not find a suitable answer. What I want to do is generate an ASP.NET page in my website which will have the option of being exported into Microsoft Word .doc format. The method I have used is this: Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=Test.doc"); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/msword"; StringWriter sw = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(sw); Page.RenderControl(htmlWrite); Response.Write(sw.ToString()); Response.End(); However this eventhough it generates a word doc, the images are note embedded in the document, rather they are placed as links. I have looked for a way to do this, but have not found something that actually worked. I would appreciate any help I can get, since this as "last minute" requirement (talk about typical) Thanks

    Read the article

  • Ubuntu + latest samba version, symlinks no longer work on share mounted in windows

    - by Roy Rico
    I just apt-getted (apt-got?) the latest software for my Ubuntu 9.10 linux box, and I noticed that samba was the included in the update. After the install, the symlinks in my home directory no longer work when mounted as a drive in my linux box. They worked literally seconds before I did the update. All my normal directories work just fine. Viewing the directory listing on the command line, all the files, dirs & links have the exact same permissions, yet this is the error I get: Location is not available L:\LinkDir is not accessible. Access is denied. I looked on the forums, and i saw this option for the smb.conf follow symlinks = yes wide symlinks = yes unix extensions = no I put those in, but they had no effect. Has anyone had this problem yet?

    Read the article

  • ?????????????Oracle Demantra??????????

    - by mamoru.kobayashi
    ???????????????????????????????????????Oracle Demantra 7.3(????·?????7.3)?????????????? ?Oracle Demantra 7.3?????·??????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????? ?????????????? ????????????????????? ????????? ??????? ???????????? ????(????) ????????????????

    Read the article

  • Problem to cretate dynamic radio button in flex.

    - by nemade-vipin
    hi friends, I am creating the flex ARI application in which I am accessing the webservice method this method is returning me a childList.I am accessing it in my flex appliction using the Array object in my action script code.Now I want to cretate one flex page in which I get child list with radio button.I have done it using Arraycollection in which i put all the child name.Now I am getting each child name in mxml using the Repeater component in mxml.But I have problem is that I am getting the only list of child name.I also want to get child id for to set value for each radio button. how can I refer same childname and it's id for radio button using same Arraycollection list.my code is import mx.controls.*; [Bindable] private var childName:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; [Bindable] private var childObj:Child; public var user:SBTSWebService; public function initApp():void { user = new SBTSWebService(); user.addSBTSWebServiceFaultEventListener(handleFaults); } public function displayString():void { // Instantiate a new Entry object. var newEntry:GetSBTSMobileAuthentication = new GetSBTSMobileAuthentication(); newEntry.mobile=mobileno.text; newEntry.password=password.text; user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); user.getSBTSMobileAuthentication(newEntry); } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null) { if(event.result._return > 0) { var UserId:int = event.result._return; getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } public function getChildList(userId:int):void { var childEntry:GetSBTSMobileChildrenInfo = new GetSBTSMobileChildrenInfo(); childEntry.UserId = userId; user.addgetSBTSMobileChildrenInfoEventListener(sbtsChildrenInfoResult); user.getSBTSMobileChildrenInfo(childEntry); } public function sbtsChildrenInfoResult(event:GetSBTSMobileChildrenInfoResultEvent):void { if(event.result != null && event.result._return!=null) { arrayOfchild = event.result._return as Array; photoFeed = new ArrayCollection(arrayOfchild); childName = new ArrayCollection(); for( var count:int=0;count<photoFeed.length;count++) { childObj = photoFeed.getItemAt(count,0) as Child; childName.addItem(childObj.strName); } } } ]]> <mx:Panel width="500" height="300" headerColors="[#000000,#FFFFFF]"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form"> <mx:FormItem label="Mobile NO:"> <mx:TextInput id="mobileno" /> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="displayString()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup" /> <mx:Repeater id="fieldRepeater" dataProvider="{childName}"> <mx:RadioButton groupName="radioGroup" label="{fieldRepeater.currentItem}"/> </mx:Repeater> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Trace Path"> </mx:Form> </mx:TabNavigator> </mx:Panel> please tell me the sol.

    Read the article

  • jQuery each function, getting the data out of it

    - by Ankur
    I am trying to use the jQuery each function (line 5) to display the results of an AJAX call. when I write resultObj.value on line 6 how come I am not getting any data? Am I making a syntax error (I am pretty sure that I must be)? success : function(resultObj) { count = count+1; $(".objHolder").filter("#"+id).append("<table border='1' cellspacing='4' cellpadding='4' class='preTable' id='"+id+"' level='"+count+"'><tr><td class='preItem' id='"+id+"' level='"+count+"'><img src='images/right.jpg' width='16' height='10' /></td><td class='preList'>&nbsp;</td><td class='preHolder' level='"+count+"'>&nbsp;</td></tr></table>"); isClicked[level]="yes"; $.each(resultObj, function(index, value){ $(".preHolder").filter("#"+id).append(resultObj.value); }); } });

    Read the article

  • Questions about .NET CollectionEditor type

    - by smwikipedia
    Who can tell me the internal working mechanism of a CollectionEditor in plain English? I have implemented every virtual function and step into each of them. Still got no clue of its intended algorithm. I searched the web and found tons of compaints about the CollectionEditor type, and even bugs. I am kind of thinking of the CollectionEditor as a total mess.

    Read the article

  • android : listview customization

    - by Puneet kaur
    hi, it is possible to have single listview with 2 or more columns ,which is operatable with paging property (i.e. at a time listview will show only 4 items in single column and on press of right arrow it will show next 4 items ).. can u please tell me he procedure to implement it or any idea. Thanks puneet

    Read the article

  • Why are most really fast servers written in C instead of C++?

    - by orokusaki
    I'm trying to decide which to learn and I've read all the "Which is better" questions/arguments, so I thought I'd get your take on something more specific. Is there a platform dependency issue that C++ developers run into with such applications? Or, is it because there are more C developers out there than C++? I also noticed that many more third party C modules exist for Python even thought C++ modules are supported. From what I've read on different threads the consensus is that C++ is easier and faster to write, and runs just as fast. Am I missing something really big. Examples: NGINX APE (comet server) Apache

    Read the article

  • array interleaving problem

    - by Matt
    I was looking for something over the web when I came across this question. Have no idea of how to solve it. Help me out please. Suppose we have an array a1,a2,... ,an, b1,b2,..., bn How to change this array to a1,b1,a2,b2, ..., an,bn in O(n) time and in O(1) space.

    Read the article

  • Generate fixed length hash in python for url parameter

    - by LeRoy
    I am working in python on appengine. I am trying to create what is equivalent to the "v" value in the youtube url's (http://www.youtube.com/watch?v=XhMN0wlITLk) for retrieving specific entities. The datastore auto generates a key but it is way too long (34 digits). I have experimented with hashlib to build my own, but again I get a long string. I would like to keep it to under 11 digits (I am not dealing with a huge number of entities) and letters and numbers are acceptable. It seems like there should be a pretty standard solution. I am probably just missing it.

    Read the article

  • User Controls Importing Problem (asp.net)(vb)

    - by Phil
    I have this class that contains vars for db connection; Public Shared s As String Public Shared con As String = WebConfigurationManager.ConnectionStrings("foo").ToString() Public Shared c As New SqlConnection(con) Public Shared x As New SqlCommand(s, c) I import this to my page like this; Imports DBVars I'm then able to access these vars from my page. But if I try to import them into a user control the variables are not available. Am I making an error or is this expected? Thanks.

    Read the article

  • How to debug a bundle in XCode?

    - by Paperflyer
    I wrote a nice little program. At some point, it is required to load a bundle with some additional functionality. I, too, am the author of the bundle, so I have the source code and Xcode-projects for both the main application and the bundle. Until now, I simply dragged the bundle into the resources-folder in the main application, which works fine for running it, but I can't debug it (and of course there is an error in it). Is there a way to set up Xcode so that I can debug the bundle?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >