w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Qt Error Creating SSL context on few computer
I found the solution, you have to add three dll : libssl32.dll ibeay32.dll ssleay32.dll BUT take these libraries from the Qt directory (example C:QtSDKDesktopQt4.8.1mingwin) not from System32...

Categories : Qt

Creating a proxy that routes through the clients computer
Unfortunately you cannot "use the clients IP" as a source when routing through such a server proxy. However you might be lucky if the service accepts an X-Forwarded-For HTTP Header. You can set that header in the proxy when sending the request to the service. The value of the header should be the clients IP. Read more about X-Forwarded-For here: http://en.wikipedia.org/wiki/X-Forwarded-For

Categories : Javascript

Ideal framework for creating a cross-platform computer vision GUI
I have used Qt. It's really clean, manageable and fast. By using Qt Creator you would be able to create user interface very fast. Linking openCV on Windows/Mac environment would not be a problem for you. Qt also let you have different linking rules for Windows and Mac, which would make it even easier for you. For threading and networking, you could use its internal classes. Then you would not need to link to different libraries on Win32 and Mac OS. Recently they added Android support too. And they had Linux support before. So, you app would works on Win32/Mac/Linux/Android and probably on iOS soon. I guess that would be huge benefit. I have also used wxWidgets with an OpenCV project couple years ago. I prefer Qt now.

Categories : Qt

Safe method to get computer IP on UNIX using Java
Check out the answers to this SO question: How to enumerate IP addresses of all enabled NIC cards from Java? I haven't tested it, but it seem to apply.

Categories : Java

Creating a tree of required items
I don't know C# well enough to provide code, but you could make each Research have an Array of type Research, that would hold the Research that must be done to be able to make the actual Research, then you only need to iterate the Array checking if all of them are completed. You don't even need to check the requirements of the requirements, as if they are completed, they already have all requirements completed. If the Research don't have any requirements you just let the Array empty.

Categories : C#

Objective-C: Trigger method with computer keyboard stroke
It's pretty hard to do, you need to have a hidden text field that you keep in focus, hide the software keyboard for it, then listen on its delegate methods for changing text. An alternative would trigger the code inside applicationWillResignActive: which gets called on application hiding, notification center showing, or double home press.

Categories : Iphone

Creating Callbacks for required modules in node.js
Yes, you can have a callback from your module. It's as simple as function funcWithCallback(args, callback){ //do stuff callback(); } While I don't know what you are trying to accomplish, the while loop looks suspicious. You probably should invest in the async package from npm. async on github EDIT: I felt the need to clarify something. While the above function does in fact intend the callback is used instead of the return value, it's not exactly async. The true async approach is to do something like this: function funcWithCallback(args, callback){ process.nextTick(function() { //do stuff callback(); }); } This allows the called function to exit and defers the execution of the logic of that function until the next tick.

Categories : Javascript

Handling array and creating list of non required elements
Check out grep: http://perldoc.perl.org/functions/grep.html If you have a short list, you can do this (using your own correct regex, of course): my @myfiles = grep { !/public|KS/ } @myfiles;

Categories : Perl

loop through list that is returned from a method until the method gives me no records
From the code provided it's hard to find an optimal solution, but... Don't see serious problems with the code, as is it's now, except a couple of suggessions: use while (readings.Count() > 0) {}, and not do/while, because already on first request there may be no readings to parse. If you are able to change the code inside Reading.GetUnProcessReadings(), this could be an option to look on using yield. So you will avoid unnecessary ToList(..) call, so new List<T> generation every time, and will avoid while loop at all, just will use foreach.

Categories : C#

How Can I Return Exit Code To Variable On Local Computer From Script Run On Remote Computer?
I do it like this: invoke-command -session $Remote -scriptblock { mycommand } $remotelastexitcode = invoke-command -session $Remote -ScriptBlock { $lastexitcode } if ( $remotelastexitcode -ne 0 ) { "$remotelastexitcode" exit 1 }

Categories : Powershell

Programatically set the time server of a remote computer to match the control computer?
You might be better off using Group Policy to set the time server. http://technet.microsoft.com/en-us/library/cc779145(v=WS.10).aspx

Categories : C#

