How to decode and store the following code values like city, zip, region etc into separate variables in PHP a:14:{s:4:"city";s:7:"Bijapur";s:3:"zip";s:6:"586101";s:3:"lat";d:16.83329963684082;s:2:"as";s:33:"AS9829 National Internet Backbone";s:5:"query";s:13:"59.99.192.232";s:6:"region";s:2:"KA";s:10:"regionName";s:9:"Karnataka";s:3:"org";s:4:"BSNL";s:3:"isp";s:4:"BSNL";s:7:"country";s:5:"India";s:11:"countryCode";s:2:"IN";s:3:"lon";d:75.69999694824219;s:6:"status";s:7:"success";s:8:"timezone";s:12:"Asia/Kolkata";}

Member Avatar
Member Avatar
+0 forum 3

my json decode script throwing error i.e. Error : DATA FETCH My code: <?php $api_url = '{"msg":"SUCCESS","msg_text":"DATA FETCH","data":[{"sn":1,"mob_no":"9602858989","date":"06-May-2015","time":"12:02:33 PM"},{"sn":2,"mob_no":"7795055128","date":"06-May-2015","time":"12:29:44 PM"}]}'; $output = file_get_contents($api_url); if($output=="") { echo "No output received"; } else { $arr_output = json_decode($output, true); if(isset($arr_output['msg'])) { $msg = $arr_output['msg']; $msg_text = $arr_output['msg_text']; if($msg == "success") { if(isset($arr_output['data'])) { $arr_data = $arr_output['data']; // above array will contain your data print_r($arr_data); } else { echo "Json data not set !!"; } } else { echo "Error : ".$msg_text; } } else { echo "Output not set !!"; } } ?>

Member Avatar
Member Avatar
+0 forum 2

Hello , today I was developing a short url system and I created this class to help me encode / decode integer (id) to small string. That way for example “Ac” means 3674 . Because I believe that it may be helpful to others too I share it here. Notice that in the constructing string each char can be present only once. Example of usage: $numCode = new Model_Utils_Numcode("4fFiV8kRTvm5MPNDcyO1dg7lr20Qtn3X6pKLZUqaEsxCwubGYIzhSWJojHeA9B"); $num = 3674; $encoded = $numCode->encode($num); echo "<br/> $num encoded = $encoded"; // 3674 encoded = Ac echo "<br/> $encoded decoded = ".$numCode->decode($encoded); // Ac decoded = 3674 Class: class Model_Utils_Numcode …

Member Avatar
Member Avatar
+2 forum 5

Im using wunderground.com weather API. I got JSON to an array.buy i coudlnt echo arrray one by one. these the sample code to i used in my site `$json = file_get_contents("http://api.wunderground.com/api/ab3f1aefcf4033d4/forecast10day/q/CA/San_Francisco.json"); //$phparrya = json_decode($jsonstring); $array_json=json_decode($json, true); print_r($obj);`

Member Avatar
Member Avatar
+0 forum 4

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going on. How do I XMLEncode those two ArrayLists, **a** and **b**, so that all the information within them branching all the way down, is saved? (Also, is it possible to save both of these to the same file please?)

Member Avatar
Member Avatar
+0 forum 4

This is a homework problem. I have 5 modules to encode and decode a txt file using the huffman algorithm along with. I'm having some difficulty with where to start with the decoding module. I have to do the decoding using the functions from binary.h and binary.cpp and my priority queues . Here is the code I have. //pqueue.h////// #include <iostream> #include <stdlib.h> #include "tree.h" using namespace std; typedef int PQPriorityType; struct PriorityQueue { int* ptr; PriorityQueue() { ptr = NULL; } }; void insert(PriorityQueue& q, PQItemType v, PQPriorityType priority); void remove(PriorityQueue& q, PQItemType &v, PQPriorityType &priority); void update(PriorityQueue& q, …

Member Avatar
+0 forum 0

I'm making a word descramble program for http://www.hackthissite.org/missions/prog/1/ . I think I have a lot of this code correct but I dont know how to read each indivdual character in the scrambled string and compare it to the letters in the unscrabled string from the word list. #include <iostream> #include <fstream> #include <string> using namespace std; int main() { int i, l; string x, y; do { fstream file; file.open("text.txt",ios::in|ios::out|ios::nocreate); getline(file, x[i]); //read a string i++; }while(file); file.close; do { fstream file; file.open("scramble.txt",iso::in|ios::out|ios::nocreate); getline(file, x[i]); //read a string l++; }while(file); file.close; while(i >= 0) { if (x.length() == y.length()) { …

Member Avatar
Member Avatar
+0 forum 8

The goal of my assignment is to create a program that takes a string of words and encodes or decodes the string using a simple substitution cypher. I've gotten a decent amount done but I am stuck at the part where I actually have to encrypt and decrypt using the offset that the user has input. This is what I have, can anybody lend a hand? #include <stdio.h> int main () { #include <stdio.h> int main () { char alpha[26] = "abcdefghijklmnop"; char ALPHA[26] = "ABCDEFGHIJKLMNOP"; char*encrypt(char*str,int offset); char*decrypt(char*str,int offset); int option; int offset; char str; char toencode(int alpha, int …

Member Avatar
Member Avatar
+0 forum 1

Just a different way to extract desired data from an xml code string.

Member Avatar
Member Avatar
+3 forum 5

I need to encode the sending messages/data(not MD5)and then they will be decoded on the other side. Codes have to be in android libraries not in java. Is there any code or information that may help me around internet? Thx all for your help.

Member Avatar
Member Avatar
+0 forum 1

Hey, I am trying to make a C++ scrit that decodes and encodes tenis polar (search it on Google if you don't know what it is). After some testing, I found out my application stops after the strcpy. Any help? The code is below. Thanks! #include <iostream> #include <cstring> #include <string> using namespace std; void encode(string str); int main() { string scode; cout << "Code: "; cin >> scode; encode(scode); } void encode(string str) { char * ccode, * ncode = new char [str.size()+1]; int str_size = str.size()+1; strcpy (ccode, str.c_str()); for (int i=0; i!=str_size; i++) { if (ccode[i]=='t') { …

Member Avatar
Member Avatar
+0 forum 18

Is there a workaround to this as decode does not seem to allow the use of greater than equal sign I am trying to show the comment for any days beyond 4 days, not just 4 days. [CODE] decode(shipdate-orderdate,'4','This is unsatisfactory!') comments from orders [/CODE] Thanks in advance! :)

Member Avatar
Member Avatar
+0 forum 2

hi, i'm passing a content in a div tag to a url. url looks like [ICODE]index.php?content=texttext &amp; text text[/ICODE] .. so on. when i'm trying to display this string, php only displays content up to &amp; it stops at '&' how can i stop this? i need to change this string so php will recognize it. thanks in advance.

Member Avatar
+0 forum 0

[b]C# text encoder / decoder[/b] [i][u]Please note that I'm not a professional developer and I might make simple mistakes because of that, I'm also dutch, and 14 years old, so please keep that in mind before you reply. thank you C:[/i][/u] My brother came up with an idea to encode and decode text with a username and a password... When you encode something you have to decode it with the same username and password again, otherwise it will give you a very strange character text. We're going to use this for our website, and I thought it might be nice …

Member Avatar
Member Avatar
+0 forum 1

i am trying to implement ceaser's cipher in the generic sense by rotating the digits by integer n.i am trying to find out the pairs of these from a file containing words. this what i've done so far, [CODE] from string import * d = dict() l = [] for i in range(ord('a'),ord('z')+1): d[i] = chr(i) def rotate_word(word,n): global l for i in range(0,len(word)): k = ord(word[i]) + n if k > ord('z'): k %= ord('z') elif k < ord('a'): k = k % ord('a') + ord('z') - ord('a') + 1 l.append(chr(k)) return "".join(l) wordlist = [] c_wordlist = [] …

Member Avatar
Member Avatar
+0 forum 11

does anybody know to decode this url: [URL="http://frodo.wi.mit.edu/primer3/"]http://frodo.wi.mit.edu/primer3/[/URL] [ICODE]<form action="/cgi-bin/primer3-web-cgi-bin-0.4.0/primer3_results.cgi" method="post" enctype="x-www-form-urlencoded"> [/ICODE] i tried this: [ICODE] [url]http://frodo.wi.mit.edu/cgi-bin/primer3-web-cgi-bin-0.4.0/primer3_results.cgi?PRIMER_MISPRIMING_LIBRARY=&SEQUENCE=CATTAAAAGAAATATGCTTGCAATTAAAAAAAAAAAAAGCCAACTATTTCTGAGGCCAGTCTCGGTGTCCAGGAGTCTTCAAGGCAA&MUST_XLATE_PICK_LEFT=1&MUST_XLATE_PICK_HYB_PROBE=&MUST_XLATE_PICK_RIGHT=1&PRIMER_LEFT_INPUT=&PRIMER_INTERNAL_OLIGO_INPUT=&PRIMER_RIGHT_INPUT=&PRIMER_SEQUENCE_ID=&EXCLUDED_REGION=&PRIMER_PRODUCT_SIZE_RANGE=150-250+100-300+301-400+401-500+501-600+601-700+701-850+851-1000&PRIMER_NUM_RETURN=5&PRIMER_MAX_END_STABILITY=9.0&PRIMER_MAX_MISPRIMING=12.00&PRIMER_PAIR_MAX_MISPRIMING=24.00&PRIMER_MAX_TEMPLATE_MISPRIMING=12.00&PRIMER_PAIR_MAX_TEMPLATE_MISPRIMING=24.00&PRIMER_MIN_SIZE=18&PRIMER_OPT_SIZE=20&PRIMER_MAX_SIZE=27&PRIMER_MIN_TM=57.0&PRIMER_OPT_TM=60.0&PRIMER_MAX_TM=63.0&PRIMER_MAX_DIFF_TM=100.0&PRIMER_TM_SANTALUCIA=1&PRIMER_PRODUCT_MIN_TM=&PRIMER_PRODUCT_OPT_TM=&PRIMER_PRODUCT_MAX_TM=&PRIMER_MIN_GC=20.0&PRIMER_OPT_GC_PERCENT=&PRIMER_MAX_GC=80.0&PRIMER_SELF_ANY=8.00&PRIMER_SELF_END=3.00&PRIMER_NUM_NS_ACCEPTED=0&PRIMER_MAX_POLY_X=5&PRIMER_INSIDE_PENALTY=&PRIMER_OUTSIDE_PENALTY=&PRIMER_FIRST_BASE_INDEX=1&PRIMER_GC_CLAMP=0&PRIMER_SALT_CONC=50.0&PRIMER_SALT_CORRECTIONS=0&PRIMER_DIVALENT_CONC=0.0&PRIMER_DNTP_CONC=0.0&PRIMER_DNA_CONC=50.0&PRIMER_LIBERAL_BAS=1&MUST_XLATE_PRINT_INPUT=1&PRIMER_LIB_AMBIGUITY_CODES_CONSENSUS=0&PRIMER_LOWERCASE_MASKING=1&PRIMER_SEQUENCE_QUALITY=+&PRIMER_MIN_QUALITY=0&PRIMER_MIN_END_QUALITY=0&PRIMER_QUALITY_RANGE_MIN=0&PRIMER_QUALITY_RANGE_MAX=100&PRIMER_WT_TM_LT=1.0&PRIMER_WT_TM_GT=1.0&PRIMER_WT_SIZE_LT=1.0&PRIMER_WT_SIZE_GT=1.0&PRIMER_WT_GC_PERCENT_LT=0.0&PRIMER_WT_GC_PERCENT_GT=0.0&PRIMER_WT_COMPL_ANY=0.0&PRIMER_WT_COMPL_END=0.0&PRIMER_WT_NUM_NS=0.0&PRIMER_WT_REP_SIM=0.0&PRIMER_WT_SEQ_QUAL=0.0&PRIMER_WT_END_QUAL=0.0&PRIMER_WT_POS_PENALTY=0.0&PRIMER_WT_END_STABILITY=0.0&PRIMER_WT_TEMPLATE_MISPRIMING=0.0&PRIMER_PAIR_WT_PRODUCT_SIZE_LT=0.0&PRIMER_PAIR_WT_PRODUCT_SIZE_GT=0.0&PRIMER_PAIR_WT_PRODUCT_TM_LT=0.0&PRIMER_PAIR_WT_PRODUCT_TM_GT=0.0&PRIMER_PAIR_WT_DIFF_TM=0.0&PRIMER_PAIR_WT_COMPL_ANY=0.0&PRIMER_PAIR_WT_COMPL_END=0.0&PRIMER_PAIR_WT_REP_SIM=0.0&PRIMER_PAIR_WT_PR_PENALTY=1.0&PRIMER_PAIR_WT_IO_PENALTY=0.0&PRIMER_PAIR_WT_TEMPLATE_MISPRIMING=0.0&PRIMER_INTERNAL_OLIGO_EXCLUDED_REGION=&PRIMER_INTERNAL_OLIGO_MIN_SIZE=18&PRIMER_INTERNAL_OLIGO_OPT_SIZE=20&PRIMER_INTERNAL_OLIGO_MAX_SIZE=27&PRIMER_INTERNAL_OLIGO_MIN_TM=57.0&PRIMER_INTERNAL_OLIGO_OPT_TM=60.0&PRIMER_INTERNAL_OLIGO_MAX_TM=63.0&PRIMER_INTERNAL_OLIGO_MIN_GC=20.0&PRIMER_INTERNAL_OLIGO_OPT_GC_PERCENT=&PRIMER_INTERNAL_OLIGO_MAX_GC=80.0&PRIMER_INTERNAL_OLIGO_SELF_ANY=12.00&PRIMER_INTERNAL_OLIGO_SELF_END=12.00&PRIMER_INTERNAL_OLIGO_NUM_NS=0&PRIMER_INTERNAL_OLIGO_MAX_POLY_X=5&PRIMER_INTERNAL_OLIGO_MISHYB_LIBRARY=&PRIMER_INTERNAL_OLIGO_MAX_MISHYB=12.00&PRIMER_INTERNAL_OLIGO_MIN_QUALITY=0&PRIMER_INTERNAL_OLIGO_SALT_CONC=50.0&PRIMER_INTERNAL_OLIGO_DNA_CONC=50.0&PRIMER_INTERNAL_OLIGO_DIVALENT_CONC=0.0&PRIMER_INTERNAL_OLIGO_DNTP_CONC=0.0&PRIMER_IO_WT_TM_LT=1.0&PRIMER_IO_WT_TM_GT=1.0&PRIMER_IO_WT_SIZE_LT=1.0&PRIMER_IO_WT_SIZE_GT=1.0&PRIMER_IO_WT_GC_PERCENT_LT=0.0&PRIMER_IO_WT_GC_PERCENT_GT=0.0&PRIMER_IO_WT_COMPL_ANY=0.0&PRIMER_IO_WT_NUM_NS=0.0&PRIMER_IO_WT_REP_SIM=0.0&PRIMER_IO_WT_SEQ_QUAL=0.0[/url] [/ICODE] apparently it doesnt work :( i'm trying to use it for my jsp project any help would be appreciated :) thanks

Member Avatar
Member Avatar
+0 forum 2

hi I downloaded a php script but it is encoded this is the encoded file <?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14}.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};$OOO0O0O00=__FILE__;$OO00O0000=372; eval($OOO0000O0('aWYoITApJE8wMDBPME8wMD0kT09PMDAwTzAwKCRPT08wTzBPMDAsJ3JiJyk7JE8wTzAwME8wMCgkTzAwME8wTzAwLDEwMjQpOyRPME8wMDBPMDAoJE8wMDBPME8wMCw0MDk2KTskT08wME8wME8wPSRPT08wMDAwTzAoJE9PTzAwMDAwTygkTzBPMDBPTzAwKCRPMDAwTzBPMDAsNTE2KSwndW5sb2NranN0ZXZ4cjIwMVJYVkVOT0xDVFNVSktBYUJiRGRGZkdnSGhJaU1tUHBRcVd3WXlaejM0NTY3ODkrLz0nLCdBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvJykpO2V2YWwoJE9PMDBPMDBPMCk7'));return;?> AzDIJjNhAjGPSVbI1Fcw2YRYrEuqrouISjGGvlANUjGYts2FKgGqAlnhTCrbSCDqUCeGSl4bRz9pTCXFAlniAC2yTzWQJgNpTz9PtjSQKdnmUL2GJH2GtsOpJj9FUwnFJzXGewf7ec91ron1ron1roZGKgOHC3eGKjWDTzNheZ9BXfGrXO9Bewqdewtpec91EYn1rc8qrl4dewtmec91EYuqron1rlbfEy91rouqron1vlX1rc8qrc91rouhec8qron1rc8qrlqfEy8qrc8qrouqvVqHAL5mJz2MUH2ySCS4KFtqrOeTOfO0EyWoOk2OVfPnTNedXjXjSfAHVjDeUNZPNsnXKOA3LCGUaFry2ET30ofMxYyHxlAnRf2cXNSsVcGvVyW2Ef9RNOeEOkOLOZDSLgkdTzXGSgAhULIMJjZpJ3nWKH2yACS3asG6rocwrYRZ2FK40VmQewfIvEPgTzWQKzNhec8qron1rc8qrlf7SCSDJlbfEy8qrc8qrc8qvEm=lLGpTzWZSjNhtg2QJg5GT3RpKjDqtdf7lgGpTzWZSjNhtH2GT3OwUCX5xHnhKltI0qIISdbfCyAkOkmdKseISleAtEydtdfvaqhfKseISlu9tlXBXyONLweqKgGftGy7ldXWKHGYSLqb1VudKzOmSL2ytsnwUL2GtjSwJzybKseQSsOFAsrbAzDGKgNbKseQSsOFAcGc1VKfKseISlKd0qhfKgOYtoybJCGYKLWBKCOGKHfheskwaC2GJlf7ldXyJ3XDJseQAwu9tjZ5K3kmCzkgSgOFAjOfC3eQA3rhvEmveseQAwu9tjZ5K3kmCzSGAj2hCz9dUgOFAlbfKgOYvEmvSL2hJwufKg93xE5qKgGFSEmvBRh= what is this encoded system and How I decode it... Please help me...this is very urgent...

Member Avatar
Member Avatar
-3 forum 14

Ok this is so new to me but does anyone have example code that decodes header fields in an IP datagram? or a link to something like the beej's guide....So i need to decode the header from the following example. 0000000 141724 120662 000002 000004 000000 000000 000000 000000 0000020 177777 000000 000001 000000 142167 045720 175323 000001 0000040 000146 000000 000146 000000 010000 177733 120040 006000 0000060 134051 122150 000010 010105 054000 153336 000100 003100 0000100 111425 022620 046250 125514 004701 013000 042602 044146 0000120 164312 036636 030340 014120 010070 161701 000000 025433 0000140 050532 067325 046066 000014 121441 …

Member Avatar
Member Avatar
+0 forum 14

I new to Python and I'm trying to make this script work, I made this in php, but I'd like to know how to do it in python... I'm trying to encode a file with base64 and then decode and write the binary data to a file. [CODE=Python]import base64 binaryfile = open("original.mp3").read() file = open("out.txt", "w") file.write(binaryfile) file.close() base64.encode(open("out.txt"), open("out.b64", "w")) base64.decode(open("out.b64"), open("out.mp3", "w")) print "original:", repr(binaryfile) print "encoded message:", repr(open("out.b64").read()) print "decoded message:", repr(open("out.txt").read()) raw_input("\nPress ENTER to exit")[/CODE] can someone tell me what I'm doing wrong and tell me the proper way to do what I'm looking for

Member Avatar
Member Avatar
+0 forum 1

Hi and I am looking for a compression mechonism that can compress text (just letters and numbers) into binary or all weird symbols. Does anybody know of any good php/mysql codes as I can't get any to work.

Member Avatar
Member Avatar
+0 forum 9

The End.