Skip to main content

Posts

Showing posts from February 20, 2012

Remotely accessing web server, and connecting to local mysql (via php)

I am trying to connect to my local mysql server via php. so my code looks as follows: $con = mysql_connect("localhost", "user", "password"); mysql_select_db("database", $con) or die('ERROR 4'); ok, we've all seen that before. So when I run this PHP script on the machine with the mysql database, everything runs fine. But once I access this script remotely (on the server, with the local mysql database) it cannot connect to the database. Is there any way to make it so the PHP code connects to the mysql database via a local reference? Or do I need to look into connecting to the mysql database through an IP address? edit: To clarify, when I access the script on the server from somewhere else, it doesn't work edit 2: When I check the error log it states "Call to undefined function mysql_connect()"

Error when load library of zend framework

I using library of Zend Framework and code php (no using struct zend, only use library of zend framework), when I load library of zend is error: Fatal error: require_once() [function.require]: Failed opening required 'Zend/Search/Lucene/Storage/File/Filesystem.php' (include_path='.;C:\php\pear;C:\wamp\www\Zend') in C:\wamp\www\...\Zend\Search\Lucene\Storage\Directory\Filesystem.php on line 349 I put library of Zend in C:\wamp\www\Zend I call library of Zend in code php here: ini_set("include_path", ini_get("include_path") . ";C:\\wamp\\www\\Zend"); require_once 'Zend/Search/Lucene.php'; How to load library of zend in this case ?

What"s wrong with this PHP Regex code?

The x modifier code in this tutorial Php regex tutorial gives me the following error: Warning: preg_match() [function.preg-match]: Unknown modifier ' ' in C:\xampp\htdocs\validation\test.php on line 16 Pattern not found What's wrong with it? <?php // create a string $string = 'sex'."\n".'at'."\n".'noon'."\n".'taxes'."\n"; // create our regex using comments and store the regex // in a variable to be used with preg_match $regex =" / # opening double quote ^ # caret means beginning of the string noon # the pattern to match /imx "; // look for a match if(preg_match($regex, $string)) { echo 'Pattern Found'; } else { echo 'Pattern not found'; } ?>

jQuery Mobile Form Date Input Format

I've got a simple form as part of a jQuery Mobile site which includes a date field: <input type="date" name="contactNewInspectionDate" id="contactNewInspectionDate" /> I'm trying to establish the format of what is submitted for these type="date" fields. So far I'm seeing something like this: 2012-02-16 for February 16, 2012. Is YYYY-MM-DD always the submitted format for these date fields? If that is the case can anyone recommend the easiest way to parse the individual elements out using PHP (Date, Month, Year)? Many thanks, Steve

Dynamic Dropdown Menu if-else does not become dynamic

I have two dropdown menus, im having trouble with making the options for the second dropwdown to be dependent on the choice on the first dropdown menu. $city=""; $formcontent =<<<EOT <label>Assumed Bitten City : </label> <select name="AssumedBittenCity" id="AssumedBittenCity"> <option value="0">Make a Selection</option> <option value="Caloocan City">Caloocan City</option> <option value="Las Pi&#241;as City">Las Pi&#241;as City</option> <option value="Makati City">Makati City</option> <option value="Malabon City">Malabon City</option> <option value="Mandaluyong City">Mandaulyong City</option>

How to put different host entries on same linux server, for different virtual hosts? [closed]

The setup is : Two applications are hosted on same linux server using vhost entries in apache configuration. say : http://greatapp.example.com and http://superapp.example.com Both of them have a functionality where they do server side http request to a third url (using php cURL / file_get_contents) : http://apis.example.com Now there is a host entry of an in the hosts file '/etc/hosts' xx.xx.xx.xx apis.example.com This is only intended for greatapp.example.com code, and not for superapp.example.com. How to configure the server such that greatapps.example.com uses the host entry, but superapp.example.com uses the public ip of apis.example.com

Symfony routing is not working?

I am working on existing project. I have following two URLs http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/2/?hcid=147 2nd URL is working fine but 1st URL is giving me following error : Unable to find a matching route to generate url for params "array ( 'action' => 'showChapter', 'module' => 'course', 'courseowner' => 'myUserName', 'coursename' => 'myCourseName', 'courseid' => '150', 'chaptername' => 'myChapterName',)"., referer: http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 I have following entry in routing.yml : course_chapter: url: /:sf_culture/course/:courseowner/:coursename/:courseid/:chaptername/:chapterid/:page/:pageid/ param: { module: course, action: showChapter }