Creating Cydia Logos Tweak, now required respring after installation (How to do)
You could do this 2 ways if you are using THEOS, First one (if you do make clean then you will have to redo these steps), Create 2 files in the DEBIAN folder which is located in mytweak/_/DEBIAN/ Call them preinst and postrm Inside those files paste: declare -a cydia cydia=($CYDIA) if [[ $1 == install || $1 == upgrade ]]; then if [[ ${CYDIA+@} ]]; then eval "echo 'finish:restart' >&${cydia[0]}" fi fi exit Then run make package to create the new package that has the respring button on it The second way is much more simpler and can be used without theos, In the control file which is located in the DEBIAN folder, you should know where this is. Add the line: Depends: mobilesubstrate Credit to Nate for this answer, although I did know this. Hope this helped.

Categories : IOS

Running a jar in a computer java.lang.UnsatisfiedLinkError lwjgl.dll in another computer
This problem generally occurs when your jar trying to use native library of operating system.In windows it is "LWJGL.DLL". java.lang.UnsatisfiedLinkError occurs if the JVM cannot find this file. try to find the existence of this file in machine 2 where your jar file is not working and try to add them to path if they does not exists.

Categories : Java

Executing command ls from windows computer to linux computer
I'm certain you could do something with sockets and system calls, but it would probably be easier to use the built in facilities and/or programs available for each. If both are on the same network, you could run an FTP or SSH server program on the Ubuntu computer and connect to it via a FTP/SSH client, like PuTTY. Sending 'ls' through PuTTY would then yield what you want it to. OpenSSH vsFTPd

Categories : C#

Doctrine 2 creating multiple records
Figured it out-the answer wasn't putting flush() outside the loop as stated above. The solution was to use detach() after committing the transaction. So: foreach($recordsToCreate as $data) { $entityManager->getConnection()->beginTransaction(); $record = new Record(); $record->field1 = $data['field1']; $record->field2 = $data['field2']; $entityManager->persist($record); $entityManager->flush(); $entityManager->getConnection()->commit(); $entityManager->detach($record); } That works for me now. The problem was that somehow (I think) the entity manager couldn't tell the difference between the first record and the rest, so detach ensures that it always has a new record when it's doing a create. Also, the transaction is in the loop now

Categories : PHP

Creating a Fake Computer Screen Within a Screen in Website
I'd just use an iFrame to show the actual content, and then take the illustration and put it around it on the parent page. You could build "navigation" (back button? and working Page Titles?) into the illustration too, that would be pretty simple and pretty cool. You'll probably want some JS involved to handle resizing of content (in the iframe) and the illustration will probably need to be split up a bit so parts can be resized properly?

Categories : Jquery

Issue while creating new records in database + MVC4
Why don't you insert some dummy PartyRoleTypes into the database? It seems like you are trying to insert the cart before the horse (unless I am misunderstanding - do you have data in PartyRoleType?). On your PartyRole class you have: [Required] public int PartyRoleTypeId { get; set; } So there MUST be at least one PartyRoleType defined. As to why its trying to insert one for you I am unsure - but when I have a relationship like this - I always insert some dummy types to reference. Moving on, after your comments I see this is not the issue. What is going on here: obj.Party.PartyId = obj.PartyId; obj.PartyRoleType.PartyRoleTypeId = obj.PartyRoleTypeId; obj is of type PartyRole, in your PartyRole class I see no definition for Party. So how are you setting obj.Party.PartyId? Is the Par

Categories : C#

Creating a single record from multiple records in SAS
This assumes you've sorted the data by teamID, and head coaches always come before assistants. Caveat: untested (I really need to get access to SAS again....) data want (drop=nc coachcode); set have; length headcode assistantcode $3; retain headcode; by teamid; nc = length(coachcode); if substr(coachcode, 1, 4) = 'Head' then headcode = substr(coachcode, nc-2, nc); else assistantcode = substr(coachcode, nc-2, nc); if last.teamid; run;

Categories : Sas

Creating a database and inserting multiple records in it
If you want to insert values then you can create function in SQLHelper class like this public void InsertData(String Name,int Age,int Address) { ContentValues values = new ContentValues(); values.put("Name",Name); values.put("Age", Age); values.put("Address", Address); this.db.insert(Table_Name, null, values); } (Here in Content values you will put Column Names and their values to store in Table); and if you want to get this Values then do like this public Cursor GetData() throws Exception { Cursor cursor; cursor = this.db.query(Table_Name,null, null, null, null, null, null,null ); return cursor; } if you want to get specific column values then you can pass column names array just after table

