Search Results

Search found 22 results on 1 pages for 'yong'.

Page 1/1 | 1 

  • Ruby net:LDAP returns "code = 53 message = Unwilling to perform" error

    - by Yong
    Hi, I am getting this error "code = 53, message = Unwilling to perform" while I am traversing the eDirectory treebase = "ou=Users,o=MTC". My ruby script can read about 126 entries from eDirectory and then it stops and prints out this error. I do not have any clue of why this is happening. I am using the ruby net:LDAP library version 0.0.4. The following is an excerpt of the code. require 'rubygems' require 'net/ldap' ldap = Net::LDAP.new :host => "10.121.121.112", :port => 389, :auth => {:method => :simple, :username => "cn=abc,ou=Users,o=MTC", :password => "123" } filter = Net::LDAP::Filter.eq( "mail", "*mtc.ca.gov" ) treebase = "ou=Users,o=MTC" attrs = ["mail", "uid", "cn", "ou", "fullname"] i = 0 ldap.search( :base => treebase, :attributes => attrs, :filter => filter ) do |entry| puts "DN: #{entry.dn}" i += 1 entry.each do |attribute, values| puts " #{attribute}:" values.each do |value| puts " --->#{value}" end end end puts "Total #{i} entries found." p ldap.get_operation_result Here is the output and the error at the end. Thank you very much for your help. DN: cn=uvogle,ou=Users,o=MTC mail: --->[email protected] fullname: --->Ursula Vogler ou: --->Legislation and Public Affairs dn: --->cn=uvogle,ou=Users,o=MTC cn: --->uvogle Total 126 entries found. OpenStruct code=53, message="Unwilling to perform"

    Read the article

  • JDOM Parser and Namespace how to get clean Content

    - by senzacionale
    MY xml: <?xml version="1.0"?> <company xmlns="http://www.xx.com/xx"> <staff> <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary> </staff> <staff> <firstname>low</firstname> <lastname>yin fong</lastname> <nickname>fong fong</nickname> <salary>200000</salary> </staff> </company> Reader in = new StringReader(message); Document document = (Document)saxBuilder.build(in); Element rootNode = document.getRootElement(); List<?> list = rootNode.getChildren("staff", Namespace.getNamespace("xmlns="http://www.infonova.com/MediationFeed"")); XMLOutputter outp = new XMLOutputter(); outp.setFormat(Format.getCompactFormat()); for (int ii = 0; ii < list.size(); ii++) { Element node = (Element)list.get(ii); StringWriter sw = new StringWriter(); outp.output(node.getContent(), sw); StringBuffer sb = sw.getBuffer(); String xml = sb.toString(); } but my xml object looks like this <firstname xmlns="http://www.xx.com/xx">yong</firstname> <lastname xmlns="http://www.xx.com/xx">mook kim</lastname> <nickname xmlns="http://www.xx.com/xx">mkyong</nickname> <salary xmlns="http://www.xx.com/xx">100000</salary> every elemnt has namespace. why this? i don't want namespace... I want the same output as is in xml example like <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary>

    Read the article

  • YouTube API @ Google I/O 2010

    Kuan Yong, Gareth McSorley and I -- representing Product Management, Engineering, and Developer Relations, respectively -- were happy to present a YouTube API session at this year’s Google...

    Read the article

  • replace symbol in javascript

    - by Jin Yong
    Does anyone know how can I replace this 2 symbol below from the string into code? ' left single quotation mark into ‘ ' right single quotation mark into ’ " left double quotation mark into “ " right double quotation mark into ”

    Read the article

  • What couse this error?? Fatal error: Call to undefined function mcrypt_encrypt()

    - by Jin Yong
    Does Anyone know whcy this error message display (Call to undefined function mcrypt_encrypt() ) when I run the following code below? Am I missing some steps perhaps any setting in PHP I have to do before this code can work? $key = 'password to (en/de)crypt'; $string = 'string to be encrypted'; $test = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)));

    Read the article

  • How to do SoapClient on php

    - by Jin Yong
    I'm new in soapclient, I have tried to do some study online and also tried coding on soap, but seem this is still not working to me, just wandering anyone here can point out and perhaps give me some example how can I actually use the soapclint to get the feedback from the following web server? POST /webservices/tempconvert.asmx HTTP/1.1 Host: www.w3schools.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/CelsiusToFahrenheit" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <CelsiusToFahrenheit xmlns="http://tempuri.org/"> <Celsius>string</Celsius> </CelsiusToFahrenheit> </soap:Body> </soap:Envelope> HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <CelsiusToFahrenheitResponse xmlns="http://tempuri.org/"> <CelsiusToFahrenheitResult>string</CelsiusToFahrenheitResult> </CelsiusToFahrenheitResponse> </soap:Body> </soap:Envelope> <?php $url = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL"; $client = new SoapClient($url); ?> What should I do for the next steps so that I can get the respond ??

    Read the article

  • What causes this error? Fatal error: Call to undefined function mcrypt_encrypt()

    - by Jin Yong
    Does anyone know why this error message: (Call to undefined function mcrypt_encrypt() ) displays when I run the following code below? Am I missing some steps perhaps any setting in PHP I have to do before this code can work? $key = 'password to (en/de)crypt'; $string = 'string to be encrypted'; $test = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)));

    Read the article

  • Add objects in relationship not work using MagicalRecord saveWithBlock

    - by yong ho
    The code to perform a save block: [MagicalRecord saveWithBlock:^(NSManagedObjectContext *localContext) { for (NSDictionary *stockDict in objects) { NSString *name = stockDict[@"name"]; Stock *stock = [Stock MR_createInContext:localContext]; stock.name = name; NSArray *categories = stockDict[@"categories"]; if ([categories count] > 0) { for (NSDictionary *categoryObject in categories) { NSString *categoryId = categoryObject[@"_id"]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"categoryId == %@", categoryId]; NSArray *matches = [StockCategory MR_findAllWithPredicate:predicate inContext:localContext]; NSLog(@"%@", matches); if ([matches count] > 0) { StockCategory *cat = [matches objectAtIndex:0]; [stock addCategoriesObject:cat]; } } } } } completion:^(BOOL success, NSError *error) { }]; The Stock Model: @class StockCategory; @interface Stock : NSManagedObject @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSSet *categories; @end @interface Stock (CoreDataGeneratedAccessors) - (void)addCategoriesObject:(StockCategory *)value; - (void)removeCategoriesObject:(StockCategory *)value; - (void)addCategories:(NSSet *)values; - (void)removeCategories:(NSSet *)values; @end The json look like this: [ { "name": "iPad mini ", "categories": [ { "name": "iPad", "_id": "538c655fae9b3e1502fc5c9e", "__v": 0, "createdDate": "2014-06-02T11:51:59.433Z" } ], }, { "name": "iPad Air ", "categories": [ { "name": "iPad", "_id": "538c655fae9b3e1502fc5c9e", "__v": 0, "createdDate": "2014-06-02T11:51:59.433Z" } ], } ] Open the core data pro, You can see only stock with the name of "iPad air" has it's categories saved. I just can't figure out why. You can see in the saveWithBlock part, I first find in the context for the same _id as in json, and then add the category object in the relationship. It's working, but not all of them. Why is that?

    Read the article

  • soap client not working in php

    - by Jin Yong
    I tried to write a code in php to call a web server to add a client details, however, it's seem not working for me and display the following error: Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in D:\www\web_server.php:15 Stack trace: #0 [internal function]: SoapClient-_doRequest('_call('AddClient', Array) #2 D:\www\web_server.php(15): SoapClient-AddClientArray) #3 {main} thrown in D:\www\web_server.php on line 15 Refer below for the code that I wrote in php: <s:element name="AddClient"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="clientRequest" type="tns:ClientRequest"/> </s:sequence> </s:complexType> </s:element> - <s:complexType name="ClientRequest"> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="customerCode" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="customerFullName" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="ref" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="phoneNumber" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="Date" type="s:string"/> </s:sequence> </s:complexType> <s:element name="AddClientResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="AddClientResult" type="tns:clientResponse"/> <s:element minOccurs="0" maxOccurs="1" name="response" type="tns:ServiceResponse"/> </s:sequence> </s:complexType> </s:element> - <s:complexType name="ClientResponse"> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="testNumber" type="s:string"/> </s:sequence> </s:complexType> <?php $client = new SoapClient($url); $result = $client->AddClient(array('username' => 'test','password'=>'testing','clientRequest'=>array('customerCode'=>'18743','customerFullName'=>'Gaby Smith','ref'=>'','phoneNumber'=>'0413496525','Date'=>'12/04/2013'))); echo $result->AddClientResponse; ?> Does anyone where I gone wrong for this code?

    Read the article

  • encrypt array in php

    - by Jin Yong
    Does anyone know do there have any way that I can encrypt the array in php?? for example: $arr_value = array("1","2","3","4"); any way that I can encrypt $arr_value, also decrypt it later ini php?

    Read the article

  • mcrypt_decrypt return strange code

    - by Jin Yong
    I tried to encrypt an array then decrypt it back to string by calling a function, it's seem return the correct value if I does all encrypt and decrypt at once time in the function, however, if I return the encrypt value, then call the function again to decrypt it will return me some strange code. Exmaple: public main() { $dataArray = array("one"=>1, "two"=>2, "three"=>3); $a = $this->encryptDecryptInfo(json_encode($dataArray),$this->key); var_dump($a); } public function encryptDecryptInfo($text,$key) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, $text= base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CFB, $iv)); return mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($text), MCRYPT_MODE_CFB, $iv); } This will return me the correct value which is string(27) "{"one":1,"two":2,"three":3}" Exmaple 2: public main() { $dataArray = array("one"=>1, "two"=>2, "three"=>3); $a = $this->encryptDecryptInfo(json_encode($dataArray),$this->key,"encrypt"); $b = $this->encryptDecryptInfo($a,$this->key,"decrypt"); var_dump($b); } public function encryptDecryptInfo($text,$key,$type) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB), MCRYPT_RAND); if($type == "encrypt") return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CFB, $iv)); else return mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($text), MCRYPT_MODE_CFB, $iv); } However if I do my code in this way, it will return me strange value which is like this string(27) "?ÔérôŸY éXgíœÈÐN*é౜CµÖ" .Deos anyone know why this is happen?

    Read the article

  • TileGroup does not fill the container

    - by Luo Yong
    I put a TileGroup in a BorderContainer and set the width to 100%, but the content in the TileGroup did not fill the parent container, it leaves a big chunk of blank on the right part. The code is: <s:BorderContainer width="100%" height="100%"> <s:TileGroup width="100%" requestedColumnCount="2"> <s:Button> button1 </s:Button> <s:Button> button2 </s:Button> <s:Button> button3 </s:Button> </s:TileGroup> </s:BorderContainer> and the result is like this: http://i.minus.com/iN39P7Us4cBm1.png The width is already set to 100% but it does not work. Is there any way to make the TileGroup fill the container like GridLayout does in Java swing? http://www.java2s.com/Code/JavaImages/GridLayoutPane.PNG Thank you very much.

    Read the article

  • How to remove keypress from input with jquery?

    - by Jin Yong
    Does anyone know how can I remove keypress from input with jquery? Example: <input type="text" keypress="cleanMsg()" id="cleanMsg" name="cleanMsg"> How can I removed the keypress="cleanMsg()" from input by using jquery? Or anyway to replace keypress="cleanMsg()" to keypress="Msg()"??

    Read the article

  • .trim() in javascript not working in IE

    - by Jin Yong
    I tired to apply .trim() in javascript for one of my code. it's working fine under mozilla, but error display once I tried in IE8, does anyone know what is going on here? anyway I can make it work in IE? code: var ID = document.getElementByID('rep_id').value.trim(); error display: Message: Object doesn't support this property or method Line: 604 Char: 2 Code: 0 URI: http://test.localhost/test.js

    Read the article

  • ActAs and OnBehalfOf support in WIF

    I discussed a time ago how WIF supported a new WS-Trust 1.4 element, ActAs, and how that element could be used for authentication delegation.  The thing is that there is another feature in WS-Trust 1.4 that also becomes handy for this kind of scenario, and I did not mention in that last post, OnBehalfOf. Shiung Yong wrote an excellent summary about the difference of these two new features in this forum thread. He basically commented the following, An ActAs RST element indicates that the requestor...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Google I/O 2010 - YouTube API uploads: Tips & best practices

    Google I/O 2010 - YouTube API uploads: Tips & best practices Google I/O 2010 - YouTube API uploads: Tools, tips, and best practices Google APIs 201 Jeffrey Posnick, Gareth McSorley, Kuan Yong Are you integrating YouTube upload functionality into your mobile, desktop, or web app? Learn about Android and iPhone upload best practices, resuming interrupted YouTube uploads, and the YouTube Direct embeddable iframe for soliciting uploads on your existing web pages. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 11 0 ratings Time: 55:27 More in Science & Technology

    Read the article

  • Google I/O 2010 - What's the hubbub about Google Buzz APIs?

    Google I/O 2010 - What's the hubbub about Google Buzz APIs? Google I/O 2010 - What's the hubbub about Google Buzz APIs? Social Web 101 Chris Chabot, Marco Kaiser (Seesmic), Ming Yong (Socialwok) Google Buzz is a new way to share updates, photos, videos and more, and start conversations about the things you find interesting. In this session, we'll take a deep dive into building with the Buzz APIs and the open standards it uses, such as ActivityStrea.ms, PubSubHubbub, OAuth, Salmon and WebFinger. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 3 0 ratings Time: 50:37 More in Science & Technology

    Read the article

  • Help A Hacker: Give ‘Em The Windows Source Code

    - by Ken Cox [MVP]
    The announcement of another Windows megapatch reminded me of a WikiLeaks story about Microsoft Windows that hasn’t attracted much attention. Alarmingly, we learn that the hackers have the Windows source code to study and test for vulnerabilities. Chinese hackers used the knowledge to breach Google’s accounts and servers: “In 2003, the CNITSEC signed a Government Security Program (GSP) international agreement with Microsoft that allowed select companies such as TOPSEC access to Microsoft source code in order to secure the Windows platform” “CNITSEC enterprises has recruited Chinese hackers in support of nationally-funded "network attack scientific research projects." From June 2002 to March 2003, TOPSEC employed a known Chinese hacker, Lin Yong (a.k.a. Lion and owner of the Honker Union of China), as senior security service engineer…” Windows is widely seen as unsecurable. It doesn’t help that Chinese government-funded hackers are probing the source code for vulnerabilities. It seems odd that people who didn’t write the code can find vulnerabilities faster than the owners of the code. Perhaps the U.S. government should hire its own hackers to go over the same Windows source code and then tell Microsoft how to secure its product?

    Read the article

  • ActAs and OnBehalfOf support in WIF

    - by cibrax
    I discussed a time ago how WIF supported a new WS-Trust 1.4 element, “ActAs”, and how that element could be used for authentication delegation.  The thing is that there is another feature in WS-Trust 1.4 that also becomes handy for this kind of scenario, and I did not mention in that last post, “OnBehalfOf”. Shiung Yong wrote an excellent summary about the difference of these two new features in this forum thread. He basically commented the following, “An ActAs RST element indicates that the requestor wants a token that contains claims about two distinct entities: the requestor, and an external entity represented by the token in the ActAs element. An OnBehalfOf RST element indicates that the requestor wants a token that contains claims only about one entity: the external entity represented by the token in the OnBehalfOf element. In short, ActAs feature is typically used in scenarios that require composite delegation, where the final recipient of the issued token can inspect the entire delegation chain and see not just the client, but all intermediaries to perform access control, auditing and other related activities based on the whole identity delegation chain. The ActAs feature is commonly used in multi-tiered systems to authenticate and pass information about identities between the tiers without having to pass this information at the application/business logic layer. OnBehalfOf feature is used in scenarios where only the identity of the original client is important and is effectively the same as identity impersonation feature available in the Windows OS today. When the OnBehalfOf is used the final recipient of the issued token can only see claims about the original client, and the information about intermediaries is not preserved. One common pattern where OnBehalfOf feature is used is the proxy pattern where the client cannot access the STS directly but is instead communicating through a proxy gateway. The proxy gateway authenticates the caller and puts information about him into the OnBehalfOf element of the RST message that it then sends to the real STS for processing. The resulting token is going to contain only claims related to the client of the proxy, making the proxy completely transparent and not visible to the receiver of the issued token.” Going back to WIF, “ActAs” and “OnBehalfOf” are both supported as extensions methods in the WCF client channel. public static class ChannelFactoryOperations {   public static T CreateChannelActingAs<T>(this ChannelFactory<T> factory,     SecurityToken actAs);     public static T CreateChannelOnBehalfOf<T>(this ChannelFactory<T> factory,     SecurityToken onBehalfOf); } Both methods receive the security token with the identity of the original caller.

    Read the article

1