w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Programmatically set values of jsoup parsed webpage
Changes you make in your Jsoup-parsed objects are not reflected on the page as these objects have no connection to the page code which is displayed in browser. You should look towards AJAX to set a value from a Java app on a web page. Make an asynchronous call from your page to your app and use JavaScript to set the values you need on callback.

Categories : Java

How to copy data from a cell in Excel to a webpage text field?
I suggest using an existing tool such as curl or wget. Both can be used to fetch and post data to websites and they work great with scripts.

Categories : HTML

Copy as html to clipboard programmatically
Try wrapping that code within either <pre> tags or <code> tags. If that doesn't work, you should be able to grab the content with jQuery's html method, serialize that into a string, and copy it to the clipboard.

Categories : Javascript

How to dynamically copy selected ListItems from a ListBox to a DropDownList AND have it display correctly in a Webpage
I believe that, you need to add the trigger for the second UpdatePanel with ID as OptionsUpdater. Similar to the way you did for the first one. <asp:AsyncPostBackTrigger ControlID="GroupList" EventName="GroupList_SelectedIndexChanged" /> Please try updating the html. Also there is no partial update, while using update panel also, asp.net actually does all the work , but only a part of the page is updated and user feels like it is doing some thing on back end. Can I suggest you to achieve these kind of tasks using jQuery.

Categories : C#

How do I copy an instanced MovieClip multiple times programmatically?
You should assign class name to the symbol of bird in the library: open library F11 select bird movie clip open symbol properties window (right click->properties) select "Export for AS" check box assign class name for the symbol, for instance MyBird Now you can instantiate you class as many times as you want by the code: doStuff(new MyBird());

Categories : Actionscript

How do I copy my sqlite file from documents directory to app bundle using XCode menu and not programmatically
1.Drag and drop .sqlite file from finder on to Xcode files section. 2.Run the code below from application didFinishLaunchingWithOptions: BOOL successBool; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"YourDatabaseName.sqlite"]; successBool = [fileManager fileExistsAtPath:writableDBPath]; if (successBool) { return; } NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"YourDatabseName.sqlite"]; successBool = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&

Categories : Misc

Directing to a webpage after comparing a input variable in perl webpage
You are looking for the redirect header CGI.pm: Generating a Redirection Header To elaborate, once you've computed the next URL, you add a redirect header to tell the browser to go there. There are two ways. The first way is to call redirect($new_url). The second is to call header('Location', $new_url). I've found that sometimes, the redirect() method doesn't work for me, and I have to resort to the header() method. But that may have been my old, old version of CGI.pm. The other thing to remember, is that neither of those methods end your request processing. They simply add a header to the response's header list. It's up to you to exit correctly from your script.

Categories : Forms

Bring value from one webpage to another webpage in Ruby on Rails website without database
OK, after a night of research, I was able to pull together a few different sources that helped me get an answer to this one. The most helpful answers were here: pass parameter by link_to ruby on rails and Pass Variable between Views in Rails I learned how to use link_to to pass the parameters from one view to another view (one webpage to another, to a user). Here is how I did it: newmaps.html.erb <%= link_to 'Edit', maptry_path(:newsavedmap_id => newsavedmap.id) %> The above code uses the anchor text "Edit" and links the user to the maptry.html.erb view. It also brings over the newsavedmap_id. Then, I updated the maptry_controller maptry_controller.rb @newsavedmap = Newsavedmap.find(params[:newsavedmap_id]) With this in place, I can add any of the information from

Categories : Mysql

How to ensure a webpage's content extends to the bottom of a webpage using only CSS
Notice you specify header height in pixels and everything else in %'s also note the excess is exactly 155px over the page. The header was pushing everything downwards because you told content to take room already taken by the header new css: html, body, div, header { box-sizing:border-box; } html, body { .... height:100%; .... } #wrapper { height:100%; .... } header { height: 20%; width: 100%; .... /*Top Gradient Defined*/ ..... } #content { ..... height:80%; .... } Here's a jsFiddle example

Categories : HTML

How can I keep the select / select all / cut / copy / paste bar from appearing when I programmatically select text in UITextField
What you need is UIMenuController and you can hide it using - (void)setMenuVisible:(BOOL)menuVisible animated:(BOOL)animated so after your [textField selectAll:self]; call the above method to hide the menu. EDIT After a little search on google it seems that you will need to create a subclass of UITextField and override the - (BOOL)canPerformAction:(SEL)action withSender:(id)sender and return NO from this in order to hide the UIMenuController. I can't test this right now since I'm not at my office but you should also try the following line [UIMenuController sharedMenuController].menuVisible = NO; before you start to implement a subclass of UITextField