pear.php.net is down. How to install mirror?

I was trying to install new packages in my PHP environment development via PEAR but as shown below: File http://pear.php.net:80/rest/p/packages.xml not valid (received: HTTP/1.1 404 Not Found) it seems that php.net is down. I tried to setup a mirror since us.php.net which Digg hosts with the following command: pear config-set preferred_mirror us.pear.php.net which gives the following error: Channel Mirror "us.pear.php.net" does not exist in your registry for channel "pear.php.net". Attempt to run "pear channel-update pear.php.net" if you believe this mirror should exist as you may have outdated channel information. Of course I can't update the channel since php.net is down. Does anyone know how i should proceed?

PHP: Merge/delete arrays with same subkeys

I'm writing a database class for my site based on a fluent interface. First, I collect all the meaningful terms then put them into the "stack", which is basically an array. Then, I sort them in order that they would appear in an actual SQL query. const stmt_select = 1; const stmt_insert = 2; const stmt_delete = 3; const sql_select = 10; const sql_from = 11; const sql_into = 12; const sql_where = 13; const sql_join = 14; const sql_group = 15; const sql_order = 16; const sql_limit = 17; For example, the query below (although in a total rubbish order, and purposely trying to throw the class off): Query::Select('name', 'age', 'height') ->Order('a') ->From('table') ->From('asd') ->Group('a') ->Execute(); .. produces: Array ( [0] => Array ( [0] => 10 [1] => Array ( [0] => name [1]

how to remote database mysql XAMPP from another computer?

the script of connection = <? $server = "192.168.0.167"; $username = "root"; $password = ""; $database = "dbbook"; mysql_connect($server,$username,$password) or die("Koneksi gagal"); mysql_select_db($database) or die("Database tidak bisa dibuka"); ?> and i had add this script on my.cnf file after [mysqld] = bind-address=192.168.0.167 but it didnt work with the following caption mycomputer.mshome.net is not allowed to connect to this Mysql server Please help me.How to remote database mysql XAMPP from another computer ?

joomla 1.7 user registration customization issue

-> i want to try new user registration customization. -> for that i create form and call hidden variable through function from controller. -> in controller save function i write this code but some function which not work in 1.7 so create problem here. function register_save() { global $mainframe; $db =& JFactory::getDBO(); // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); //clean request $post = JRequest::get( 'post' ); $post['username'] = JRequest::getVar('username', '', 'post', 'username'); $post['password'] = JRequest::getVar('password', '', 'post', 'string', JREQUEST_ALLOWRAW); $post['password2'] = JRequest::getVar('password2', '', 'post', 'string', JREQUEST_ALLOWRAW); // get the redirect $return = JURI::base(); // do a password safety check

how to write this in PHP [closed]

I have this function code from VB6 and want to write to PHP Function itung_part() rcrddet.MoveFirst total = 0 before = 0 road = 0 visit = 0 If rcrddet!Status = "Pending" Then pengali = 1 Select Case rcrddet!visit Case 0 kali_before = 1 kali_road = 0 kali_visit = 0 Case 1 kali_before = 0 kali_road = 1 kali_visit = 0 Case 2 kali_before = 0 kali_road = 1 kali_visit = 0 Case 3 kali_before = 0 kali_road = 0 kali_visit = 1 End Select Else pengali = 0 kali_before = 0 kali_road = 0 kali_visit = 0 End If awal = Format(rcrddet!DATE1, "mm/dd/yyyy") & " " & rcrddet!TIME1 rcrddet.MoveNext Do Until rcrddet.EOF akhir = Format(rcrddet!DATE1, "mm/dd/yyyy") & " " & rcrddet!TIME1 interval = DateDiff("n", awal, akhir) total = total + (pengali * interval) before = before + (kali_before * interval) road = road + (kali_road * interval) visit = visit + (kali_visit

I"ve got a stack with this API Respond data

lets to the point : I've got respond code like this string(141) "000|0123456789| 0987654321|namexxxxx|081xxxx|10000|1231231230|namexxxxxx|081xxxx|10000|3213213210|namaxxxxxx|081xxxx|10000 |page|total_page" (i've make it bold for the main data) There's 3 main data. The main data is dynamic( the ID is in front of name, the last data is "10000"), and max is 10 loop's. How i can take the main data with PHP ? Help :)