Categories : Android

Sqoop creating insert statements containing multiple records
You can customise the number of rows that will be used in one insert statement with property "sqoop.export.records.per.statement". For example for Netezza you will need to set it to 1: sqoop export -Dsqoop.export.records.per.statement=1 --connect ... I would recommend you to also take a look on Apache Sqoop Cookbook where this and many other tips are described.

Categories : Hadoop

Creating multiple new records with one form, only last record saved
Normally this behavior happens when all form elements have the same name in your form. Then they all get submitted, but the last one overwrites all the other ones (actually each subsequent one overrides the previous one if you know what I mean). So the last one wins. To check out if this is you case you can either check the Rails log and look at the POST request and there at the parameters. Do they all have the same name? Or you can inspect your form and make sure that they are all named uniquely. What you want in your HTML is something like this for a form element: name="user[forecase_attributes][][level]" and not name="user[forecast_attribues][level]" I like to use the Cocoon Gem in these cases, then in your case you can add the forecasts dynamically into your pages (and don't have

Categories : Ruby On Rails

Creating Child Records in hasMany Relationship with Ember.Js
What you can try and do is this post = App.Post.find(1); post.get('comments').pushObject(App.Comment.createRecord({})); //This will add a new comment to your post and set the post_id as the post id App.store.commit() Hope it helps

Categories : Ember Js

Creating nested association records Ruby on Rails
Well this ended up being really stupid and the error log didn't help at all, not even a little. So, I ended up messing around with the hash that you are supposed to be able to pass to Model.new() in order to instantiate all associations that are nested within the hash (rails doc is very good a majority of the time). But, what I found out that seems to be undocumented (unless someone can point me in the right direction of it's location in the doc's) is that: you must assign a key to a ARRAY of hashes in order to correctly instantiate a new child association record: (example rails console) INCORRECT: > p = {"contents_attributes"=>{"sort_item_attributes"=>{"position"=>"1"}}} CORRECT: > p = {"contents_attributes"=>[{"sort_item_attributes"=>{"position"=>"1"

Categories : Ruby On Rails

Is using the method driver.close() required?
No, you don't need to do that. Because second window is already close, and if you will use method driver.close() it will close your first window and the browser itself(because there is only one tab left in browser window).

Categories : Java

c# MVC Required Method for default values
I will suggest two ways of dealing with this. First, you can create a custom validation attribute, an example of which can be found [here].1 Here's a rough and ready example: public class ValidateDefaultValueAttribute : ValidationAttribute { protected override ValidationResult IsValid (object value, ValidationContext validationContext) { string value = value.ToString(); if (value == "Name") return new ValidationResult("Please enter a different name."); return ValidationResult.Success; } } Or, it sounds like you want to display a 'Name' in an input field? If you're using HTML 5 then try the placeholder attribute e.g. <input type="text" placeholder="Name"> That will display the word 'Name' in the field but is overridden once the user

Categories : C#

When do UICollectionView @required method's get called?
The asker parameter is the collection view whose delegate is the class in which you've implemented that method. By default, if you've created your UICollectionViewController in Xcode with an associated xib, it's the UICollectionView in your view and the delegate is already setup, as you say. The method collectionView:cellForItemAtIndexPath: gets called whenever the collection view needs the cell for the specified index path. The actual implementation is private, but we can infer that it gets called whenever it thinks a cell is about to become visible (because the user is scrolling, for example). And of course when the collection view first appears all the cells that will be visible are loaded. If you have 2 collection views with the same delegate then you will need to compare the asker p

Categories : IOS

return type required for overridden method
You are not returning it: return super.pop(); I assume you are coming from a more functional background; in Java, putting something at the end of the function/method does not mean the function/method returns the value.

Categories : Java

CakePHP Parent/Child Association: confusion in creating records at the same time?
try setting the 'group_id' field in the 'Requests' record manually to $this->Request->Group->getLastInsertID(); that should give you the ID of the last group created.

Categories : PHP

Why doesn't my Mongoose schema method "see" my required object?
I believe the issue is that you've created a circular dependency. Story executes require(config.models) which requires Story again inside index.js. Rather than storing a string and requireing it everywhere, try storing the models directly in config.models: config.js module.exports = { test: 'test', models: require(__dirname + '/models') };

Categories : Node Js

C# An object reference is required for the non-static field, method, or property
In the first code, you are in a class that inherits from Window, so you have a Dispatcher property in scope, which returns an instance of Dispatcher. In the second code, you're in the QRBarCode class, which doesn't have a Dispatcher property; so the compiler assumes you're referring to the Dispatcher type, and tries to call Invoke on this type, but since it's not a static method, it can't be called directly on the type. You need an instance of Dispatcher to call Invoke; you can use the one from the application: Application.Current.Dispatcher.Invoke(...);

Categories : C#

Error: An object reference is required for the non-static field, method, or property
The issue is that you're reading non-static fields from the manager class. managers.backgroundCheck = bCYes; managers.isSalary = salaryYes; managers.responsibilitys = responsibilitys.Text; managers is a class, not an object instance. You need to create a new manager object like you did with the employee.

Categories : C#

An object reference is required non-static field, method, or property error
You need to declare your method as static: public static string getAllExceptNiServiceNames() { ... } Or alternatively create an instance of your class before using the method: var q = new Queries(); string serviceNameFilterLineThree = q.getAllExceptNiServiceNames();

Categories : C#

get list of logged on users on remote windows computer from a list computer
It (csv file) should be formatted as follows: computername server1 server2 server3 'Computername' is the column name. This can be derived from the code snippet as the Foreach-Object refers to the ComputerName property.

Categories : Windows

An object reference is required for the non-static field, method, or property '_Default.RadioButtonList2'
Problem is that you have created webmethod, which can not access any server controls. Remove it. If it is required, then pass RadioButtonList2.SelectedValue in that function from client side. [WebMethod] public static string GetList(int pageIndex,string radiovalue){ .... ..... cmd.Parameters.AddWithValue("@customerGroup", radiovalue); .... .... } hope it works.

Categories : Asp Net

Timer or other idea required to allow code to continue execution after calling method and JOptionPane
But it hangs on the JOptionPane. I need a way to make it so that the program either keeps going underneath the JOptionPane or to close the pane after about 10 seconds. I am not sure how to work either into my code, currently there are two ways (better easier, comfortable) create JDialog(JFrame parent, boolean true), with default close operation HIDE_ON_CLOSE, only one JDialog as local variable, reuse this Object by setVisible(false/true) looping inside arrays of all JOptionPanes (all exists there untill current JVM is alive) by @kleopatra

Categories : Java

More efficient method for storing records from a file
Good question. Using prepared statements is important here as it will cut down on the overhead involved for each insert. You certainly don't want it to parse "insert into blah.." every time. I wouldn't worry about managing threads for reading the file and so on, that's what the OS does for you anyway. Just read big chunks of the file through a buffer and do inserts from that. You might think about dividing the file into chunks by spawning several instances of inserter tasks that start by seeking into the file and read chunks from there. The OS should buffer reads so the seeking won't be bad. Of course if your DB isn't on a RAID or at least another volume, all bets are off. Just some thoughts to stir the pot...

Categories : Java

SQL Server - Set based method for incrementing every N records
I think row_number() is probably the route to the solution update #BatchInvnums set batchID = rn from #BatchInvnums inner join (select id, (ROW_NUMBER()over(order by id)-1) / 2 rn from #BatchInvnums) v on v.id = #batchinvnums.id

Categories : Sql Server

Django, filter records from model method?
The filter should be a method of a MessageManager. See here: https://docs.djangoproject.com/en/dev/topics/db/managers/

Categories : Django

Update all records with method in rails console
update_all is for executing a database update statement on your records, so you could Location.update_all("SET postal_code=null") to clear out all the postal code fields. For your case it sounds like you just want to run your method on a batch of location objects. How about: Location.all.each do |loc| loc.geocode end

Categories : Ruby On Rails

An object reference is required for the non-static field, method, or property 'Microsoft.Xna.Framework.Input.MouseState.X.get'?
MouseState isn't a static class.. you'll need to do this: var mouseState = Mouse.GetState(); Vector2 Mouseplace = new Vector2(mouseState.X, mouseState.Y); etc. X and Y are public properties of a MouseState instance.

Categories : C#



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