Search Results

Search found 11140 results on 446 pages for 'side scroller'.

Page 38/446 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • How to make a scroller on a micro-processor/-controller?

    - by Louise
    I would like to write a text scroller on a micro-processor with 4 5x7 displays in ANSI-C. Does anyone know of example source code or anything that can help me get started? Update This is the user manual for the micro-processor board I have. On PDF page 17 is a picture of the board with the displays. The code is written in an IDE called "zds2_Z8Encore493.exe" and then flashed to the micro-controller over serial port. I would like the text to cascade from one to the next to the next column-by-column, so it is smooth.

    Read the article

  • php includes that include another php file

    - by Emma
    I'm getting really muddled up now and my brain hurts! :( lol Root: index.php Includes: cat.php dog.php index includes dog: include("includes/dog.php"); dog includes cat: include("cat.php"); When I run index, for cat it says: A link to the server could not be established Access denied for user ... However, if I run dog, I get no problems... I'm guessing its the path, but i've tried ./includes/cat.php to no joy...

    Read the article

  • Optimized graph drawing for the web

    - by Andreas Petersson
    Having seen some suggestions for graphs, I wonder what's the optimum for my problem. I want to render a directed graph to a servlet/picture that is displayed in the browser. There should be some kind of optimization of position. No dependency to Swing would be preferred. Algorithms are not important, since the structure of the graph is determined by business logic. It would be desired to be able add labels to edges as well. it would be optimal if i can serve this as png/svg. Which library/service would you recommend? clarifications: 1) The question is all about Graphs - like Directed Acyclic Graph - NOT - Charts. 2) flot, Google Charts - cannot plot graphs, only charts, or have i missed something? 3) no i do not need interactivity 4) graphviz would be nice, but the grappa java library is quite outdated and is built upon swing/awt. while it may be theoretically possible to render swing to images, it would not be my favorite way to to so in a server-app. 5) it would be fine to use an online service where the images are not hosted locally. edit: added links to Wikipedia to clarify graph/chart term

    Read the article

  • 401 error when consuming a Web service with HTTP Basic authentication using CXF

    - by seanhodges
    I'm trying to consume a remote Web service that uses HTTP basic authentication, using Apache CXF, within a JUnit test. The error I am getting is: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/services/MyService?wsdl. It failed with: Server returned HTTP response code: 401 for URL: http://localhost:8080/services/MyService?wsdl. at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:133) at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254) at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217) at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165) at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93) at javax.xml.ws.Service.<init>(Service.java:76) at com.wave2.marketplace.importer.impl.adportal.ws.MyServiceService.<init>(MyServiceService.java:37) at com.wave2.marketplace.importer.impl.adportal.MyWSTest.testConsumingTheWS(MyWSTest.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/services/MyService?wsdl at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1269) at java.net.URL.openStream(URL.java:1029) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:793) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:251) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:118) ... 26 more Having read this StackOverflow post, I have attempted to add the auth credentials to my request context, as follows: @Test public void testConsumingTheWS() throws Exception { URL wsdl = new URL("http://localhost:8080/services/MyService?wsdl"); MyServiceService provider = new MyServiceService(wsdl); // <-- Error occurs here MyService service = provider.getMyService(); BindingProvider binding = (BindingProvider)service; binding.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username"); binding.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password"); Ping out = service.getPing(); assertNotNull(out); } However, as my in-line comment indicates, the error is occurring before the BindingProvider code is reached, so the error remains the same. I did have a read of this article and its follow-up, but so far I've had trouble determining how to go about adding the interceptor code without the use of Spring (this is for a JUnit test). How might I go about authenticating against this Web service?

    Read the article

  • UpdatePanel Javascript Error on Adding Clientside Listbox items After postback

    - by DBMaster
    Hi, I have a Dynamic list control of Metabuilder.Webcontrol inside UpdatePanel,I am adding removing Items using Javascript from the list control. It works fine Inside UpdatePanel. I have another control Gridview along with checkbox's which require postback to get populated. Once It gets populated successfully inside update without postback. I checked few rows and wanted to add them into List Control using Javascript. It says "object doesn't support this property or method" function addItmList(idv,valItem) { var list =document.getElementById('ctl00_ContentPlaceHolder1_MyList'); //var generatedName = "newItem" + ( list.options.length + 1 ); list.Add(idv,valItem); } function checkitemvalues() { var gvET = document.getElementById("ctl00_ContentPlaceHolder1_grd"); var target = document.getElementById('ctl00_ContentPlaceHolder1_lstIControl'); var newOption = window.document.createElement('OPTION'); var rCount = gvET.rows.length; var rowIdx = 0; var tcount = 1; for (rowIdx; rowIdx<=rCount-1; rowIdx++) { var rowElement = gvET.rows[rowIdx]; var chkBox = rowElement.cells[0].firstChild; var cod = rowElement.cells[1].innerText; var desc = rowElement.cells[2].innerText; if (chkBox.checked == true){ addItmList(rowElement.cells[1].innerText,rowElement.cells[2].innerText); } } } Code Behind ScriptManager.RegisterClientScriptBlock( Me.Page, Me.GetType(), MyList.ClientID, "" & vbCr & vbLf & "window.mylistid='" + MyList.ClientID + "';" & vbCr & vbLf & "", True ) Remember my code works fine. It cannot maintain the state of List Control thats why It says Object reqiured. Can any one help me out. After Update Panel Why My javascript doesnt add Items into ListBox. Thanks In advance

    Read the article

  • A CSS code Or Any code to put text (saved in other server) into blogspot blog..???

    - by Nok Imchen
    I have a blog in blogspot. Step (1). Whenever any visitor visit my blogspot blog through Google, the search search string is tracked through a javascript and the search string is saved in another server (say serverX) Step (2). Now, when another visitor (human/Google Bot/Any downloader/etc..) visits my blog, he/she should be able to see the search string (Saved in ServerX) in my blog (anywhere, be it content or at the bottom of the blog....it doesn't matter) Well, I can code the javascript and can also write a php code to save the search string... but i've absolutely NO idea how to do the step (2) Please tell me how to do Step 2... Thanking you in anticipation.

    Read the article

  • Access to variables in an asp.net user control vs an include file

    - by user204588
    I've asked this question before but couldn't get the answer I was looking for so I'm going to try it again. I'm translating pages from old asp to asp.net and I don't want to do this any other way so I really just want to know if this can be done. In asp, I'd assign a variable on one page <% myVar = "something" %> I could assign many variables here and then use an include <!--#include file="Test2.aspx"--> then in test2 file, I could access all the variables without having to pass all the variables into the control or declaring them again, like <% myVar = "something else" %> I want to do this the dot net way but I have some thirty variables on the page and i don't want to pass a bunch into the user control and I don't want to have to keep declaring the same variables. All I really want to know is if there is some way to replicate the behavior above in asp.net?

    Read the article

  • Client Templates and Ajax 4.0 And Urls

    - by RubbleFord
    Client Templating And URL's Title is required Im trying to output <a href="{{ link }}">click me</a> the data in question is spotify:track:0ucyXpQG7xL8ipoyU0Ts3A , once I remove the ":" the link comes through, any ideas on this one? As you can probably guess I'm trying to trigger the spotify protocol handler.

    Read the article

  • MVC2 Clientside Validation and duplicate ID's problem

    - by Dusty Roberts
    I'm using MVC2 with VS2010 I have a view that has two partial views in it: "Login" and "Register" both partial views contains the Email address field i use the following in both partial views: <%: Html.TextBoxFor(model => model.EmailAddress ) %><br /><%: Html.ValidationMessageFor(model => model.EmailAddress) %> if i use both partial views on one page, it ends up having duplicate id's so validation happens across both views (even thopugh they are in seperate forms) how can i go about eliminating this

    Read the article

  • jquery serial format

    - by Yan
    I have a website that prompt the users to enter serial number for a product. I have one text box the user need to enter the serial in this format: xx:xx:xx:xx:xx:xx there is any compment that will enter the : after every to chars ? or mybee i should split the text box to 6 text boxes ? or there anything else that you can suggest?

    Read the article

  • Execute a Application On The Server Using PHP

    - by Nathan Campos
    I have an application on my server that is called leaf.exe, that haves two arguments needed to run, they are: inputfile and outputfile, that will be like this example: pnote.exe input.pnt output.txt The executable is at exec/, inputfile is at upload/ and outputfile is on compiled/. But I need that a PHP could run the application like that, then I want to know: How could I do this? How could I echo the output of the program?

    Read the article

  • Which component should i use?

    - by strakastroukas
    I am using the <a> element to increase the font size in my webpage. <a href="javascript:increaseFontSize();">+</a> The problem with it is that i cannot set a background image. So what component should i choose from the VS2008 toolbox that has OnClientClick property and does not post-back? For examaple, i set the OnClientClick property in a ImageButton, but the postback is executed after the ClientSide click

    Read the article

  • Has any one used client_side_validations gem with Chosen.js dropdown?

    - by Abid
    I am using chosen.js (http://harvesthq.github.com/chosen/). I was wondering if anyone has been able to use chosen select boxes and client_side_validations together. The issue is that when we use chosen it hides the original select element and renders its own dropdown instead, and when we focus out the validation isn't called and also when the validation message is shown it is shown with the original select element so positioning of the error isnt also correct. What could be a good way to handle this, My be we can change some code inside ActionView::Base.field_error_proc which currently looks something like ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| unless html_tag =~ /^<label/ %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe else %{<div class="field_with_errors">#{html_tag}</div>}.html_safe end end Any ideas ? Edit 1: I have the following solution that is working for me now. applied a class "chzn-dropdown" to all my selects that were being displayed by chosen used the following callback provided by client_side_validations Gem clientSideValidations.callbacks.element.fail = function(element, message, callback) { if (element.data('valid') !== false) { if(element.hasClass('dropdown')){ chzn_element = $('#'+element.attr('id')+'_chzn'); console.log(chzn_element); chzn_element.append(""+message+""); } else{ callback(); } } } Thanks

    Read the article

  • org.apache.http.conn.HttpHostConnectException:Connection to http://172.20.38.143 refused

    - by Passion
    I have developed client server Application .I am accessing mysql with php running on my machine and client running on my cell which is connected to machine.WI-FI is also switched ON. Internet Permission are also added in Manifest file but then also the i encounter error 172.20.38.143 is IP OF MY MACHINE 06-01 13:20:10.391: W/System.err(11157): org.apache.http.conn.HttpHostConnectException: Connection to http://172.20.38.143 refused 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:674) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:511) 06-01 13:20:10.401: W/System.err(11157): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:489) 06-01 13:20:10.401: W/System.err(11157): at nineandroid.net.example.library.JSONParser.getJSONFromUrl(JSONParser.java:42) 06-01 13:20:10.401: W/System.err(11157): at nineandroid.net.example.library.UserFunctions.registerUser(UserFunctions.java:59) 06-01 13:20:10.401: W/System.err(11157): at nineandroid.net.example.RegisterActivity$1.onClick(RegisterActivity.java:52) 06-01 13:20:10.411: W/System.err(11157): at android.view.View.performClick(View.java:3567) 06-01 13:20:10.411: W/System.err(11157): at android.view.View$PerformClick.run(View.java:14224) 06-01 13:20:10.411: W/System.err(11157): at android.os.Handler.handleCallback(Handler.java:605) 06-01 13:20:10.411: W/System.err(11157): at android.os.Handler.dispatchMessage(Handler.java:92) 06-01 13:20:10.411: W/System.err(11157): at android.os.Looper.loop(Looper.java:137) 06-01 13:20:10.411: W/System.err(11157): at android.app.ActivityThread.main(ActivityThread.java:4517) 06-01 13:20:10.411: W/System.err(11157): at java.lang.reflect.Method.invokeNative(Native Method) 06-01 13:20:10.411: W/System.err(11157): at java.lang.reflect.Method.invoke(Method.java:511) 06-01 13:20:10.411: W/System.err(11157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) 06-01 13:20:10.421: W/System.err(11157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) 06-01 13:20:10.421: W/System.err(11157): at dalvik.system.NativeStart.main(Native Method) 06-01 13:20:10.421: W/System.err(11157): Caused by: java.net.ConnectException: failed to connect to /172.20.38.143 (port 80): connect failed: ENETUNREACH (Network is unreachable) 06-01 13:20:10.431: W/System.err(11157): at libcore.io.IoBridge.connect(IoBridge.java:114) 06-01 13:20:10.431: W/System.err(11157): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 06-01 13:20:10.431: W/System.err(11157): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) 06-01 13:20:10.431: W/System.err(11157): at java.net.Socket.connect(Socket.java:848) 06-01 13:20:10.431: W/System.err(11157): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119) 06-01 13:20:10.431: W/System.err(11157): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144) 06-01 13:20:10.431: W/System.err(11157): ... 20 more 06-01 13:20:10.431: W/System.err(11157): Caused by: libcore.io.ErrnoException: connect failed: ENETUNREACH (Network is unreachable) 06-01 13:20:10.441: W/System.err(11157): at libcore.io.Posix.connect(Native Method) 06-01 13:20:10.441: W/System.err(11157): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85) 06-01 13:20:10.441: W/System.err(11157): at libcore.io.IoBridge.connectErrno(IoBridge.java:127) 06-01 13:20:10.441: W/System.err(11157): at libcore.io.IoBridge.connect(IoBridge.java:112) 06-01 13:20:10.441: W/System.err(11157): ... 25 more 06-01 13:20:10.441: E/Buffer Error(11157): Error converting result java.lang.NullPointerException 06-01 13:20:10.451: E/JSON Parser(11157): Error parsing data org.json.JSONException: End of input at character 0 of 06-01 13:20:10.451: D/AndroidRuntime(11157): Shutting down VM 06-01 13:20:10.451: W/dalvikvm(11157): threadid=1: thread exiting with uncaught exception (group=0x40c0aa68) 06-01 13:20:10.451: E/AndroidRuntime(11157): FATAL EXCEPTION: main 06-01 13:20:10.451: E/AndroidRuntime(11157): java.lang.NullPointerException 06-01 13:20:10.451: E/AndroidRuntime(11157): at nineandroid.net.example.RegisterActivity$1.onClick(RegisterActivity.java:56) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.view.View.performClick(View.java:3567) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.view.View$PerformClick.run(View.java:14224) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.os.Handler.handleCallback(Handler.java:605) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.os.Handler.dispatchMessage(Handler.java:92) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.os.Looper.loop(Looper.java:137) 06-01 13:20:10.451: E/AndroidRuntime(11157): at android.app.ActivityThread.main(ActivityThread.java:4517) 06-01 13:20:10.451: E/AndroidRuntime(11157): at java.lang.reflect.Method.invokeNative(Native Method) 06-01 13:20:10.451: E/AndroidRuntime(11157): at java.lang.reflect.Method.invoke(Method.java:511) 06-01 13:20:10.451: E/AndroidRuntime(11157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) 06-01 13:20:10.451: E/AndroidRuntime(11157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) 06-01 13:20:10.451: E/AndroidRuntime(11157): at dalvik.system.NativeStart.main(Native Method) UserFunctions.java to call jsonParser public class UserFunctions { private JSONParser jsonParser; private static String loginURL = "http://172.20.38.143/ah_login_api/"; private static String registerURL = "http://172.20.38.143/ah_login_api/"; private static String login_tag = "login"; private static String register_tag = "register"; // constructor public UserFunctions(){ jsonParser = new JSONParser(); } /** * function make Login Request * @param email * @param password * */ public JSONObject loginUser(String email, String password){ // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("tag", login_tag)); params.add(new BasicNameValuePair("email", email)); params.add(new BasicNameValuePair("password", password)); JSONObject json = jsonParser.getJSONFromUrl(loginURL, params); // return json // Log.e("JSON", json.toString()); return json; } /** * function make Login Request * @param name * @param email * @param password * */ public JSONObject registerUser(String name, String email, String password){ // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("tag", register_tag)); params.add(new BasicNameValuePair("name", name)); params.add(new BasicNameValuePair("email", email)); params.add(new BasicNameValuePair("password", password)); // getting JSON Object JSONObject json = jsonParser.getJSONFromUrl(registerURL, params); // return json return json; } /** * Function get Login status * */ public boolean isUserLoggedIn(Context context){ DatabaseHandler db = new DatabaseHandler(context); int count = db.getRowCount(); if(count > 0){ // user logged in return true; } return false; } /** * Function to logout user * Reset Database * */ public boolean logoutUser(Context context){ DatabaseHandler db = new DatabaseHandler(context); db.resetTables(); return true; } } jsonParser.java public class JSONParser { static InputStream is = null; static JSONObject jObj = null; static String json = ""; // constructor public JSONParser() { } public JSONObject getJSONFromUrl(String url, List<NameValuePair> params) { // Making HTTP request try { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); json = sb.toString(); Log.e("JSON", json); } catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.toString()); } // try parse the string to a JSON object try { jObj = new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jObj; } } RegisterActivity.java public class RegisterActivity extends Activity { Button btnRegister; Button btnLinkToLogin; EditText inputFullName; EditText inputEmail; EditText inputPassword; TextView registerErrorMsg; // JSON Response node names private static String KEY_SUCCESS = "success"; private static String KEY_UID = "uid"; private static String KEY_NAME = "name"; private static String KEY_EMAIL = "email"; private static String KEY_CREATED_AT = "created_at"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.register); // Importing all assets like buttons, text fields inputFullName = (EditText) findViewById(R.id.registerName); inputEmail = (EditText) findViewById(R.id.registerEmail); inputPassword = (EditText) findViewById(R.id.registerPassword); btnRegister = (Button) findViewById(R.id.btnRegister); btnLinkToLogin = (Button) findViewById(R.id.btnLinkToLoginScreen); registerErrorMsg = (TextView) findViewById(R.id.register_error); // Register Button Click event btnRegister.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String name = inputFullName.getText().toString(); String email = inputEmail.getText().toString(); String password = inputPassword.getText().toString(); UserFunctions userFunction = new UserFunctions(); JSONObject json = userFunction.registerUser(name, email, password); // check for login response try { if (json.getString(KEY_SUCCESS) != null) { registerErrorMsg.setText(""); String res = json.getString(KEY_SUCCESS); if(Integer.parseInt(res) == 1){ // user successfully registred // Store user details in SQLite Database DatabaseHandler db = new DatabaseHandler(getApplicationContext()); JSONObject json_user = json.getJSONObject("user"); // Clear all previous data in database userFunction.logoutUser(getApplicationContext()); db.addUser(json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json.getString(KEY_UID), json_user.getString(KEY_CREATED_AT)); // Launch Dashboard Screen Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); // Close all views before launching Dashboard dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(dashboard); // Close Registration Screen finish(); }else{ // Error in registration registerErrorMsg.setText("Error occured in registration"); } } } catch (JSONException e) { e.printStackTrace(); } } }); // Link to Login Screen btnLinkToLogin.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent i = new Intent(getApplicationContext(), LoginActivity.class); startActivity(i); // Close Registration View finish(); } }); } }

    Read the article

  • javascript conflict on accesing DOM

    - by justjoe
    i read this statement from a book i read The Document Object Model or DOM is really not a part of JavaScript but a separate entity existing outside it. Although you can use JavaScript to manipulate DOM objects, other scripting languages may equally well access them too. what is the best way to avoid conflict between javascript and other client-siede scripting language when we have to deal with XMLHTTPRequest object

    Read the article

  • What is the scope of require_once in PHP?

    - by TMG
    Simple question: Is the scope of require_once global? For example: <?PHP require_once('baz.php'); // do some stuff foo ($bar); function foo($bar) { require_once('baz.php'); // do different stuff } ?> When foo is called, does it re-parse baz.php? Or does it rely on the already required file from the main php file (analagous to calling require_once twice consecutively for the same include file)? I saw this thread before, but it didn't quite answer the question: http://stackoverflow.com/questions/1669707/should-require-once-some-file-php-appear-anywhere-but-the-top-of-the-file Thanks for your help!

    Read the article

  • Set a class for an element in a PHP include()

    - by paracaudex
    I have an identical horizontal menu at the top of all of my pages, which I add using a PHP include() statement. In my stylesheet I want to have a class where if the user is on a particular page, the menu item corresponding to that page will have a different color. So, more or less: #dropdown { background-color:blue; } #dropdown .active { background-color:green; } But, since the menu comes from the PHP include, it's always the same. How can I write some PHP or JavaScript that adds class="active" to the appropriate menu item for each page?

    Read the article

  • asp.net web forms best practice to retrieve dynamic server control values

    - by Andrew Florko
    I populate web form with dynamic list of exams from database. I want user to enter examination marks for each exam. There is list of exam titles and textbox near each title. I create list with repeater control: <asp:Repeater ID="rptExams" runat="server" onitemdatabound="rptExams_ItemDataBound" > <ItemTemplate> <tr> <td> <asp:Literal runat="server" ID="ltTitle"/> </td> <td> <asp:HiddenField runat="server" ID="hfId"/> <asp:Textbox runat="server" ID="tbMark"/> </td> </tr> </ItemTemplate> </asp:Repeater> And bind data to repeater on page_init: class Exam { public int Id { get; set;} public string Title { get; set;} } ... // this list is retrieved from database actually Exam[] Exams = new Exam[] { new Exam { Id = 1, Title = "Math"}, new Exam { Id = 2, Title = "History"} }; ... protected void Page_Init(object sender, EventArgs e) { rptExams.DataSource = Exams; rptExams.DataBind(); } So far so good. Then I have to retrieve data on postback. I have two ways but both of them looks ugly. Idea is to store dynamically created databounded controls on ItemDataBoundEvent in Page_Init stage, and process their values in Page_Load stage. It looks like this: private Dictionary<HiddenField, TextBox> Id2Mark = new Dictionary<HiddenField, TextBox>(); protected void rptExams_ItemDataBound(object sender, RepeaterItemEventArgs e) { ... if (IsPostBack) { var tbMark = (TextBox)e.Item.FindControl("tbMark"); var hfId = (HiddenField)e.Item.FindControl("hfId"); // store dynamically created controls Id2Mark.Add(hfId, tbMark); } ... } protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { foreach (var pair in Id2Mark) { int examId = Int32.Parse(pair.Key.Value); string mark = pair.Value.Text; // PROCESS } ... I'm completely sure there is a better way to retrieve data from dynamically created controls. Thank you in advance!

    Read the article

  • routing mvc on the web

    - by generic_noob
    Hi, I was wondering if anyone could possibly provide me some advice on how i could improve the routing (and/or architecture) to each 'section' of my application. (I'm writing in PHP5, and trying to use strict MVC) Basically, I have a generic index page for the app, and that will spew out boilerplate stuff like jquery and the css etc. and it also generates the main navidation for the entire site, but i'm unsure about the best approach to connect the 'main menu' items(hyperlinks) with their associated controllers. Up until now I have been appending strings into the url and using a 'switch' statement to branch to the correct controller(and view) by extracting the strings back out of '$GET[]' to let it execute the code for the corrosponding action. for instance if i had a basic crud system for customer data, the url to edit a customers details would look like 'www.example.com/index.php?page=customer&action=edit&id=4'. I'm worried that there is a security concern by doing it this way, and i'm not sure of an alternative to branch the main 'index.php' file to the correct controller for each action once the user has clicked the link. Would it be better to use mod_rewrite to disguise the controllers names? or to create a similar system to the ASP MVC framework, where there is a seperate routing system where each url is filtered to get the associated controller? Cheers!

    Read the article

  • Determine IP# of domain from client browser

    - by Tim W.
    Greetings all, I would very much like to determine the IP# of a domain from client script. It's for use in a testing application to determine whether or not a certain domain is set to a QA address as opposed to the address live on the . The testing machine will have it's host file set to resolve a domain to the QA address. Pinging from the server won't help since the server is getting the public DNS address. Is this possible in JavaScript? Maybe a Flash could do the trick?

    Read the article

  • caching in memory on server

    - by zaharpopov
    I want to write web app with client Javascript and back-end server (Python). Client needs data from server frequently in AJAX way. Data in DB, and expensive to load for each request. However, in desktop app I would just load data from DB once to memory and then access it. In web app - the server code runs each time for request so I can't do it (each run has to load from DB to memory again). How can this work? Can a single process run on server or do I have to use something different here? An example is like auto-complete here on stackoverflow for tags - how is it implemented in the server for fast caching/loading?

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >