Search Results

Search found 19374 results on 775 pages for 'url modification'.

Page 87/775 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • JarEntry.getSize() is returning -1 when the jar files is opened as InputStream from URL

    - by Reshma Donthireddy
    I am trying to read file from the JarInputStream and the size of file is returning -1. I am accessing Jar file from the URL as a inputStream. URLConnection con = url.openConnection(); JarInputStream jis = new JarInputStream(con.getInputStream()); JarEntry je = null; while ((je = jis.getNextJarEntry()) != null) { htSizes.put(je.getName(), new Integer((int) je.getSize())); if (je.isDirectory()) { continue; } int size = (int) je.getSize(); // -1 means unknown size. if (size == -1) { size = ((Integer) htSizes.get(je.getName())).intValue(); } byte[] b = new byte[(int) size]; int rb = 0; int chunk = 0; while (((int) size - rb) > 0) { chunk = jis.read(b, rb, (int) size - rb); if (chunk == -1) { break; } rb += chunk; } // add to internal resource hashtable htJarContents.put(je.getName(), baos.toByteArray()); }

    Read the article

  • Passing HTML form data in the URL on local machine (file://)

    - by atzz
    Hi, I'm building a small HTML/JS application for primary use on local machine (i.e. everything is accessed via file:// protocol, though maybe in the future it will be hosted on a server within intranet). I'm trying to make a form with method="get" and action="target.html", in the hope that the browser will put form data in the URL (like, file://<path>/target.html?param1=aaa&param2=bbb). However, it's not happening (target.html opens fine, but no parameters is passed). What am I doing wrong? Is it possible to use forms over file:// at all? I can always build the url manually (via JS), but being lazy I'd prefer the browser do it for me. ;) Here is my sample form: <form name='config' action="test_form.html" method="get" enctype="application/x-www-form-urlencoded"> <input type="text" name="param1"> <input type="text" name="param2"> <input type="submit" value="Go"> </form>

    Read the article

  • Polling a web URL until event

    - by Jaxo
    I'm really sorry about the crappy title - if anybody has a better way of wording it, please edit it! I basically need to have a C# application run a function if the output of a URL is a certain value. For example, if the website says blue the background colour will be blue, red to make it red, etc. The problem is I don't want to spam my webserver with checks. The 4 bytes it downloads each time is negligible, but if I were to deploy this type of system on multiple computers, it would get slower and slower and the bandwidth would add up quickly. So my question is: How can my desktop application run a piece of code only when a web URL has a different output without checking each time? I can't use sockets, and any sort of LAN protocol won't end up working. My reasoning behind this potentially nefarious code is to be able to mute computers by updating a file on the website (as you may have seen in my previous question today, sorry!). I'd like it to be rather quick, and not have the refresh time minutes apart, a few seconds at the most would be ideal. How can I accomplish this? The website's code is easy, but getting the C# application to check when it changes is the part I'm stuck on. Nothing shows up on the website other than the command. Thanks!

    Read the article

  • Prevent hash navigation url

    - by Koningh
    I have the following problem: I'm using a slider (coda) to let people navigate trough some 'pages'. The slider uses hash links to navigate to the next page/slide. If a user is at page one (#page1), there is a link which will lead the user to page 2 (#page2) and so on. At the top of the slider the numbers of the pages appear as a link, but only when the page is visited. So if there are six pages and the user navigates from the first to the second and then the third one, there are only three links at the top of the slider (to page one, two and three). The problem is that a user can navigate to page five (or any page actually) without first visiting the pages previous to page five by just using the hash URL and typing the whole link in their address bar. For example if I would type www.mydomain.com/slider/index.php#page5 the slider automatically navigates to the fifth slide/page of the slider and thereby skipping the first four. I want to allow users to navigate to #page5 only if they have visited the first four (So by clicking trough the slides). This means that if they would go to #page5 directly by typing the URL in the address bar, I would like them to be send to the first page (#page1). Does anyone have any idea on solving this?

    Read the article

  • Get Url Parameters In Django

    - by picomon
    I want to get current transaction id in url. it should be like this www.example.com/final_result/53432e1dd34b3 . I wrote the below codes, but after successful payment, I'm redirected to Page 404. (www.example.com/final_result//) Views.py @csrf_exempt def pay_notif(request, v_transaction_id): if request.method=='POST': v_transaction_id=request.POST.get('transaction_id') endpoint='https://testpay.com/?v_transaction_id={0}&type=json' req=endpoint.format(v_transaction_id) last_result=urlopen(req).read() if 'Approved' in last_result: session=Pay.objects.filter(session=request.session.session_key).latest('id') else: return HttpResponse(status=204) return render_to_response('final.html',{'session':session},context_instance=RequestContext(request)) Urls.py url(r'^final_result/(?P<v_transaction_id>[-A-Za-z0-9_]+)/$', 'digiapp.views.pay_notif', name="pay_notif"), Template: <input type='hidden' name='v_merchant_id' value='{{newpayy.v_merchant_id}}' /> <input type='hidden' name='item_1' value='{{ newpayy.esell.up_name }}' /> <input type='hidden' name='description_1' value='{{ newpayy.esell.up_description }}' /> <input type='hidden' name='price_1' value='{{ newpayy.esell.up_price }}' /> #page to be redirected to after successful payment <input type='hidden' name='success_url' value='http://127.0.0.1:8000/final_result/{{newpayy.v_transaction_id}}/' /> How can I go about this?

    Read the article

  • Mapping a URL to a service inside a class library

    - by johnk82swe
    I'm developing a small content management solution than can be used in any ASP.NET 3.5 website. The website references some dll's and then lets the aspx's inherit my page baseclass. Some configuration in web.config is also needed, but thats it. Now I'm building a standalone Silverlight editor for the CMS. My idea is that it should communicate with the server using web services. But the question is how to make this service available to the editor? I don't want the website developers having to bother with it. If I used a REST API rather than SOAP I could just create an HttpHandler in my class library and let the website developers add a handler to it in web.config with the path "editor" and then the editor could communicate with that handler on mywebsite.com/editor. Is there any way to achieve the same with a asmx or wcf service? The important thing is that the website developers never have to set up any asmx files or anything. They should only have to specify a url and map that url to a service inside my class library. Thanks in advance!

    Read the article

  • Rails from with better url

    - by Sam
    wow, switching to rest is a different paradigm for sure and is mainly a headache right now. view <% form_tag (businesses_path, :method => "get") do %> <%= select_tag :business_category_id, options_for_select(@business_categories.collect {|bc| [bc.name, bc.id ]}.insert(0, ["All Containers", 0]), which_business_category(@business_category) ), { :onchange => "this.form.submit();"} %> <% end %> controller def index @business_categories = BusinessCategory.find(:all) if params[:business_category_id].to_i != 0 @business_category = BusinessCategory.find(params[:business_category_id]) @businesses = @business_category.businesses else @businesses = Business.all end respond_to do |format| format.html # index.html.erb format.xml { render :xml => @businesses } end end routes map.resources What I want to to is get a better url than what this form is presenting which is the following: http://localhost:3000/businesses?business_category_id=1 Without rest I would have do something like http://localhost:3000/business/view/bbq bbq as permalink or I would have done http://localhost:300/business_categories/view/bbq and get the business that are associated with the category but I don't really know the best way of doing this. So the two questions are what is the best logic of finding a business by its categories using the latter form and number two how to get that in a pretty url all through restful routes in rails.

    Read the article

  • Using Javascript to get URL Vars, not working when multiple values present in QueryString

    - by bateman_ap
    Hi, I am using a Javascript function to get the values of a URL to pass to jQuery using the function below: function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } And then setting the value like this: var type = getUrlVars()["type"] This all works perfectly, however I have just come into a situation where I need to get multiple values, one of my form elements are checkboxes where multiple values can be checked, so my URL will look something like this: http://www.domain.com/test.php?type=1&cuisine[]=23&cuisine[]=43&name=test If I alert out the cuisine value using the function above I only ever get the final value: alert (getUrlVars()["cuisine[]"]); Would alert "43". What I would like it to be is a comma delimited string of all "cuisine" values. ie in the above example "23,43" Any help very welcome! In case any solution requires it I am using PHP 5.3 and Jquery 1.4

    Read the article

  • Wordpress Widget - Adding URL to title

    - by Nick Canarelli
    I can't seem to figure out how to wrap the title of the widget in an tag. For example, I am trying to get it so that when you type the url in a text field, it is then placed in the tag so that it is a hyperlink on the website... class Example_Widget extends WP_Widget { /** * Widget setup. */ function Example_Widget() { /* Widget settings. */ $widget_ops = array( 'classname' => 'example', 'description' => __('A widget that displays company announcements.', 'example') ); /* Widget control settings. */ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'example-widget' ); /* Create the widget. */ $this->WP_Widget( 'example-widget', __('Announcement Widget', 'example'), $widget_ops, $control_ops ); } /** * How to display the widget on the screen. */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); $excerpt = $instance['excerpt']; $url = $instance['url']; /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ if ( $title ) echo $before_title . $title . $after_title; /* Display name from widget settings if one was input. */ if ( $excerpt ) printf( '<p style="font-family: arial; font-size: 12px; line-height: 16px;">' . __('%1$s.', 'example') . '</p>', $excerpt ); /* After widget (defined by themes). */ echo $after_widget; } /** * Update the widget settings. */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['excerpt'] = strip_tags( $new_instance['excerpt'] ); return $instance; } /** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('Title Goes Here', 'example'), 'excerpt' => __('Excerpt goes here.'), ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <!-- Widget Title: Text Input --> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'hybrid'); ?></label> <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" /> </p> <!-- Your Name: Text Input --> <p> <label for="<?php echo $this->get_field_id( 'excerpt' ); ?>"><?php _e('Excerpt:', 'example'); ?></label> <input id="<?php echo $this->get_field_id( 'excerpt' ); ?>" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" value="<?php echo $instance['excerpt']; ?>" style="width:100%;" /> </p> <?php } } ?> And here is the functions file code register_sidebar(array( 'name' => __( 'Announcements' ), 'description' => __( 'Display company announcements here.' ), 'before_widget' => '', 'after_widget' => '<hr style="margin-top: 4px; color: #f00; background-color: #585040; height: 1px; border: none; margin-bottom: 2px;"/>', 'before_title' => '<h2 style="font-size: 12px;">', 'after_title' => '</h2>' ));

    Read the article

  • android - Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException

    - by chinna_82
    Im trying to get image from my URL and display in application but it throw error Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Below is my code Code package com.smartag.bird.dev; public class MainActivity extends Activity { static String ndefMsg = null; static String ndefMsg1 = null; NfcAdapter mNfcAdapter; PendingIntent mNfcPendingIntent; IntentFilter[] mNdefExchangeFilters; static final String TAG = "Read Tag"; TextView mTitle; private static ImageView imageView; static String url = "http://sposter.smartag.my/images/chicken_soup.jpg"; private static Bitmap downloadBitmap; private static BitmapDrawable bitmapDrawable; private static boolean largerImg = false; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); mNfcAdapter = NfcAdapter.getDefaultAdapter(this); mNfcPendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); IntentFilter ndefDetected = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); try { ndefDetected.addDataType("text/plain"); } catch (MalformedMimeTypeException e) { } mNdefExchangeFilters = new IntentFilter[] { ndefDetected }; if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) { NdefMessage[] messages = getNdefMessages(getIntent()); byte[] payload = messages[0].getRecords()[0].getPayload(); ndefMsg = new String(payload); setIntent(new Intent()); // Consume this intent. } ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if(ndefMsg == null || ndefMsg.length() == 0) { startActivity(new Intent(MainActivity.this, MainMenu.class)); } else { setContentView(R.layout.main); if (mWifi.isConnected()) { ndefMsg1 = ndefMsg; new DownloadFilesTask().execute(); ndefMsg = null; } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle("Attention"); dialog.setMessage("No Internet Connection. Please enable the wifi."); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); dialog.show(); } } } private class DownloadFilesTask extends AsyncTask<Void, Void, Void> { protected void onPostExecute(Void result) { } @Override protected Void doInBackground(Void... params) { try { URL myFileUrl = new URL("http://sposter.smartag.my/images/chicken_soup.jpg"); HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); downloadBitmap = BitmapFactory.decodeStream(is); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } ImageView image = (ImageView) findViewById(R.id.imview); image.setImageBitmap(downloadBitmap); return null; } } }

    Read the article

  • How to remove an entry from Chrome's Remembered URLs from the url bar?

    - by cmcculloh
    I've got a url in Chrome "local.mysite.com" that autopopulates when I start typing "local.my" into the URL bar. Note that this URL DOES NOT EXIST in my browser history (at chrome://history/#e=1&p=0) because it isn't a real site and therefor couldn't ever be successfully visited and therefor never shows up in my history. The URL I want is "local.mysite.com/subdir/". That URL is like 3 down in the suggested results because I keep accidentally hitting "enter" when it auto-suggests the unwanted first URL and thus re-enforcing it's assumption that that is the one I want. How do I get rid of the "local.mysite.com" entry in Chrome's memory?

    Read the article

  • ASp.NEt MVC: how to parse url string to get RouteData

    - by Feryt
    Hi. Is there any way hot to get RouteData from url string? I have login form with returlUrl as query string parameter. My routes are defined as : {languageCode}/{controller}/{action} In action method LogIn(string returlUrl) the returlUrl is something like "en/home/contacts" etc. I need to change languagePart a i dont want to use string.Replace, as routes may change in future. Thank you.

    Read the article

  • java Filter URL pattern specific to request params

    - by Rohit Desai
    Hi All, We have a situation where we want to use filter for URL's containing some specific request parameters. e.g htt://mydomain.com/?id=78&formtype=simple_form&....... htt://mydomain.com/?id=788&formtype=special_form&....... and so on , id are fetched at run time, I want configure filter in web.xml only if formtype=special_form. How should achieve the solution . Can filter be configure with regex patterns? Really appreciate your help on this. Thanks, Rohit

    Read the article

  • tinymce - url templates, image add etc not loading

    - by Ali
    Hi guys I'm trying to integrate the tinymce plugin however I'm running into problems such that almost every feature which requires a plugin to be rendered i.e the add url popup or add image pop up - it opens an empty pop up window. Even if I try to open it inline I get the same blank popup window.. what should I be looking at here.. I can't notice any error sin firebug..

    Read the article

  • Jquery Cycle Plugin Question - turning off relative links to photos so it goes to a URL

    - by alpdog14
    I am using Jquery Cycle Plugin and it has a side panel that highlights as the photos change and currently when I click on the text the associated photo pulls up then I have to click on the photo to go to the URL but I would like the text itself to link to the URL. I have looked at the fn.cycle.defaults but not sure what to change and I tried a few things but nothing works. If anyone can help me figure this out it would be most helpful. Here are the fn.cycle.defaults: fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) continuous: 0, // true to start next transition immediately after current one completes speed: 1000, // speed of the transition (any valid fx speed value) speedIn: null, // speed of the 'in' transition speedOut: null, // speed of the 'out' transition next: null, // id of element to use as click trigger for next slide prev: null, // id of element to use as click trigger for previous slide prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) pager: null, // id of element to use as pager container pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) pagerEvent: null, // event which drives the pager navigation pagerAnchorBuilder: null, // callback fn for building anchor links before: null, // transition callback (scope set to element to be shown) after: null, // transition callback (scope set to element that was shown) end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options) easing: null, // easing method for both in and out transitions easeIn: null, // easing for "in" transition easeOut: null, // easing for "out" transition shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } animIn: null, // properties that define how the slide animates in animOut: null, // properties that define how the slide animates out cssBefore: null, // properties that define the initial state of the slide before transitioning in cssAfter: null, // properties that defined the state of the slide after transitioning out fxFn: null, // function used to control the transition height: 'auto', // container height startingSlide: 0, // zero-based index of the first slide to be displayed sync: 1, // true if in/out transitions should occur simultaneously random: 0, // true for random, false for sequence (not applicable to shuffle fx) fit: 0, // force slides to fit container pause: true, // true to enable "pause on hover" autostop: 0, // true to end slideshow after X transitions (where X == slide count) autostopCount: 0, // number of transitions (optionally used with autostop to define X) delay: 0, // additional delay (in ms) for first transition (hint: can be negative) slideExpr: null, // expression for selecting slides (if something other than all children is required) cleartype: 0, // true if clearType corrections should be applied (for IE) nowrap: 0 // true to prevent slideshow from wrapping }; I have tried changing the pageClick and pagerEvent but nothing seems to be working. Please help!!!

    Read the article

  • HIde a Ul when a url is loaded

    - by Aruna
    hi , i am having a form -search below that on search i am listing the matched records below the search form .. But even by default case without any search when i load the search form i am getting all the entries by default.. which is coming in a UL.. So i am trying to hide a div when the particular url is loaded .. How to do so??

    Read the article

  • Valid URL-string as NSUrl becomes null

    - by Mike
    Hello, another issue where I seem to have found an solution for ObjC but not MonoTouch. I want a NSUrl from an URL (as string). The string may contain whitespace and backslashes. Why is NSUrl returning null for such string, even though these are valid urls in a browser? For example: NSUrl foo = NSUrl.FromString(@"http://google.com/search?\query"); foo == null Any suggestions?

    Read the article

  • python webbrowser.open(url)

    - by Gert Cuykens
    httpd = make_server('', 80, server) webbrowser.open(url) httpd.serve_forever() This works cross platform except when I launch it on a putty ssh terminal. How can i trick the console in opening the w3m browser in a separate process so it can continue to launch the server? Or if it is not possible to skip webbrowser.open when running on a shell without x?

    Read the article

  • Retrieve file from url with autorization PHP

    - by Belgin Fish
    Hi, I'm currently trying to grab a file from an external url that has an authorization box that pops up (like the default one asking for a username and password) How can I have a script get the contents of the page (it's a video), save it to a directory and handle the authorization (i have a username and password) Thanks :)

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >