w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Gatling proxy configuration
As stated in the documentation, the first parameter is the host name, not the url. Please use: val httpConf = http.proxy("proxy.server.address", 8080)

Categories : Scala

How to Get Ticket In Gatling using Correlation
First of all, you will need to make a first GET request to your service as such: http("getLogin") .get(casUrl) Considering the casUrl val contains the path to your actual service, then, and only then, will you be able to retrieve the information you need, let's say, with a css expression: http("getLogin") .get(casUrl) .check(css("input[name='lt']", "value").saveAs("lt")) Checkers are used to extract data from the body of a request. The saveAs is the important part. It will allow you to record data into gatling's session. You can reuse it this way: http("postLogin") .post(...) ... .param("lt", "${lt}") The brackets are also mandatory : it notices Gatling to try and search in the session the value associated with the key lt. Here is a full example based on your script:

Categories : Testing

Gatling plugin for Jenkins without pom.xml
I think that you should send your results into the workspace of the job, not the job itself. In the code the plugin looks for results in the workspace of the build. Hope this helps!

Categories : Jenkins

Magento not recognizing custom sql setup
Figured it out... <config> <modules> <namespace_module> <version>0.0.1</version> </namespace_module> </modules> </config> needs to be... <config> <modules> <Namespace_Module> <version>0.0.1</version> </Namespace_Module> </modules> </config> Your module namespace and module name needs to match the module namespace and module name directory structure.

Categories : PHP

Custom error message using WiX setup
You can do this using properties. Use the Bitmap control to set the icon. <Binary Id="RightClick" SourceFile="ResourcesRight.jpg" /> <Binary Id="WrongClick" SourceFile="ResourcesWrong.jpg" /> Use SetProperty or CustomAction to set the property value based on a condition and pass the value to the Bitmap control. <PropertyRef Id="NETFRAMEWORK40FULL" /> <Property Id="NETFramework_Icon" Value="WrongClick" /> <SetProperty Id="NETFramework_Icon" Value="RightClick" After="AppSearch">NETFRAMEWORK40FULL</SetProperty> In dialog, <Control Type="Bitmap" Id="NETFramewor40ico" Width="20" Height="20" X="240" Y="70" Text="[NETFramework_Icon]" /> Regarding the second query, disable the next button if any prerequisites are not installed or throw a cu

Categories : Wix

