w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
VBA Download Files from website and save them in local without manual intervention
I stand corrected - some enterprising developers have written some code to automatically fill in the "Save As" dialog box. This is not something I've ever done myself so I can't vouch for how well it works, but you might want to take a look at this code listing by John_W.

Categories : Vba

Free Download of Datatable css
Did you try checking the datatables website? https://datatables.net/manual/styling/theme-creator They provide support for several themes. This online style builder will let you customise the colouring of the DataTables stylesheet to fit in seamlessly with your web-site or app. Simply select the colours you want for your table using the options below, and click the Create stylesheet button. The page will then reload and show your customised table below, with the CSS available to copy and paste for your site.

Categories : CSS

Is there a way to give coupon codes for people to download your app for free?
There's currently no way for developers to generate codes to use on their applications. You can, however, use in-app licensing, but that requires extra work.

Categories : Java

How do I allow android app alpha/beta testers to download the app for free?
Here is my conclusion (in short, no solution): 1- (Edit: unfortunately this point is not correct, you wont get the updates unless you download directly from the store.) The only issue is delivering the first APK to the testers, as they wont be able to download the application from the Play Store, however, downloading updates from the Play Store is doable and okay, (delivered APK must be signed with same key as Play Store APK). 2- If the application is never publicly released yet, testers must have some sort of a direct link to the application on the Play Store, as searching for it will never show up (even with package name: com.example.application). But after having the first APK, you can just look through the 'My Apps" section in the Play Store and find it. 3- Google sucks for not maki

Categories : Android