Categories : IOS

To create a copy of object in java w/o clone,copy constructor and copy factory
You can just create a new object for NewDog using OldDog Have you considered something like this? NewDog dog = new NewDog(someOldDogObject); While constructor of NewDog can be. public NewDog(OldDog oldDog){ this.dogWeight = oldDog.dogWeight; // keeping the same weight this.dogName = "newDog" + oldDog.dogName; // changing your dog name as per rquirement. }

Categories : Java

Downloaded webpage looks different than the original webpage
This occurs because your scraped version doesn't include the Cascading Style Sheets (CSS) linked to by the page. It also won't include any images or javascript linked to either. If you want to obtain the linked files, you'll have to parse the source code you scrape for them.

Categories : Python

Add UISearchBar programmatically to a programmatically added UITableView in a normal ViewController
Is your object implementing the delegate methods in UISearchDisplayDelegate? In other words, you have to define what happens when text is entered in the search bar, it does not happen automatically for you.

Categories : Objective C

How to display webpage in the webpage
You shoud change Main.aspx to a usercontrol(.ascx) then you can include it like this <%@ Register TagPrefix="uc" TagName="Main" Src="~/Controls/Main.ascx" %> <uc:Main id="main" runat="server" />

Categories : Asp Net

Write a function to dynamically create a new copy of string and return a pointer to the new copy (C)
I should start by pointing out that in my opinion, given the number and (especially) nature of the mistakes in this code, you probably need to get a good book on C. Your newString = s; overwrites the pointer instead of copying the string into the space you just allocated. Thus, you lose the pointer to what you just allocating (leaking the memory) without making a copy. You probably want to use strcpy instead of direct assignment. Your computation of the size you allocate isn't what you really want either. Typically, for a string of length N, you want to allocate N+1 bytes. You're currently attempting to allocat sizeof(int * strlen(s)) bytes, which shouldn't even compile.

Categories : C

What service will copy a third-party JSON feed every few seconds so users can access the copy?
Check out Feed the Fire, which reads RSS feeds into Firebase. I think you'll find it a great idea bank and a close fit for your needs. Essentially, it uses a node.js process to read the source feeds on a regular interval and inject them into Firebase for consumption. The code involved is rather trivial: Var Firebase = require('firebase'); setInterval(function() { var jsonData = /* get data from your JSON feed */; new Firebase(URL).set( jsonData ); }, FREQUENCY_OF_CHECK_IN_MILLISECONDS );

Categories : Javascript

If I instantiate a LinearLayout as a copy of an existing one, once I perform a chance on the original, it's also done on the copy
Any time you see changes to one object reflecting in what you think is a copy, 100% of the time the problem is that you don't have a copy but rather a second reference to the original object. You will need to do some digging into LinearLayout to determine whether the .clone() method is fully implemented, or manually make a copy of all the fields

Categories : Java

how to use ZeroClipboard.js to copy static word when page load copy to clipboard
As mentioned in the comments, this requires a user interaction. I recommend having a div with this style. .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; text-align: center; background: rgba(255, 255, 255, .5); } Bind zero clipboard to that, and instruct the user to click to copy the text and continue. Users should always be notified of their clipboard modifications. If you end up replacing their college thesis with some arbitrary text, without warning, they might not be so happy...

Categories : Javascript

