w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to display any message upfront exclusive of any software or application running on System
If you want a window to always be at the front of screen, you simply have to call Window.setAlwaysOnTop(true). Since Window is an ancestor superclass of JFrame and JDialog, it will work for your purposes. With this method, the window will always be visible, even if the user switches to another app. However, the window will only keep in focus if you make it a modal JDialog and the user activates the app (i.e. you can't make the window seize focus from another app and then never let it go.). I imagine this by design. It would be really frustrating if a user's entire operating system was made inaccessible by a rogue Java JDialog that could not be closed, although it does mean that you can't have a "Take a Rest , its long Enough" message that truly forces the user to take a break.

Categories : Java

is there software for jar file copy protection, or licensing software
Copy protection can't prevent your file to be copied but you can make it fail when it is run on unlicensed machines. Selection of a copy protection mechanism is a matter of budget and time. There are many companies with many products. You can go with not yet cracked technologies like iLok etc. This is applicable for very high revenue cases. But if your target audience is less than 1000 people then a simple in-house solution might work. Consequence of a complex method is typically many calls to support line and unhappy customers. Things got a lot easier after clients are all connected to internet. You can make some simple parts to run on server which a cracker would never dive into for a replacement. Or the app might download the contents from server after installation. Latter is what I d

Categories : Misc

Matching system date to select file SQL
Make yourself familiar with: Format Models. How to convert strings to dates and other way round with to_char and to_date functions that use format models. How to concatenate strings with concat function and || operator. There's plenty of questions here about all of these subjects you can learn from. Example that should get you started: JANI@xe> select sysdate from dual; SYSDATE ------------------- 2013-08-01 07:52:55 JANI@xe> select 'Files.' || to_char(sysdate, 'YYYYMMDD') || '.xxx' as filename from dual; FILENAME ------------------ Files.20130801.xxx JANI@xe> !cat so25.sql declare v_filename constant varchar2(32767) := 'Files.' || to_char(sysdate, 'YYYYMMDD') || '.xxx'; begin dbms_output.put_line('v_filename = ' || v_filename); end; / JANI@xe> @so25.sql v_fil

Categories : SQL

Regex Matching Date from Windows System Process
I am a user of python 2.7, so I don't know if there might be a difference in regular expressions there, but I don't know what the "-" means in them. For me, what works is: loginRex = "(d?d?d+:d+:d+)" That will match 1981:05:17 and 81:05:17 both. If the latter is not necessary, just erase the "?". Can you try this? Cheers!

Categories : Python

Matching text files from a list of system numbers
Let's assume we invoke the following script this way: ./the-script.sh fulltext 5k_list_1 5k_list_2 [...] Or more succinctly: ./the-script.sh fulltext 5k_list_* Then try using this (totally untested) script: #!/usr/bin/env bash set -eu # enable error checking src_dir=$1 # first argument is where to copy files from shift 1 for list_dir; do # implicitly consumes remaining args while read bibliographic record sys_num rest; do cp "$src_dir/$sys_num.txt" "$list_dir/" done < "$list_dir/list.txt" done

Categories : Linux

Developing C# Winforms software using SQL Server 2012 in Visual Studio 2012 and running it on other system without installing SQL Server 2012
If you develop an application that use Sql Server 2012 as storage for your data then you need to install it in a way or another. There are numerous versions of Sql Server, like Sql Server Express and LocalDB. In every case you need the bits that supports your coding calls. This magazine article summarizes relevant infos on the various version of Sql Server I suppose that the right product for you is Sql Server LocalDB. A version of Sql Server that could be distributed easily with your application setup and doesn't require a complex installation procedure. However, if you don't foresee the need to escalate you application to a full Client-Server model and you need only a local storage for a single user, you could choose a single file database like Sql Server Compact Edition or SQLite or

Categories : C#

Get software's information in WiX from software
The WiX.chm documents all the standard binder variables at the bottom of the topic titled Linker (light). It does not appear the those pieces of information are available. However, it might be something you could work with the WiX toolset community with to get the code added.

Categories : Wix

Whats the best way to use JMS for this requirement
If you need to address messages to specific clients, you can use consumer-side selectors, here's a round trip example: Server Sends QueueSender queueSender = queueSession.createSender(queue); queueSender.setDeliveryMode(DeliveryMode.PERSISTENT); TextMessage message = queueSession.createTextMessage("Hello John!"); message.setObjectProperty("ToAddress", "John-123"); queueSender.send(message); Consumer Receives QueueConnection queueConn = connFactory.createQueueConnection(); QueueSession queueSession = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); QueueReceiver queueReceiver = queueSession.createReceiver(queue, "ToAddress = 'John-123'"); queueConn.start(); TextMessage message = (TextMessage) queueReceiver.receive(); The client creates a queueReceiver usi

Categories : Java

need query for below requirement
SELECT office_name FROM your_table ORDER BY CASE WHEN office_name = 'office' THEN 1 WHEN office_name = 'ab office' THEN 2 WHEN office_name = 'ms office' THEN 3 END

Categories : Android

System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)
That method not exists in .net 4.5 - before then, Delegate.CreateDelegate should be used instead. It sounds to me like maybe NInject is incorrectly using that method in a 4.0 nuget package, in which case you should report that as a bug in NInject. The first thing to do is to check you are using the correct version of the dll, i.e. specifically a 4.0 build. After that, one of: roll back to an earlier NInject version upgrade your .net framework version download the code, fix it, and submit a patch