Why type hinting based on method return type doesn"t work in PhpStorm?

I'm switching from Eclipse to PhpStorm and noticed that I won't get type hinting in this code: class Bar{ public function hintMe(){...} } class Foo{ private $bars = array(); /** * @return Bar */ public function getBar($pos){ $this->bars[$x] = new Bar(); return $this->bars[$x]; } } $foo = new Foo(); $bar = $foo->getBar(2); $bar->__hint-should-appear__ In Eclipse when typing $bar-> hinting will be active, but not in PhpStorm. Any ideas why it doesn't work?

Subquery returns more than 1 row

All I have two table 1st table is : wp_frm_item_metas 2nd table is : wp_frm_items Now i want to meta_value based on wp_frm_items table fields value. I fired this sql. it returns me Subquery returns more than 1 row SELECT meta_value FROM wp_frm_item_metas WHERE (item_id=( SELECT id FROM wp_frm_items WHERE form_id ='9' && user_id='1') && field_id=128) I tried this solution SELECT meta_value FROM wp_frm_item_metas WHERE (item_id=( SELECT count(*) as c,id FROM wp_frm_items WHERE form_id ='9' && user_id='1') && field_id=128 && c > 1) ORDER BY c DESC It returns this error Operand should contain 1 column(s) My code is foreach($fp_id_c as $kid=>$id) { if (!$id or ($logged_in && !$user_ID)) return; $id = (int)$id; //echo $logged_in.'-'.(int)$user_ID; if ($logged_in){

sending data to a webserver with NSMutableURLRequest

I am creating an iOS app that needs to send a post to a php script. the php script then takes these values and updates an xml file. I can't for the life of me figure out why this wouldn't work... Also how could I test to see whether or not the php script is actually receiving data? Here is my objective-c code: NSDate *now = [NSDate date]; NSString *rowString = [NSString stringWithFormat:@"%d", index.row]; // format the date NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"HH:mm"]; NSString *time = [formatter stringFromDate:now]; NSString *post = [NSString stringWithFormat:@"newTime=%@&newValue=%@&locationIndex=%@", time, coverAsString, rowString]; NSLog(@"the post data is %@ with row string: %@", post, rowString); NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

How to place an "inline image&rdquo; in form before upload?

I want to allow users to write a post and upload images inline through out it (like a CMS blog post). Writing the file upload script is easy. But allowing a "place inline" button / functionality is proving to be tricky. Is there a tutorial on how to do this? I'm messing around with some javascript to allow it. Also, I'm not sure if I should display the inline tmp image or actually upload the file (with a separate upload button than the full form upload button) and show the actual image loc before the form is submitted? I'm all over the place on this right now. How should I go about this? Thank you.

photo upload field error in magento

Below i have added the code to upload photo. Well i have added photo upload in edit.phtml page only but in register.phtml magento showing error. Can anyone fix it ? error message : Wrong entity ID. app/design/frontend/default/blue/template/customer/form/register.phtml <?php $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $attr2 = array ( 'position' => 1, 'is_required'=>1 ); $setup->addAttribute(’61’, ‘photo’, $attr2); ?> app/design/frontend/default/blue/template/customer/form/edit.phtml <li class="field"> <label for="photo" class="required " ><?php echo $this->__('Photo') ?></label> <div class="required-entry input-text"> <input type="file" name="photo" id="photo" value="<?php echo $this->htmlEscape($this->getCustomer()->getPhoto()) ?>" title="<?php ech

Java applet AWT-EventQueue-1 Exception

I wrote a simple implementation of the Game of life with java applets. Here's is the source code for the Applet and the Model. When I click the button to get the next iteration these Exceptions get thrown. Z:\GameOfLife>appletviewer driver.html Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 65 at GameOfLifeApplet.mouseClicked(GameOfLifeApplet.java:63) at java.awt.Component.processMouseEvent(Component.java:6219) at java.awt.Component.processEvent(Component.java:5981) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4583) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4413) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre ad.java:269) at java.awt.E

Java REGEX Operator precedence

I have a few strings: john doe happy george smith is happy Here's my Regular Expression: ([a-zA-Z ]+) (is happy|happy) I need group 1 to always be a name like "john doe" or "george smith" I need group 2 to always be either "happy" or "is happy" Right now, "george smith is happy" always matches up to "george smith is" and "happy" ... when I really want it to be "george smith" and "is happy" How do I make "is happy" have precedence over "happy"?

Top losers and gainers of the day

How do i get the top losers or gainers on a particular day in java.(20 minute delay is not an issue). Is it possible to do this using yahoo finance. I am able to get information on a particular stock but none for the top losers on gainers of the day. I have checked out Stock Market API - Top Gainers/Losers but it doesnt seem to have a full answer.

Showing Currency from correct direction in editText

Hell guys, i am using following code to input currency in editText 3 amount.addTextChangedListener(new CurrencyTextWatcher()); public class CurrencyTextWatcher implements TextWatcher { boolean mEditing; public CurrencyTextWatcher() { mEditing = false; } public synchronized void afterTextChanged(Editable s) { if(!mEditing) { mEditing = true; String digits = s.toString().replaceAll("\\D", ""); NumberFormat nf = NumberFormat.getCurrencyInstance(); try{ String formatted = nf.format(Double.parseDouble(digits)/100); s.replace(0, s.length(), formatted); } catch (NumberFormatException nfe) { s.clear(); } mEditing = false; } } The proble

JAVA - swt, Do we have to remake the bytecode for each OS?

Java Desktop application: SWT vs. Swing "requires native libraries for each supported system" Does it mean that i have to rebuild my project for each OS, switching each time the libraries to the corresponding target's native library? Or is there a way to actually put every libraries required by different OS in the same project? I just started Java, as my second language, sorry if this question look stupid.

Is there any Relation between Iterator.hasNext and for-each loop

I was using JProfiler for profiling of my application, as it is a huge application so I am very aware of its performance and efficiency. It was taking too long so I replace all Iterator.hasNext with for-each but when I am seeing in the JProfilers CPU view it is showing me Iterator.hasNext method called where I am using for-each . Why does so? Is there any relation between these two? Here is the example code : List<Map<String, Object>> mapList = jdbcTemplate .queryForList(MAP.SELECT_ALL); for (Map<String, Object> map : mapList) { list.add(fillPreferenceMaster(preferenceMasterMap)); }

Trying to Implement "Caret Browsing&rdquo; Using JavaFX 2

I'm trying to write an application using JavaFX 2.0 that includes a web browser control that allows a user to navigate through the text and images on a HTML page using only the keyboard -- basically like "caret browsing" in Internet Explorer. The goal is to be able to select bits of text or images and copy them to a variable for further manipulation without using a mouse. I took a look at the HTMLEditor control here: http://docs.oracle.com/javafx/2.0/ui_controls/editor.htm#CHDBEGDD but I don't need any editing capability cluttering up the UI, and the documentation says: The formatting toolbars are provided in the implementation of the component. You cannot toggle their visibility. WebView seems like a logical choice ( http://docs.oracle.com/javafx/2.0/webview/jfxpub-webview.htm ), but I'm not sure how to get a cursor onto the page. Any advice would be appreciated.

Java Variable References when using Lists

Just a thought question here. In C++, I could do the following: vector<vector<string> > data; // add data into data //.. data[0].push_back( "somedata" ); And I would expect somedata to get written to the vector array because the [] notation gives me access to the object by reference. What about in Java? If I: List<List<String>> data = new ArrayList<List<String>>(); // add data into data //.. data.get(0).add( "somedata" ); Would this actually write somedata into the data object? Or would it create a new copy of the element at data(0), add somedata to that, and then that object disappears into GC sometime down the line?

How should I be creating classes when doing TDD

I have started doing TDD and I am unsure if I am doing it correctly. I have made a Question class and a QuestionTest. The Question class has an addAnswer method that takes an instance of the Answer class. Now, should I be creating only the class Answer and use the default constructor. Or should I be making the Answer class and also provide the constructor with parameters? question.addAnswer(new Answer("Some", "Argument that I know I will use")); or: question.addAnswer(new Answer()); It is probably the last one where I write only as much as I need to proceed.

Android Gallery view with images saved in sqlite as blob

i need to show images from sqlite database into gridview or gallery view. this is the code for displaying on a single view: mMain = (ImageView) findViewById(R.id.ivMain); byte[] blob = imgs.getBytes(); //there is a method that will return the bytes from the database ByteArrayInputStream inputStream = new ByteArrayInputStream(blob); Bitmap bitmap = BitmapFactory.decodeStream(inputStream); mMain.setImageBitmap(bitmap); i have the android tutorial for grid view but it gets the image from file // references to our images private Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3 ... } is there a way to populate the gridview from the sqlite database?

How to download a doc file using struts 2.x

I have a requirement that i have to download a .Doc file from batabase and show to the user. So I am using struts 2.x and SQL server as my database. so we ever user enters a password , user can able to see his doc file which is going to fetch from the database. Please can you provide me a sample example for the above requirement. Thanks in Advance.

gson deserialization with multiple FieldNamingPolicy

I have a JSON document returned to me from a third party that looks like this: { "data" : { "events" : [ { "Ages" : "", "AttendingCount" : 0 } ] } } i am attempting to deserialize this into Java objects using gson: Response EventCollection data EventCollection Collection events Event String ages; int attendingCount; gson is my preferred json parser at this stage of the project The json field names are in different formats. In the context of gson's FieldNamingPolicy Response.data could be parsed with FieldNamingPolicy.IDENTITY however the nested Event.ages field would need to use FieldNamingPolicy.UPPER_CAMEL_CASE Is there a way i can use multiple FieldNamingPolicy configs per gson.fromJson call? thanks

Creating 9 subarrays from a 9x9 2d array java

Hello I need help creating 9 sub arrays of 3x3 dimensions from a 9x9 array. I've seen that stackOverflow had a similar question already asked but unfortunately it was in c++. Can anyone point me in the right direction of how to create a a sub array. Edit: had aa similar changed to had a similar public static void Validate(final int[][] sudokuBoard) { int width = sudokuBoard[0].length; int height = sudokuBoard.length; for(int i = 0; i < width; i++) if(!IsValidRow(sudokuBoard, i, width)) { System.out.print("(Row)" + i + " Error Detected \n"); //Do something - The row has repetitions } for(int j = 0; j < height; j++) if(!IsValidColumn(sudokuBoard, j, height)) { System.out.print(" (Column)" + j + " Error Detected \n"); //Do something - The columns has repetitions } // for(int i=0; i<3; i++) // if(!isBlock1Valid(sudokuB

for-loop and object control

I'm trying to add elements to an array. The elements of the array are of a custom class called variable. In the problematic for loop, it basically adds the last element trying to be added throughout the loop. Any help would be appreciated! import java.util.*; public class ThiefsDilemma2{ public static void main(String[] args){ ArrayList values = new ArrayList(args.length/2); Valuable[] array = new Valuable[args.length/2]; if(args.length%2 ==1){ int weight = Integer.parseInt(args[args.length-1]); boolean room = true; int tracker = 0; //problem!!!! Adds the last element throughout the loop for(int i = 0; i < args.length/2; i++){ array[i] = new Valuable( Integer.parseInt(args[args.length/2+i]), Integer.parseInt(args[i])); } for(int i = 0; i < args.length/2; i++){ System.out.println(array[i]); } while(values.size() > 0 && room){ int lightest = 1000

JTabbedPane: change tab size when change tab title

I have a a JTabbedPane myTab within my JFrame. Its first tab has a title of "old title". I want to change the title dynamically, so I use this code to set: myTab.setTitleAt(myTab.getSelectedIndex(), "my full new title"); And somehow my new title is longer than my old one. The problem is, the tab size does not change, and it does not display the new title fully, only "my full n...". And if I click on the tab, suddenly the tab can show full new title. I already tried this code too, to set the title name: myTab.setTabComponentAt(myTab.getSelectedIndex(), new JLabel("my full new title")); This code can help me change the tab size accordingly to the new title. But the cross (x) to close tab is not there anymore. Does anyone know how to change the tab size when changing tab title, but still keep the close tab option? Thank you and much appreciate!

How do you set up javapns (push notifications for iOS)?

I have had a look at the documentation / wiki for javapns. http://code.google.com/p/javapns/ Unfortunately, what should be obvious is anything but obvious to me. How do I set up a working push notification server? As in, there's a .jar file, but I would appreciate more info than that. Do I need to run this in Tomcat? Is there a working example?' Thanks.

SOAP : API"s to use in java for Interoperatability

Question may be simple / asked many times. Could not get the Correct answer (including google--yahoo). Question : Which DataType API's( List, Array ,String,int...) of Java / J2EE sdk to use for SOAP messages so as the same can be consumed by Other Languages ( eg : - php/.net/cfx/.....) with regards karthik

Creating xml based on html using xslt in java

Please help me i am doing project of file conversion that is converting xml to html using xsl in java and also i need to convert html to xml using the xsl. my first process is got over.but i structed in second part of conversion.. Is there is any possibility to do that conversion.I will tell you the exact flow of the first process... This is my sample xml file: tabl.xml: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xml" href="testxsl.xsl"?> <mainpara> <epigraph> <para>Though successful research demands a deep <emphasis role="italic">trained</emphasis> <emphasis role="italic">taught</emphasis> to regard. </para> <para>Kuhn (1976, p. 66)</para> </epigraph> <blockquote role="extract"> <para>Though successful research demands a deep commitment to the status quo. <emphasis role="italic">train

creating a Java Proxy Server that accepts HTTPS

i already have a working HTTP proxy server that can handle multiple HTTP request. now my problem is how do I handle https request? here's a simplified code i am using: class Daemon { public static void main(String[] args) { ServerSocket cDaemonSocket = new ServerSocket(3128); while(true) { try { Socket ClientSocket = cDaemonSocket.accept(); (new ClientHandler(ClientSocket )).start(); }catch(Exception e) { } } } } and the ClientHandler class ClientHandler extends Thread { private Socket socket = null; private Socket remoteSocket = null; private HTTPReqHeader request = null; ClientHandler(Socket socket) { this.socket = socket; request = new HTTPReqHeader(); request.parse(socket); // I read and parse the HTTP request here } public void run() { if(!request.isSecure() )

eclipse RCP product - custom config.ini

My eclipse RCP (3.7) application is currently in a good shape, in which product can be exported successfully for multiple platforms and runs just fine. What I need is to change some properties in config.ini file, in particular osgi.instance.area.default and osgi.configuration.area . In the configuration tab of eclipse product editor, I check Use an existing config.ini file and select the config.ini I created inside the same project hosting the product (and the core feature) definition. To create the custom config.ini, I just took the one generated in a previous export, and added above properties. What happens is that after exporting the product, config.ini is still auto-generated in configuration/config.ini , without my edits. What am I missing? This is how my product definition looks like: <?xml version="1.0" encoding="UTF-8"?> <?pde version="3.5"?> <product name="MyApp" id="it.myapp.product" application=

database design for tracking the location. NEED HELP!! :(

im currently doing the database design for an android app like friend finder. im doing the coding in java and i'l be using google maps to display the location. location is tracked using gps. the functionality would be: -locate u n all ur friends on the map -give alerts when a friend is somewhere close like within 5km -hide users location from certain people. this is what ive come up with so far.. location ---------- location id location name user --------- user id and rest of the details friendlist ------------ userid friendid distance_frm_user users_location [visible, nt visible] type [friend, rejected] if the user accepts a friend request then 2 rows r created in the friendlist table one with userid=1 and friendid=2 second with userid=2 and friendid=1 and the attribute "type" in the friendlist wud be set to friend for both the rows in the friendlist table. users_location is set to visible if the user wants that friend to see his location. my ques

Netty + jQuery , use url + query string is ok , but use JQuery receive nothing?

my web side html code like this $.ajax({ type : "Get", url : "http://localhost:9999", data : {"servicename" :"test"}, timeout:100000, beforeSend: function(xhr) { }, success: function(rs) { alert("[success]" + rs); }, complete:function(XMLHttpRequest,textStatus){ if(XMLHttpRequest.readyState=="4"){ alert("response text= " + XMLHttpRequest.responseText); } }, error: function(XMLHttpRequest,textStatus,errorThrown){ alert("error:"+textStatus); } }); I Use url querystring ( http://localhost:9999?servicename="test" ) can receive data ,but i use jquery reveive nothing. jquery version is 1.4. Netty Server is run example HttpSnoopServer.java.