Doubly-linked List copy constructor (can't copy tail-to-head)
By having a const argument, you're calling a non-const member function on const object. Non-const functions do not promise to not modify the object. You can declare these member functions as const to avoid this error: Node *getHead() const .. and so on As for your first question, I don't know how to solve it (yet), I have a few recommendations: Use nullptr instead of NULL or 0 Use list initialisation for your strings: string f { curr->getData()->getFirst() }; I suggest you debug your code line by line, using a good debugger tool, like Visual Studio; it will help you solve your problem in minutes. If you are still unsure, you can cut the amount of code to be tested, down to a few lines and post it.

Categories : C++

Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
ITEMS needs a definition available in the same translation unit to be used as an array size. Change its declaration (extern int const ITEMS;) to also be a definition: int const ITEMS = 9;

Categories : C++

What is good practice? A copy constructor or a defensive copy method
As far I understand your question In copy constructor you would do something like Graph copy = new Graph(objectToBeCloned); and in getGraph() you would do Graph copy = objectToBeCloned.getGraph(); I suggest make your Graph class implement Cloneable interface and override clone() method to get a deep copy you need.

Categories : Java

Is data handed over to UIPasteBoard deep copy or shallow copy?
If you ask about - (void)setData:(NSData *)data forPasteboardType:(NSString *)pasteboardType than it is surely a Deep copy. If you ask about strings, URL's, Colors they are also Deep copied. Only about the Images I am preety sure that it uses the same CGImageRef, because UImage does not implement NSCopying protocol You can test it just closing your application and see that data stays in the pasteboard.

Categories : IOS

To Copy the Selected text in Pdf which is inside an Iframe without using copy, paste
The adobe documentation says there's no way for JavaScript in the browser to access the PDF. Acrobat JavaScript does not have access to objects within an HTML page. Similarly, HTML JavaScript cannot access objects within a PDF file. http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJSGuide.pdf What you could try is rendering the pdf itself in JavaScript using a library like pdf.js. Once the pdf is part of the dom, you could attach a listener in a similar fashion to what you've done for the text documents.

Categories : PHP

XSL - Copy tree, copying some nodes twice and changing attribute in second copy
You are quite close. Only one lien missing. Add a line to copy all attribute <xsl:apply-templates select="@*"/> before changing the attr2 content. Try this: <xsl:template match="node()[@attr2='yyy']"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:attribute name="attr2">changed</xsl:attribute> <xsl:apply-templates /> </xsl:copy> </xsl:template>

Categories : Xml

Error when using angular.copy() to copy data returned from ngResource
Take a close look at angular.copy doc: destination(optional) – {(Object|Array)=} – Destination into which the source is copied. If provided, must be of the same type as source. The result you got back from service call is probably an array; you however initialized $scope.grid.originalData as an object or something else other than array, so you got this type error. Try to figure out what type the result is, and make $scope.grid.originalData the same type before calling angular.copy.

Categories : Javascript

Warning: copy() [function.copy]: Filename cannot be empty
http://www.php.net/manual/en/ini.core.php#ini.post-max-size Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.

Categories : PHP

Override Windows copy (as in copy/paste) functionality?
No. The copy-paste is not done by Windows, so your assumption is wrong. You can see this from the fact that it's possible to copy many things that Windows is unaware of. For instance, parts of CAD drawings - Windows doesn't ship with support for that out of the box. And obviously, you can't copy a CAD drawing component either. Remember, I'm not hiding information from you here. If things worked as you assumed, you would need to copy anything that an application wants copied, without any knowledge up front. In fact, you would need the capability today to copy objects that I will only write tomorrow! In reality, copy-paste works by cooperation between the source and destination application.

Categories : C++

Copy vector struct to file using ostream_iterator and copy
You'll need to overload operator<< for AccDetails. It is what ostream_iterator calls internaly. Something like this: std::ostream& operator<<(std::ostream& stream, const AccDetails& obj) { // insert objects fields in the stream one by one along with some // description and formatting: stream << "User Name: " << obj.username << ' ' << "Real Name: " << obj.name << ' ' << obj.topicid << ' ' << obj.testid << ' '; return stream; } The operator takes the stream it inserts to as first parameter and a constant reference to the object it is streaming as the second one (this allows passing temporary AccDetails, too). Now you can also say: AccDetails acc; std::cout <&

Categories : C++

Use Sharepoint Copy web service to copy folder and contents
There is a simple solution to this problem , as its just about copy and paste use the simple XCOPY command XCOPY Copy files and/or directory trees to another folder. XCOPY is similar to the COPY command except that it has additional switches to specify both the source and destination in detail. To copy a folder including all subfolders XCOPY C:utils* D:Backuputils /s /i here /i defines the destination as a folder for more detail please refer this link

Categories : C#

The copy constructor creates dependent copy
In your copy constructor, you are just doing a shallow copy, while you need to do a deep copy: public Route(Route r) { this(r.sites); } Here, you are still copying the reference of the list, which still points to the same ArrayList. You should modify it to create copy of list too. Possibly, you also need to create copy of the elements inside the arraylist like so: public Route(Route r) { List<Site> newSites = new ArrayList<Site>(); for (Site obj: r.sites) { // Add copy of obj to the newSites // So you need yet another copy constructor in 'Site' class. } this.sites = newSites; } Check this post - Shallow Copy vs Deep Copy.

Categories : Java

i need to copy and then rename the copy of a file if it already exists
Try this code, let me know if it works Function <?php function recursive_naming( $file, $i = 1 ) { $dirname = dirname( $file ).DIRECTORY_SEPARATOR; $filename = pathinfo( $file, PATHINFO_FILENAME ); $extension = pathinfo( $file, PATHINFO_EXTENSION ); if ( !file_exists( $file ) ) { return $file; } $filename = preg_replace( '/_d+$/', '', $filename ); $file = $dirname.$filename."_".$i.".".$extension; $i++; return recursive_naming( $file, $i ); } ?> Example: <?php $pastaTemp = $_FILES['imagem_principal']['tmp_name']; $pastaUpload = $_SERVER['DOCUMENT_ROOT']."/casaunica/imagens/acabamentos/"; $arquivo = recursive_naming( $pastaUpload.$_FILES['imagem_principal']['name'] ); ?> It will output filename_2.jpg if fi

Categories : PHP

Copy & Copy does not work correctly with stringlist
Maybe you should think about using the IXMLDocument interface to load the XML File into a data structure and fill your stringlists afterwards. An example has been posted here: http://stackoverflow.com/a/8651934/2207071

Categories : Xml

Use std::copy to copy from random number distribution
You want generate_n (which is not actually new): std::generate_n(std::back_inserter(col), 128, std::bind(dist, gen)); (Here gen is a suitable random number engine.)

Categories : C++

Is it possible to copy part of a vector using the array copy?
Yes, use iterators: vector<int> v2(v.begin() + x, v.begin() + x + y); You can make it a bit more generic if you wish: vector<int> v2(std::next(std::begin(v), x), std::next(std::begin(v), x + y)); The reason the pointer version (which the array decays into for both arguments) works in the first place is that pointers can be treated as random-access iterators.

Categories : C++

XCode "Add Copy Files" build phase fails to copy header files when building universal framework
I found that one of the workaround is - just open and save all the files you included in the copy build phase and then build (Cmd+B). (just make the file dirty by adding a space so that modified date is updated)

Categories : IOS

Shallow copy or Deep copy?
From the link here Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements. Deep copies duplicate everything. A deep copy of a collection is two collections with all of the elements in the original collection duplicated. Your example is creating a shallow copy. A ob1 = new A(); ob1.a = 10; A ob2 = new A(); ob2 = ob1; ob1.a = 5; // <-- If you see value of ob2.a after this line, it will be 5. Deep copy will be - A ob1 = new A(); ob1.a = 10; A ob2 = new A(); ob2.a = ob1.a; ob1.a = 5; // <-- If you see value of ob2.a after this line, it will be 10.

Categories : C#

How can you copy all attributes and set them on a same new value when you copy a xml-node?
For an attribute, you can reconstruct it using name() (or local-name()). Example: XML Input <schedule> <owner> <name> <first>Eric</first> </name> </owner> <appointment> <when> <date month="03" day="15" year="2001"/> </when> <subject>Interview potential new hire</subject> </appointment> </schedule> XSLT 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy&

Categories : Xml

Is there a way to copy non-conflicting map values using std::copy?
You can do this using std::for_each and a lambda: std::map<int, int> m1 = ...; std::map<int, int> m2 = ...; std::for_each(m2.begin(), m2.end(), [&m1](const std::pair<const int, int>& a) { if(m1.find(a.first) == m1.end()) m1.insert(a); }); Effectively, this is just bundling up what you'd have to do manually into std::for_each and a lambda. As far as I know, there's not really any nicer way of doing what you want to achieve. If your compiler supports emplace (which GCC 4.7 doesn't, but 4.8 does), then you can utilize that: std::for_each(m2.begin(), m2.end(), [&m1](const std::pair<const int, int>& a) { m1.emplace(a.first, a.second

Categories : C++

SSE-copy, AVX-copy and std::copy performance
I think that your main problem/bottleneck is your _mm_malloc. I highly suggest to use std::vector as your main data structure if you are concerned about locality in C++. intrinsics are not exactly a "library", they are more like a builtin function provided to you from your compiler, you should be familiar with your compiler internals/docs before using this functions. Also note that the fact that the AVX are a newer than SSE doesn't make the AVX faster, whatever you are planning to use, the number of cycles taken by an function is probably more important than the "avx vs sse" argument, for example see this answer. Try with a POD int array[] or an std::vector.

Categories : C++

How to copy private members of a base class in to a derived class's copy constructor
You have below ways to accomplish this: (1) Create a base copy constructor (not private) and invoke that in derived copy constructor. example: class Base { private: int i; public: Base(const Base& copy) : i(copy.i) {} }; class Derived : public Base { Derived(const Derived& copy) : Base(copy) {} }; (2) Make the base members to be copied as protected; But this is less preferable way, since you are making assignment and not initialization. (3) The least preferable way is to make friend class Derived; inside the body of class Base. Use it only if it's absolutely necessary.

Categories : C++



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