Categories : C#

Make Javascript a requirement
I have a PHP site and would want to validate user-inputs with javascript only. That is a realy bad idea, users can submit whatever evil data they want creating a html form and post it to your php files. If you turn off JavaScript and watch this site you will see that some of the functions will work and some don't. You can display a message using the following code: <div id="jsMessage">Please turn on JavaScript</div> <script>document.getElementById("jsMessage").style.display="none";</script>

Categories : PHP

buildout and setuptools requirement
Like said in a comment it seems that your system-wide version of 0.6c11 and bootstrap.py reqiures setuptools >= 0.7. Because messing with global packages is usually bad idea I would recommend using virtualenve and virtualevnwrapperfor development and installing all requirements inside virtual environments. On Linux systems both can be easily installed using package managers. On Debian (and probably Ubuntu) apt-get install python-virtualenv apt-get install python-virtualenv After installing all have to do is: mkvirtualenv bar pip install setuptools>=0.7 Then install all other packages that you need and you are ready to go. UPDATE If you don't have root access virtualenv can be easily installed locally. See this How to install virtualenv without using sudo? for details.

Categories : Django

How to specify hardware requirement through code?
Try this code to check if phone functionality is available : public static boolean isTablet(Context context) { TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE; }

Categories : Android

what are the input cases for the following requirement
Input values for a boundary test case in this case are -1, 0, 100, 101. If X is unsigned then the "equivalent class" boundary test case should have as input: 0, 100, 101. I am not sure if you want to the test the boundaries of number representation, in this case 8 bits. So you should also test for signed 127 or 128 and unsigned 255. But it depends on representation of the signed numbers .

Categories : Unit Testing

ASP.NET MVC 4 Models without database requirement
With flat files you're always going to come into trouble if you need relations between different entities e.g. Authors, and Books. But I assume you know that. There's more on this discussion here: Flat File Database Example Try searching for 'flat file database .net mvc' or similar. This person has had a go with a text file that is pipe-delimited but could easily be adjusted for comma-delimited (they use webforms but most of the code is identical to what you'd do in MVC): http://www.nullskull.com/a/1520/flat-file-database-with-linq-and-aspnet-jquery-page-methods.aspx You might also like to try a JSON format file which lends itself to NoSQL databases like MongoDB and obviously works well with client-side Javascript coding.

Categories : Asp Net Mvc

What is the difference between SRS and Requirement Analysis?
As @CharlesB said: You're right. Although of course, there are many different terms in the industry for the specification which is the "output" of the process. The SRS is specified by IEEE. Especially in the US, SRS is the most common term for the artifact.

Categories : Misc

How to achieve MCDC for the following requirement ?
Treat x==10 as A, y==false as B, y==true as C Write separate MCDC table for two conditions as A AND B TT TF FX A AND C TT TF FX

Categories : Unit Testing

Not-nullity requirement or principle
Object firstObject = null; secondObject.equals(firstObject); how can you prevent this?? if you dont' check null before using it then it will crash. I think you will also need to check the class type like following if (other == null || other.getClass() != this.getClass()) { return false; }

Categories : Java

how to achieve this in java ? requirement given below
An array of ArrayLists List<Integer>[] nodes = new ArrayList[count]; An ArrayList of ArrayLists List<List<Integer>> nodes = new ArrayList<List<Integer>>(count);

Categories : Java

Asp.net Paypal Return Url Requirement
As far as I know localhost urls are not possible. Try this: add a rule to hosts file, and map localhost to another name, say - "mysite.com". Then provide URL with that new name and your path as Return Url for PayPal. Paypal should correctly call it. Open windows/system32/drivers/etc/hosts with notepad ( running it as administrator ) Add line: localhost contoso.example.org Now, your return url will look like : http://contoso.example.org:49457/Fun/Success.aspx and you should be able to open in your browser ( it will point to localhost ). Then, include this return url in your calls to PayPal API and put it the field on Payment Preferences page.

Categories : C#

I am having a requirement in Session Management OAM
You can use HttpSession for this. If user session already exists or not? Check that session is null or not. request.getSession() != null If user clicks on old session, then user will be logged out from current session and can continue old session. Use: request.getSession(false); 3) If user clicks on new session, then user old session will be terminated and continues with new session. Use: session.invalidate(); and request.getSession();