setup.py include custom data file
Use this (if it were in data dir) data_files = [('mylib/data', ['mylib/data/_core.pyd']), ..others] make sure to include it in MANIFEST.in with include keyword, like: include mylib/data/*

Categories : Python

Trying to override _beforeSave method and Magento calling both custom method and core method as well
The same question was answered here. The main idea is that if you copied the method from the original class, this line parent::_beforeSave($customer) will call the original method. You can replace that line with Mage_Eav_Model_Entity_Abstract::_beforeSave($customer); thanks @ProxiBlue for the idea.

Categories : Magento

How install custom wordpress setup on openshift server
Thank you for posting to our forums as well. See https://www.openshift.com/forums/openshift/how-install-custom-wordpress-setup-on-openshift-server

Categories : Wordpress

Stop setup error inside Custom Action With WIX installer
It's all about returning the correct "error code" from the custom action. If you want to terminate the installation, return ActionResult.Failure from your CA. Side note: displaying UI from inside the custom action is generally a bad idea - this scenario doesn't support silent installation the way it should go.

Categories : Wix

How to mock/setup a method with IEnumerable input parameters using Moq?
First of all moq required that you can moq interface methods or virtual methods . So first thing to do is do interface or virtual method. Your static method is not mockable EDITED If your method is not static then do the following and you dont need verifiable mock.Mock<Helpers>().Setup(r => r.DistinctBy(It.IsAny<IEnumerable<TSource>>(), It.IsAny<Func<TSource, TKey>>())).Returns(ieList);

Categories : C#

How to create a custom copy method for a custom model arraylist?
Add a copy constructor to your class Human, private static class Human { public Human() {} public Human(Human human) {} } and use it to create a clone of the List<Human> backing your TableModel List<Human> list = new ArrayList<Human>(); Human human = new Human(); list.add(human); List<Human> clone = new ArrayList<Human>(); clone.add(new Human(human)); To remove a row, just give your table model a public remove() method that forwards the request to the List implementation and fires the appropriate TableModelEvent. I'm a little disturbed that you appear to be implementing the TableModel interface. Instead, extend AbstractTableModel which has the event machinery in place, as outlined here and here.

Categories : Java

How to add option that User to select a location to install in .Net Setup Project while installing setup?
Case of Winforms deplyment: Right click on the deployment project in the Solution window and select View, File System. Click on the Application Folder. Notice in the Properties window, change the Default location to whatever you want Case of Web: You can implement this by overriding the “Install” method, check this for an example Allow user to set physical directory path during Web Project deployment

Categories : Asp Net

How to close setup window after installation by Inno Setup?
You need to add the nowait flag to that [Run] section entry. So modify your script like this: [Run] Filename: {app}myexe.exe; Description: Launch my app; Flags: postinstall skipifsilent nowait

Categories : Windows

How to setup a HTTP Source for testing Flume setup?
Hopefully this helps you get started. I'm having some problems testing this on my machine and don't have time to fully troubleshoot it right now, but I'll get to that... Assuming you have Flume up and running right now, this should be what your flume.conf file needs to look like to use an HTTP POST source and local file sink (note: this goes to a local file, not HDFS) ########## NEW AGENT ########## # flume-ng agent -f /etc/flume/conf/flume.httptest.conf -n httpagent # # slagent = SysLogAgent ############################### httpagent.sources = http-source httpagent.sinks = local-file-sink httpagent.channels = ch3 # Define / Configure Source (multiport seems to support newer "stuff") ############################### httpagent.sources.http-source.type = org.apache.flume.source.http.HTTP

Categories : Java

Proper setup of custom theme for single page website + separate blog page
index.php should really be your blog template not your static home page. Make a copy of page.php to page-home.php (or whatever you've named your front page), then put the static content in there. You probably won't even need to assign the template to the page - WordPress will do that automatically based on the file name. By default, page.php is used for all static pages, index.php is used for whatever you've assigned as your blog page in the "Reading" section of the dashboard. index.php is also the template of last resort, which will be used if WordPress can't find any other appropriate template files.

Categories : Wordpress

Is it possible to setup environment variables within noses setup.cfg
No nose does not have any current ability to set environment variables from a config file: def _configTuples(self, cfg, filename): config = [] if self._config_section in cfg.sections(): for name, value in cfg.items(self._config_section): config.append((name, value, filename)) return config def _readFromFilenames(self, filenames): config = [] for filename in filenames: cfg = ConfigParser.RawConfigParser() try: cfg.read(filename) except ConfigParser.Error, exc: raise ConfigError("Error reading config file %r: %s" % (filename, str(exc))) config.extend(self._configTuples(cfg, filename)) return config Any configuration options specified from a configuration file

Categories : Python

What is the difference between passing It.IsAny() and the value of It.IsAny() to a method setup
It.IsAny<int>() has return type of int and returns 0, so your second setup is equivalent to: mock.Setup(x => x.Bar2(0)).Returns(true); I didn't check the moq code, but I'm pretty sure that when it evaluates the expression in the setup method, it takes into account that the parameter is actually It.IsAny vs. a normal number. You are better off if you create the setups directly in your helper methods, and not pass It.IsAny.

Categories : C#

Call ajax inside a custom method and return ajax result to called method
The Ajax call is asynchronous and takes its time to complete, while the execution goes on and that's why you don't have any data in the "return". You need to pass a callback function to your callActionUsingAjax and call it in your success handler (or complete or error that depends on the logic. Like this: $(document).on('click', ".addComponent", function(){ //... other stuff callActionUsingAjax(urlAction, dataFields, function (data) { //this is tha callback (third argument) var ajaxActionResult=ajaxResult(data); $('.addComponent').html(htmlContent).fadeIn(); $('#popUpForm').html(ajaxActionResult); $('#popUpForm').dialog("open"); // all of the above happens when ajax completes, not immediately. }); return false; }); function call

Categories : Ajax

Jquery validation: call equalTo method from a custom validation method
You don't need to call the original equalTo from within your custom method... just write a whole new function using the original as your basis. This is the default equalTo function... function( value, element, param ) { var target = $(param); if ( this.settings.onfocusout ) { target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { $(element).valid(); }); } return value === target.val(); } Put it inside your custom method and tweak it to suite your needs... $.validator.addMethod("equalToAndHide", function(value, element, param) { var target = $(param); if ( this.settings.onfocusout ) { target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { $(element).vali

Categories : Jquery

pyinstaller setup failed with "setup.py is not yet supposed to work. Please Use PyInstaller without installation."
As it says "it is not yet supposed to work" - if you read the documents you will find that you just unzip/unpack it into a local directory and run it from there. You are not supposed to run setup.py in pyinstaller at all - see here for how to set up pyinstaller. Once installed and on your path you run by typing pyinstaller your_main.py in your project directory. You may have to generate a specification file and edit it for things to work correctly - See the documentation!

Categories : Python

php custom array_replace_recursive method
The isAssoc() method in the first answer of this post is what your looking for: PHP Arrays: A good way to check if an array is associative or sequential? That method will check if the array is index and return true if it's the case.

Categories : PHP

Custom async Method
You can install Microsoft.Bcl.Async for WP7.5 support. If you need WP7.0 support, your best bet is BackgroundWorker. P.S. Your WinForms example would be better written as: private async void btnStart_Click(object sender, EventArgs e) { await Task.Run(() => MyMethod()); } private void MyMethod() { Thread.Sleep(5000); } Following these best practices: Avoid async void. Don't use Task.Run in general-purpose library methods.

Categories : C#

Custom Audience Opt-Out Method
Apologies - looks like the documentation was out of date, the proper end point is https://graph.facebook.com/act_{ad_account_id}/usersofanyaudience (singular). We have updated the documentation.

Categories : Facebook

Custom timeout for a method - Android
You can do this in many ways TimerTask CountDownTimer Thread.sleep() (on a background thread, please) Runnable You have many options, it just depends on how you want to implement it and what you need. There are many examples and tutorials for each on The Google and SO. CountDownTimer sounds pretty good for this because you can set the time in millis and do what you want in onFinish() but any could work.

Categories : Android

Custom NSLog Method ( Variadic )
Instead of using a custom method, try adding this macro to your app, perhaps in your .pch file. #ifdef DEBUG #define MyLog(x, ...) NSLog(@"%s %d: " x, __FUNCTION__, __LINE__, ##__VA_ARGS__) #else #define MyLog(x, ...) #endif This will run a custom log I call MyLog when in debug mode, and when in release, it wont do anything. It also prints out some other useful information like the file and line number of the log.

Categories : IOS

Querystring not found in Custom API get method
In custom APIs, the request parameter passed has the same properties as the request object used in express.js. To access the query string, you'd use request.query: exports.get = function(request, response) { var httpReq = require("request"); var lat = request.query.lat; // the type of the variable is a string; use something like parseFloat if you want it as a number var lng = request.query.lng; response.send(200, { lat: lat, lng: lng }); };

Categories : Azure

How do I add a custom method to a Ruby library?
Monkey-patch some methods - in ruby you can open class again and add some methods, or use some technique like module MyPatches def query_with_aliases # code here... end end TargetClass.send :include, MyPatches

Categories : Ruby

Rails 4 custom helper method
You're iterating over posts and want to display the time for each, yes? If so, you should pass the post into the recent_post_time method, eg. <% @posts.each do |post| %> <%= recent_post_time(post) %> <% end %> And then adjust your recent_post_time method to use the passed in post. You should also not be trying to assign the value of created_at, just output it. Checking that the hour is < 24 isn't quite what you want either (it's always less than 24 given that there's only 24 hours in a day, so it would always be 0-23) - you want if it was greater than a day ago, so I've changed your code to reflect that. def recent_post_time(post) if post.created_at < 1.day.ago post.created_at.strftime("%R") else post.created_at.strftime("%v") end end

Categories : Ruby On Rails

How do I add a custom method to a backbone model?
Try this: SomeModel = Backbone.Model.extend({ initialize: function(){}, someFunction: function(){ //do something } }); And this: var model = new SomeModel(); model.someFunction();

Categories : Backbone Js

Using model method name for id in a custom helper
You might need to employ use Expressions code like this SO answer to get the property name as a string. Here's the key bit, where action is your lambda model => model.EntryDate: var expression = (MemberExpression)action.Body; string name = expression.Member.Name;

Categories : C#

get and call custom object method
From the linked code: onClick : function(e){ e.preventDefault(); this.disable(); setTimeout($.proxy(this, '_callback', 'onClick', e), this.settings.delay); return false; }, _callback: function(callback, e){ this.settings[callback].call(this, e); if (callback == 'onClick' && this.settings.formSubmit){ this.canSubmitForm = true; this.$form.submit(); } }, This seems to indicate that you can pass in a click handler as an option, e.g. $("#next2").CLButton({ 'callback' : function () { // stuff to do onclick }, // other options here }); But if you want to change the source of CLButton, you could do this: _callback: function(callback, e){ this.hideLoader(); //

Categories : Jquery

Custom method for UIPageviewController datasource
You can add whatever methods you like to your data source class. Methods that are considered public should also be defined in the header file. But that's not what you're asking. You're asking: how can I get UIPageViewController to call it? The short version is: you can't. While your method has a nice, readable signature, to the compiler it's no different to: - (void) pageViewController:(PageViewController *)pageViewcontroller banana:(banana*)banana; There's no way that the controller could be expected to know what to do with it. I'm afraid, in general, you have to use the methods that are published. There are some exceptions. For example, sometimes there is no delegate method but you can subscribe to a notification. Or maybe there's another delegate to use? In your case I would exp

Categories : Iphone

Calling custom controller method
You should setup a route for this: # routes resources summaries do put :done_order, on: :member end This should allow to write something like this: = link_to "Done", done_order_summaries_path(@summary), method: :put I'm not sure what you've named your objects, but it doesn't seem you've followed convention. So that part is up to you, but that's the basic mechanism. Another note is that you've put a link inside a button tag. I'm not sure that's even valid. There's no need for you to do that. Just style your link to look like a button or use a button instead, or even a button with a form.

Categories : Ruby On Rails

Custom validation using helpers method
If the comment knows if it was created by a registered user (belongs_to :user), you can simply check against that: def validate(record) if record.user_id.nil? && User.where(:email => record.comment_author_email).exists? record.errors[:comment_author_email] << 'This e-mail is used by existing user.' end end If not, I think this validation should not be performed using a standard validator. It won't be aware of enough of the context to determine if the model meets this criteria. Instead, you should manually check this by passing the current_user from the controller itself: # in comments_controller.rb def create @comment = Comment.new(params[:comment]) if @comment.validate_email(current_user) && @comment.save ... end # in comment.rb def validate_

Categories : Ruby On Rails

Extension Method for Custom Attributes
Unfortunately you can not get the attributes you used to decorate the properties by reflecting on the type of the property itself. I have therefore modified your ViewModelPropertyName(this object) Extension method slightly to take in the name of your desired property. This method will now take in the name of the property whose attribute you wish to get. If the attribute exists it will return the value passed to its constructor, if it on the other hand, does not exist it will simply return the name of the property you passed in. public static class ModelExtensionMethods { public static string ViewModelPropertyName(this object obj, string name) { var attributes = obj.GetType() .GetCustomAttributes(true) .OfType<Meta

Categories : C#

What is wrong with my custom validate method?
It looks like your regular expression might not be working. Either way, I put together a quick jsfiddle that validates the first name and doesn't allow submission until Hello or World aren't included (these are case-sensitive by the way): http://jsfiddle.net/C7Mt4/13/ Here is my validation code for "words": $.validator.addMethod("words", function (value, element) { return /^((?!Hello)(?!World).)*$/.test(value);

Categories : PHP

Routing a custom method with parameter
You need to pass in the user as well. verify_user GET /users/:id/verify/:u_business(.:format) users#verify verify_user(@user, @business) Otherwise how would it know how to generate the complete link?

Categories : Ruby On Rails

AudioManager getVolume custom method
The maxVolume here appears to be the SAME as the volume. The calls are identical, and so you will always get 1.0 as a result. You need to call: audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); and then you should see more interesting results.

Categories : Android

Custom warnings in Eclipse for forgetting a method?
You mean like this? Lint warnings can do lots of handy things - page through them and see what suits you!

Categories : Android

'Could not find method..' on custom actionbar - Android
The textOnClickTest () method should accept a parameter of fype View. Something like this: public void textOnClickTest (View view){ //.. } (As a side note, inflating that RelativeLayout in onCreateOptionsMenu() does not seem an appropriate location. If you want something to happen when a menu option is clicked, then you should override onOptionsItemSelected())

Categories : Android



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