Issues with C in realloc() or free() or double free or corruption
This is a significant problem: void cpy_to_q(unsigned char **qs_ptr, unsigned char **qcur_ptr, unsigned char **qsa_ptr, unsigned char *data, int num_bytes, int tot_bytes) { if(*qs_ptr == NULL) { *qs_ptr = (unsigned char *)malloc(num_bytes*sizeof(unsigned char) + 1); *qcur_ptr = *qs_ptr; *qsa_ptr = *qs_ptr; memcpy(*qs_ptr, data, num_bytes); } else { // HERE YOU REALLOC THE BASE PTR, BUT DON"T REPOS THE CUR PTR *qs_ptr = (unsigned char *)realloc(*qs_ptr, tot_bytes*sizeof(unsigned char) + 1); printf("size of q: %d ", tot_bytes); *qsa_ptr += num_bytes; memcpy(*qsa_ptr, data, num_bytes); } } When the allocation final

Categories : C

Free result and close connection before unsetting the mysql object or just unsetting would destroy the object n free up the resources?
You may only have one prepared statement/execution at a time when using mysqli. If you try to open and execute two prepared statements without closing you will generate an error. Any resources you explicitly open past your db abstractor should be dealt with by you during execution time. That is, if you open a connection using the info in the abstractor it is best practice to explicitly close it (but not unset the base resource itself), thereby freeing the resource associated with it. Having a basic mysql-connection is not very resource consuming, but keeping a large number of un-closed connections to your mysql server can cause it to cease accepting connections (depending on config). Most executions, upon completion, will automatically free the associated mysql resources if they aren't exp

Categories : PHP

First Data Patament Gateway- No option to download 'digital certificate' (.PEM) file in Download Center
You can Download the Certificates using Internet Explorer Browser. The Firefox, Chrome and other browsers not support to download. Important thing is Use "111111111" as your Tax ID for your test account. For production stores you will be required to supply your actual SSN or Tax ID submitted in the merchant account boarding process.

Categories : PHP

google drive download document using javascript :can't download files
"if i paste the downloadUrl in the browser it won't give any result" is correct because when you GET using a browser there is no authentication header. If you check the status you will see a 401 error. I use "Authorization: 'OAuth ' + gapi.auth.getToken()['access_token']" rather than 'Bearer'. I'm not sure if that is significant. Are you sure the downloadUrl is current? This is a short-lived attribute, so it's possible the link has expired. It's also possible the access token is invalid. As Burcu said, your answer is probably within the response and status to your xhr get.

Categories : Javascript

C# Multiple Download from FTP using parallel task - Duplicate Download issue
You better use Distinct like below Parallel.ForEach(remotefiles.Distinct(), file => DownloadFile(sfc, file)); if you have duplicate file names and when parallel processing start on same file you will get exception on those duplicate files. And also you are not downloading to another location, what you are doing is download to same ftp source location. is that correct? I would give diferent download directory and get file name from source file and then download to that location as below private void DownloadFile(SftpClient sf, string RemoteFileName) { string downloadTo = Path.Combine(DownloadDirectoryPath, Path.GetFileName(RemoteFileName)); using (Stream ms = File.OpenWrite(downloadTo)) { sf.DownloadFile(RemoteFileName, ms); }

Categories : C#

File download from URL stops when multiple clients try to download it
Your download code looks ok and I do not see any reason for a race condition, so without deeper analysis of your download code, I can tell you that this code (client side) is not the problem. It must be the server side which causes the problem, i.e. your webserver or a proxy or firewall which is in between. Moreover, maybe you should look at JNLP, which is a technology designed exactly for your problem of keeping an application always updated and checking this at startup.

Categories : Java

Download Code Error In PHP? Upload And Download Form
You can download a file direct from your dowload.php by specifying a custom header and using readfile to include the file. Checkout this stack question: How to return a file in PHP

Categories : PHP

Download image from URL that automaticaly creates download - python
There's nothing particularly special about X-Accel-Mapping header. Perhaps the page makes the HTTP request with ajax, and uses the X-Accel-Mapping reader value to trigger the download? Here's how I'd do it with urllib2: response = urllib2.urlopen(url_to_get_x_accel_mapping_header) download_url = response.headers['X-Accel-Mapping'] download_contents = urllib2.urlopen(download_url).read()

Categories : Python

.htaccess RewriteRule from download.php?token=something into /download/something
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT/subf/subf2/ directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase /subf/subf2/ RewriteRule ^(download)/(w+)/?$ $1.php?token=$2 [L,QSA,NC] # to take care of css, js, images RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} .php$ RewriteRule ^download/(.+)$ /subf/subf2/$1 [L,R=301,NC]

Categories : Regex

How to hide a download link from a download manager in PHP
//This will help you <?php $fullpath = 'https://www.example.com/test.exe'; $filename ='test.exe'; header("Cache-Control: public, must-revalidate"); header("Content-Type: application/exe"); header("Content-Length: " .(string)(filesize($fullpath)) ); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile($fullpath); ?> MIME type informations http://filext.com/file-extension/EXE

Categories : PHP

Automatically download an xml file from URI with download popup
The URI that you are using is probably wrong. You are using the URI that opens the popup page. The popup page should be doing another GET to the dynamically generated file. To automate this process, you should use a WebRequest to get the contents of the popup page. Scrape the contents of the page to get the actual URL to download the file. Then use the code you have written to download the file. var request = WebRequest.Create("PopupUrl"); var response = request.GetResponse(); string url = GetUrlFromResponseByRegExOrXMLParsing(); var client = new WebClient(); webClient.DownloadFile(url, filePath);

Categories : C#

how to download file in android download service
You can download any file using AsyncTask. downloadContent(); private void downloadContent() { DownloadFile downloadFile = new DownloadFile(); downloadFile.execute("http://somehost.com/file.mp3"); } // usually, subclasses of AsyncTask are declared inside the activity class. // that way, you can easily modify the UI thread from here private class DownloadFile extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... sUrl) { try { URL url = new URL(sUrl[0]); URLConnection connection = url.openConnection(); connection.connect(); int fileLength = connection.getContentLength(); InputStream input = new BufferedInputStream( connection.g

Categories : Android

Why Response::download() won't download anything except PDF in Laravel 4?
Try including the MIME in the return: $file = storage_path().'/file/' . $file->id . "." . $file->file->extension; return Response::download($file, 200, array('content-type' => 'image/png'));

Categories : PHP

Manual Mean Filtering
Example below treats pixels at the edge in the manner that it only considers pixels that are inside the image. For example when program is computing average with kernel dy = (-1:1) and dx = (-1:1) on top-left corner, it only considers top-left corner and its immediate 3 neighbors (right, right-bottom, right), and does average of those 4 pixels. I would strongly advise you to test every line separately in Matlab's command window to see it's behavior! % find image size imsz = size( myimage ); % initialize output image imavg = zeros( imsz ); % iterate over pixels for yy = 1 : imsz(1) for xx = 1 : imsz(2) % define rectangle-kernel width dy = (-1:1); % 1 up, to 1 down and ... dx = (-1:1); % 1 left, to 1 right from current pixel % get indexes of im

Categories : Matlab

manual variable increment
You'll have to use a mutable value holder instead of java.lang.Integer for the variable. java.util.concurrent.atomic.AtomicInteger would do for instance (you don't need atomicity, you can also go with MutableInt from Commons Lang). Once you declare your variable as AtomicInteger, you can do $V{my_counter}.getAndIncrement() in your expressions.

Categories : Xml

Manual Sorting of 4 Numbers
def bubble_sort(a_list): changed = True while changed: changed = False for i in range(len(a_list)-1): if a_list[i] > a_list[i+1]: changed = True a_list[i],a_list[i+1] = a_list[i+1],a_list[i] return a_list I think anyway ...

Categories : Python

CAKeyframeAnimation Manual Progress
Yes you can do this with the CAMediaTiming interface. You can set the speed of the layer to 0 and manualy set the timeOffset. Example of a simple pause/resume method: - (void)pauseAnimation { CFTimeInterval pausedTime = [yourLayer convertTime:CACurrentMediaTime() fromLayer:nil]; yourLayer.speed = 0.0; yourLayer.timeOffset = pausedTime; } - (void)resumeAnimation { CFTimeInterval pausedTime = [yourLaye timeOffset]; if (pausedTime != 0) { yourLayer.speed = 1.0; yourLayer.timeOffset = 0.0; yourLayer.beginTime = 0.0; CFTimeInterval timeSincePause = [yourLayer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime; yourLayer.beginTime = timeSincePause; } }

Categories : IOS

Haml to Erb manual conversion
You probably only want one class attribute in the HTML and #{...} won't do string interpolation in ERB (unless of course it is inside a Ruby chunk). You probably want something more like this: <li class="public radio <%= 'selected' if publisher_public %>" data-aspect_id="public"> Similarly for the other <li>.

Categories : Ruby On Rails

DirectShow videoinfoheader manual set up
You initialize just too few fields... Compare fields you set up and those defined in VIDEOINFOHEADER + BITMAPINFOHEADER - you don't do Planes, BitCount, Compression etc. It does not work like this, you need a well defined format for starters, and then it may be accepted or rejected by the device. It has to be something like this (C#): var vif = new VideoInfoHeader(); vif.BmiHeader = new BitmapInfoHeader(); // The HEADER macro returns the BITMAPINFO within the VIDEOINFOHEADER vif.BmiHeader.Size = Marshal.SizeOf(typeof (BitmapInfoHeader)); vif.BmiHeader.Compression = 0; vif.BmiHeader.BitCount = bitCount; vif.BmiHeader.Width = width; vif.BmiHeader.Height = height; vif.BmiHeader.Planes = 1; int iSampleSize = v

Categories : Vb.Net

Manual JOIN on CakePHP
You should change this line: 'conditions' => array('ClinicWishList.issue_id' => 'ApplicantIssue.id') to: 'conditions' => array('`ClinicWishList`.`issue_id` = `ApplicantIssue`.`id`') and change this line: 'conditions' => array('ApplicantIssue.user_id' => 'User.id') to: 'conditions' => array('`ApplicantIssue`.`user_id` = `User`.`id`')

Categories : Mysql

Manual transaction management in DBD::Pg
My understanding is that if I want to manually manage transactions, I should turn off AutoCommit. No, quite the opposite. Setting AutoCommit to 0 starts a transaction, so you want to set it to 1. To have your changes committed automatically is to have the database not use transactions, which is exactly what you want.

Categories : Perl

One Click Manual Update
Dude, you could really do with providing more information... what is this updater.exe? How does the ClickOnce update overwrite everything in your database? I don't think that you can tell the ClickOnce update functionality to run an executable as part of the update, but you can reference your updater.exe in the Application Files window. Startup Project Properties > Publish Tab > Application Files Button Set your Publish Status column to Include (Auto), Download Group column to (Required) and hash column to Include. Doing this will ensure that the latest version of your updater.exe file is installed to your installation directory. From there, you can access and run your updater.exe file from your ClickOnce application.

Categories : C#

set Id (PK) generation value auto and manual
You can define your custom id generator for this purpose as pointed out in this SO Answer Here is how its code will look like:- @Id @Basic(optional = false) @GeneratedValue(strategy=GenerationType.IDENTITY, generator="IdOrGenerated") @GenericGenerator(name="IdOrGenerated",strategy="....UseIdOrGenerate") @Column(name = "ID", unique = true, nullable = false, precision = 20, scale = 0) public Long getId(){..} and public class UseIdOrGenerate extends IdentityGenerator { @Override public Serializable generate(SessionImplementor session, Object obj) throws HibernateException { if (obj == null) throw new HibernateException(new NullPointerException()) ; if ((((EntityWithId) obj).getId()) == null) {//id is null it means generate ID Serializable

Categories : Java

Manual changes instead of scaffolding in rails
You should ALWAYS have the same gem versions in production as you do in development. Use Bundler for this with RVM or rbenv. This will allow you to have a specific gemset + ruby version for each project (and even branches within them)

Categories : Ruby On Rails

Download a file on button click and send value to the download file as parameter
window.location.href = 'excel.php?param=123'; at the end of excel.php simply output excel file contents header("Content-Disposition: attachment; filename="excel.xls"); header("Content-Type: application/force-download"); readfile('excel.xls') die();

Categories : PHP

How to avoid downloading files to the download folder and download to other specific folder only in c#
The answer would be to pick one: either render the control to a string and output to Response OR WriteAllText. If you want to use the WriteAllText to save the file to a determined location, then perform the action and pop up a notification to the user that the file was saved.

Categories : C#

Java download to target (target can't be found) and 0 byte file download
You are using the transferFrom() method as a one-liner. However, I think you should check whether more data is available. From the API: An attempt is made to read up to count bytes from the source channel and write them to this channel's file starting at the given position. An invocation of this method may or may not transfer all of the requested bytes; whether or not it does so depends upon the natures and states of the channels. Fewer than the requested number of bytes will be transferred if the source channel has fewer than count bytes remaining, or if the source channel is non-blocking and has fewer than count bytes immediately available in its input buffer. A similar question was also posted that may help you.

Categories : Java

Struggling with manual dependency injection
I think you are overcomplicating the design with factories and facades, this is your problem, not DI. Inject simpler objects and let them do some work for your class. Example 1: With a Di container you would simply var fileFacade = // Get me a FileFacade and sort out all it's dependencies for me. You are over using the facade and factory patterns and over-designing. Just because a pattern exists doesn't mean you have to use it everywhere (same goes for DI). What do you want to achieve here? Get some files? Inject an interface that does this. Keep it simple. Example 2: This is were a DI container comes in. The first three or four lines are replaced by one. The creation of a new instance of the Configuration class automatically includes its dependencies. KeywordFactory facto

Categories : C#

Repeated Manual Slideshows in Javascript
Why reinvent the wheel? You'll find plenty of very well built, battle tested javascript carousels out there that will solve the issue you're worrying about, and probably a bunch down the line. A great example would be Filiament Group's https://github.com/filamentgroup/responsive-carousel If you must write your own, you can do something like this to optimize the code above: var imageArray = [ 'img/src/example.jpg', 'image/src/example2.jpg' // and so on, not forgetting commas between each, but not after the last one! ]; var images = []; for (var i = 0; i < imageArray.length; i++) { images[i] = new Image(); images[i].src = imageArray[i] } And now you're reusing code. You could create an different images array for each of your different carousels. You could also make y

Categories : Javascript

Calling functions from section 2 of the manual in C++
I'm curious if C++ libraries now have a more C++ way to access these functions w/o having to include a lot of C header files? They don't, since those functions are provided by POSIX and not a feature of the language. What is provided, however, are iostream abstractions (C++98, chapter 27) which do much of the common functionality of the "section 2" open()/close()/read()/write() calls. C++11 provides yet more abstractions which cover more of the functionality provided by the POSIX, Windows (etc) APIs.

Categories : C++

Waf, trouble adding manual dependencies
It depends on how you want the target to be produced from the dependencies. In the simplest case, you just use a build-rule with sources and a target: def build(bld): bld( rule = 'cat ${SRC[0].abspath()} > ${TGT}', source = ['hello.txt', 'there.txt'], target = 'out.txt' ) As you can see, out.txt will be produced by cat:ing hello.txt to it and both hello.txt and there.txt will be seen as the targets dependencies. Here I have hardcoded the dependencies in the wscript, but you would of course call your program that generates the dependencies list as use that.

Categories : Python

Device Tree and manual registration
Dynamically modifying the loaded device tree is not something we usually do, although it's possible. I understand you don't really care about the device tree for this new device. I suggest you create a new module to add your device and, once it's loaded (after insmoding it), insmod your driver module. In fact, the order doesn't matter. When you add a device, all drivers will be checked and the ones that match will be probed, and when you add a driver, all devices are checked against it. To create the device, you first allocate it: struct platform_device *pdev; int inst_id = 1; /* instance unique ID: base address would be a good choice */ pdev = platform_device_alloc("unique_name_here", inst_id); Then, you will want to create resources, at least one for the memory mapped range. For th

Categories : Linux

Manual rollback Spring MVC + Hibernate
You could use application level exception to rollback your entity operations. When this custom exception thrown the related operations rollback. Please see following documents to see how to define custom rollback in Spring.

Categories : Java

achartenginge manual legends and labels
There is a setShowLegendItem(boolean showLegend) method in SimpleSeriesRenderer, so it is inherited by XYSeriesRenderer. You should call this method for most of your renderers excepting 2 of them. In order to have custom Y axis labels, you need to do the following for each such lavel: renderer.addYTextLabel(y, "text"); And you also need to disable the default labels: renderer.setYLabels(0);

Categories : Misc

Unable to do manual MySQL install
I guess this is because default table engine is InnoDB but InnoDB support is disabled. You can try this - add line default-storage-engine=myisam under [mysqld] block in config file. Edited for newest MySQL version: [mysqld] innodb=OFF ignore-builtin-innodb skip-innodb default-storage-engine=myisam default-tmp-storage-engine=myisam

Categories : Mysql

How to protect a form from a manual change
Always assume that the user can do this. Always validate in server-side code that the user is allowed to do what the user is attempting to do before doing it. That's basically it. If the user manually modifies client-side values or manually crafts a POST with their own values, one of two things should happen: If the user is allowed to perform that action, the action is performed and the server responds as usual. If the user is not allowed to perform that action, the server responds with an error. What would happen if the user requested through the site's normal functionality to edit that record? That's exactly what should happen if the user tries to do it manually. So essentially in the controller action method where the edit is performed, check the permissions to make sure the u

Categories : Asp Net Mvc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.