Categories : Java

References in C++ and its memory requirement
You can't bind a non-const reference to a const value. The compiler should give you an error: invalid initialization of reference of type ‘int&’ from expression of type ‘const int’ Even if you do get around this (with, for example, a const_cast), the code will have undefined behavior because you're modifying an originally const value. Does i takes any space in the memory as its simply a reference? That's an implementation detail - it could be optimized out completely. What you need to know is that j is just a nickname for i.

Categories : C++

Finding a way to load appropriate jars in different OSs as per requirement
Given that Java is platform independent and only loads the classes you use, I would have one JAR which has everything you need and only load the class which are appropriate for your platform. Doing what you suggest requires a sub class loader which just add complexity which doesn't appear to be needed. If you can't access a system property you can actively test your library and see which one work on your system. I am sure there is a method or class which working in one case but not the other or your wouldn't need two sets of code.

Categories : Java

C++ Map default argument typedef requirement
Is there some C++ or GCC oddity I'm missing? Your code is legal, and your compiler is old. Try upgrading your compiler. Here is a live example of your code compiling with GCC 4.8.0.

Categories : C++

Bluetooth Low Energy as an iOS device requirement?
You'll need to add the bluetooth-le option to your UIRequiredDeviceCapabilities key in your info.plist file.

Categories : IOS

Determine if a certain number is greater than a requirement
You could use a min inside a subquery or a join. select * from prices where name in (select name from prices group by name having min(cost) > 3); Link to SQLFiddle

Categories : Mysql

Password requirement not same as email regex c#
Using MVC Foolproof Validation you can write [NotEqualTo("EmailAddress", ErrorMessage="Passwords must be different that EmailAddress")] public string Password{ get; set; } http://foolproof.codeplex.com/

Categories : C#

Using c and bit shifting to solve a specific requirement
You have two problems: a mathematical problem and a coding problem. Let's ignore the math problem for the moment. You can build an array with 16 integers and count the occurrences of each letter when you scan the text. If you assume that no letter occurs more than 15 times, then you don't have to worry about overflow and you can put the counts into your 64-bit integer easily enough. You'd write: int counts[16]; // has the counts unsigned long long freqs; // this holds the encoded value // after you compute the counts freqs = 0; for (int i = 0; i < 16; ++i) { freqs <<= 4; freqs |= (counts[i] & 0xF); } At that point, the count for the first letter is in the top 4 bits of freqs, and the count for the last letter is is the bottom four bits. All the other counts are

Categories : C

Solr Indexing Design Requirement
You are looking at this problem backwards. You need to work from the results. What do you want to find? Imagine you already have everythin working correctly. Given that, what individual record would be in that search result (pincode-level entries?). Then, de-normalize down to that level and include all the information required to find that record. See the presentation from Gilt regarding how they refactored their initial architecture to reflect their needs better. Ignore all the technical details for now, just follow the logic arguments. Then, you will probably have a (separate) technical question on how to implement it.

Categories : Solr

ActiveRecordRelation where method matching on unique id returning object slightly diff then when traversing the array and matching on the same id
Regarding your first question about object_ids: The object_id is an internal reference id in Ruby assigned to the actual instance. No two instances can have the same object_id. This is different from calling .id in Rails which should return the id of the record in your datastore. Why your test is probably failing: The moment you called this: contact.contact_campaigns[rand(4)].activate Rails hit your datastore and cached the collection locally. Then you "activated" the item rand(4), which clearly appears to be your intention. Then you called this: contact.assign_campaign(campaign_to_be_assigned.id) which should have deactivated the previously active rand(4). But, in the datastore NOT in memory in contact.contact_campaigns. So remember contact.contact_campaigns is still in memory

Categories : Ruby On Rails

Compare files and write matching and not matching things
I would use a hash to remember what ID corresponds to what name. #!/usr/bin/perl use warnings; use strict; my $table = 'file_2.txt'; my $column = 'file1.txt'; my %names; open my $TAB, '<', $table or die $!; while (<$TAB>) { my ($name, @ids) = split; push @{ $names{$_} }, $name for @ids; } open my $COL, '<', $column or die $!; while (<$COL>) { chomp; print @{ $names{$_} // [$_] }, " "; }

Categories : Perl

BlogEngine.net Comments Remove Email Requirement
The /User controls/CommentView.ascx user control is responsible for validating comments. If you remove the following line it will no longer be required. <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail" ErrorMessage="<%$Resources:labels, required %>" Display="dynamic" ValidationGroup="AddComment" /> I would recommend you verify with whatever backend you are using that leaving that value out will not break any other functionality. One thing I know relies on the email address is the gravatar code so you should probably check it as well.

Categories : Misc

Split arrays of natural numbers according to a requirement
You should look up the principle of dynamic programming. In this case, it seems to be similar to some coin change problems. As for finding A1_i, A2_i, A3_i you should do it recursively: def find_numbers(n, a, arr): if arr[n] not empty: return if n == 0: arr[n].append(a) return if a.size() > 2: return t = n for each element of a: t -= element for i = 0 to : find_numbers(n, append(a, i), arr) We use arr so that we do not need to compute for each number multiple times the possible combinations. If you look at the call tree after a time this function will return the combinations from the arr, and not compute them again. In your main call: arr = [] for each n in A: find_number(n, [], arr) for each n in B:

Categories : Arrays

Django; requirement dependencies on sets of fields
Write a clean method for your model. In it, you can change field values, and raise validation errors. The following example should get you started. def clean(self): if self.cant_be_sold and self.flat_price is not None: raise ValidationError("flat_price must be None when cant_be_sold is True")

Categories : Python

asp:CreateUserWizard - how to display minimum password requirement
With the default markup of CreateUserWizard control as below, you cannot have such functionality. <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"> <WizardSteps> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> </asp:CreateUserWizardStep> <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard> Therefore, the idea is to customize the CreateUserWizard control as per your needs. Its better to use Validators so that you can display the messages beforehand. They key is to create a <ContentTemplate> element within the <asp:CreateUserWizardStep> element. <asp:Cre

Categories : Asp Net

how to change mapper memory requirement in hadoop?
You can modify the child heap size with: mapred.child.java.opts=-Xmx3000m, (in newer APIs you can be more specific with mapreduce.map.java.opts). You could also tune your node by choosing how many map and reduce tasks can be run in parallel. This can be controlled by the number of map and reduce slots available in a Tasktracker for example: mapred.tasktracker.map.tasks.maximum=7 mapred.tasktracker.reduce.tasks.maximum=3 There are more options: mapred.cluster.map.memory.mb=300 and mapred.job.map.memory.mb=600 but I don't think you will need them for now.

Categories : Hadoop

grouping variables of different type Java Requirement
That's what interfaces are for. interface GraphNodes { public Node getMasterUser(); public Node getMasterFilter(); public Node getMasterLocation(); } interface GraphIndexes { public Index getIndexUser(); public Index getIndexFilter(); } class Graph implements GraphNodes, GraphIndexes { private Node masterUser; private Node masterFilter; private Node masterLocation; private Index indexUser; private Index indexFilter; public GraphNodes getNode() { return this; } public GraphIndexes getIndex() { return this; } public Node getMasterUser() { return this->masterUser; } public Node getMasterFilter() { return this->masterFilter; } public Node getMasterLocation() { return this->masterLocation; } public Index getIn

Categories : Java

Number of arguments requirement input validation
For the number of arguments use $# if [ $# -lt 2 ] then echo "Too few args" fi For the second take a look at test. It has all sorts of things you can test for: -d for a directory and -f for a regular file. There are all sorts of things like symlinks and named pipes you can check for.

Categories : Linux

android message app architecture hardware requirement
Your best option is to write a performance test to emulate the scenarios you're talking about (100 - 10 000 devices sending messages) and see what the results are like. You want to think about the things you want to test, for example Response time (e.g. does the response time increase with an increased number of connections) Server load (does the CPU or other hardware start to creak when you make more connections) Throughput (is the amount of data you can transfer compromised when you have more connections) You should not test all of these in a single test, but figure out which is important to you and write an appropriate test (or series of appropriate tests) The results you get will be dependent upon the hardware that you use during testing, but you should be able to get an idea of

Categories : Java

How to write regular expression in UE to implement this requirement?
Assuming you want to place that line right after the opening {, try searching for (with Perl regexes turned on): ^(class.*C(?:Dialog|Wnd|ListCtrl).* ? { ? ) and replace with 1virtual ULONG GetGestureStatus(CPoint ptTouch) { return 0;}

Categories : Regex



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