w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
palm veins enhancement with OpenCV
Ok finally I've figured out by myself how to do it. Here is my code : #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #define THRESHOLD 150 #define BRIGHT 0.7 #define DARK 0.2 using namespace std; using namespace cv; int main() { // Read source image in grayscale mode Mat img = imread("roi.png", CV_LOAD_IMAGE_GRAYSCALE); // Apply ??? algorithm from http://stackoverflow.com/a/14874992/2501769 Mat enhanced, float_gray, blur, num, den; img.convertTo(float_gray, CV_32F, 1.0/255.0); cv::GaussianBlur(float_gray, blur, Size(0,0), 10); num = float_gray - blur; cv::GaussianBlur(num.mul(num), blur, Size(0,0), 20); cv::pow(blur, 0.5, den); enhanced = num / den; cv::normal

Categories : Opencv

Creating a function without using print and input
You are not getting any output because you have a syntax error. Your function parameters are not valid; they are a) not valid Python like that, and b) incomplete: def useless("Hello, 95, "jello"): The "Hello string is missing a closing parenthesis, but you cannot just put literal values in a function header anyway. Remove everything between the parenthesis: def useless(): x = 'That was a waste of my time' return x The rest of your function is fine: >>> def useless(): ... x = 'That was a waste of my time' ... return x ... >>> useless() 'That was a waste of my time'

Categories : Python

Not able to see the print message after creating ObjectInputStream
The constructor to ObjectInputStream reads from the stream - it reads the header information, basically. So if the server you're talking to hasn't written any data, your program will just sit there, waiting until the header is actually written. If you hit break in a debugger when running this code, I think you'll find the stack trace includes ObjectInputStream.readStreamHeader.

Categories : Java

Creating a PDF for Google Cloud Print on Android
I am not an Android developer but this should do the trick: Creating a simple document in Java using itext! About Google Cloud Print I would be a bit weary of using it. In my experience it is a bit unstable and there is no support at Google at the moment (Just checked with Google Dev. Support team). We have decided to look for another way to do cloud printing because of this.

Categories : Android

Creating a batch program which will print results to .txt?
DEL /S /A:H .DS_STORE >> "!PATH!DS_STORE&THUMBS_FTP.txt" DEL /S /A:H ._.DS_STORE >> "!PATH!DS_STORE&THUMBS_FTP.txt" DEL /S /A:H THUMBS.DB >> "!PATH!DS_STORE&THUMBS_FTP.txt" The > implies that predecent instruction will copy his result text to the right file A >> implies an append (in case of the file exists to not ovewrite the result) and you will need a /q in each del instruction

Categories : Windows

Creating flag for print the output of shell script
This might work for you: #!/bin/bash # assuming your first argument is the printing flag [[ "${1}" = "ON" ]] && OUTPUT="/dev/stdout" || OUTPUT="/dev/null" # from now on: echo "Something" > $OUTPUT # will work as expected...

Categories : Shell

Using a static logger to print elements is creating multiple files with same content?
The problem is likely because you initialize the logger in the constructor. This would mean that each instance of the class would create a new file. You need to either initialize it in the static initialization block, or check if it is already initialized before you initialize it.

Categories : Java

Chrome: window.print() print dialogue opens only after page reload (javascript)
I am most certain you are experiencing this issue because you have a video element on your page - most probably an MP4. If you disable this video / or have an OGV video instead, the printing should work fine. It is a bug in chrome itself due to limitations of Chrome's video implementation. It is also important to note that if the user prints manually with ctrl-p / cmd-p, print functions correctly http://code.google.com/p/chromium/issues/detail?id=141633 Hope this helps :)

Categories : Javascript

Python: Why "return" won´t print out all list elements in a simple for loop and "print" will do it?
When you use a return statement, the function ends. You are returning just the first value, the loop does not continue nor can you return elements one after another this way. print just writes that value to your terminal and does not end the function. The loop continues. Build a list, then return that: def union(a,b): a.append(b) result = [] for item in a: result.append(a) return result or just return a concatenation: def union(a, b): return a + b

Categories : Python

How can I prevent Internet Explorer from repeat displaying the same background image in every page of a print out using a print CSS stylesheet?
I ran into the same problem today. One solution is a structure like this: <body> <div id="background" style="position: relative;"> <img src="bkgnd.png" style="position: absolute; z-index: -1;"> <div class="container" ...> ... </div> </div> </body> The basic idea is to take the image out of the flow but position it relative to its containing <div>. The z-index pushes it behind other elements. So this can be used as any kind of column header. One upside to this is that the background image will print even if the "background images" option isn't set in the print dialog. I'd like to see a proper solution as well though. Edit 2013/07/23: It looks like the CSS3 property will be box-decoration-break. This isn't going to help

Categories : CSS

Deployed Qt5 Application Doesn't Print or Show Print Dialog
This was another classic Windows/Qt5 deployment problem with a combination of missing plugins and plugins placed in incorrect places. By using the environmental variable QT_DEBUG_PLUGIN and adding CONFIG += CONSOLE to my PRO file I was able to see that on my development machine the application was loading qminimal.dll which I was not shipping. The application root which I have defined as {myAppPath} is the root directory for plugins. Therefore the correct file structure is: {myAppPath}MyApp[MyApp.exe, Qt5PrintSupport.dll, ...] {myAppPath}platforms[qwindows.dll,qminimal.dll] {myAppPath}printsupport* {myAppPath}imageformats* {myAppPath}earer* Thanks peppe for the lead.

Categories : Windows

use windows print instead of browser print directly from link/button
It could be a solution, if the printable view to be shown as pdf, and the adobe reader has the ability to print it normally. I don't see any other solution how could you invoke the OS print... Probably with IE, and asp.net you can, but i don't think this would satisfy you :) Kind regards, hotzu

Categories : Javascript

Print RED BLUE GREEN in order using System.out.print
public class TestSynMain { private final static AbstractQueuedSynchronizer cb = new TestSynchronizer(6); public static void main(String[] args) { final class ColouredRunnable implements Runnable { private String color; public ColouredRunnable(String color) { this.color = color; } @Override public void run() { while (true) { try { boolean result = false; do{ result = cb.tryAcquireNanos(Integer.parseInt(Thread.currentThread().getName()), TimeUnit.MILLISECONDS.toNanos(1000)); }while(!result); for (int i = 0; i < color.length(); i++)

Categories : Java

How to print PDF file already opened in QLPreviewController using print button?
Why this Error occurs because you have set the URL wrong. You are setting url like that; /Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf Where as UIDocumentationController task URL as: file://localhost/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf This minor mistake will made you mad ;)

Categories : IOS

How to print some specific part of a page via window.print()
One posible solution, perhaps not the best option: 1. Open a new window with JS 2. Copy the whole table into the new window (with jQuery for example) 3. Print the new window 4. Close the window Sure it has a blink effect but It will work.

Categories : PHP

How to print different items depending on a random print in Python?
You have done the hard part. Now you just need to map the skills to each category. For instance, using a dictionary: skills = {'Mage': range(7), 'Warrior': range(7,14), 'Thief': range(14,21)} choice = random.choice(skilltree) print skills[choice] This will print the list of skills you associated with the chosen skilltree. I used range just to illustrate, you could have a list of strings with the skills.

Categories : Python

Python, logging print statements while having them print to stdout
You can add this to your script: import sys sys.stdout = open('logfile', 'w') This will make the print statements write to logfile. If you want the option of printing to stdout and a file, you can try this: class Tee(object): def __init__(self, *files): self.files = files def write(self, obj): for f in self.files: f.write(obj) f = open('logfile', 'w') backup = sys.stdout sys.stdout = Tee(sys.stdout, f) print "hello world" # this should appear in stdout and in file To revert to just printing to console, just restore the "backup" sys.stdout = backup

Categories : Python

How does the WinRT Chrome app print without triggering the OS's "Print" dialog?
I don't think you can. The one browser app that enjoys the privilege of being your WinRT browser also enjoys special privileges not granted to other WinRT apps. For example, you can bet that Chrome is neither a XAML app nor an HTML/JS app. Yet all WinRT apps (except the one browser app) must be one of these two. Skipping the print dialog is probably a matter a simply calling the underlying Win32 print APIs -- something browsers are allowed to do but no other WinRT app is.

Categories : Google Chrome

print to print as comma separated values on the same line
One cause could be that the first piece of code is executed with Python 2 and the second one with Python 3. If that's not it, then try end=", ". My guess is that the second single quote isn't actually the quote that you want (i.e. it's backtick instead of single quote or something like that). Or maybe there is an illegal character in there that you can't see in your editor.

Categories : Python

jQuery Print function to print div content with css
You need to include the SAME stylesheet you're using in the parent page within the pop-up. You may want to make a dummy page stub/wrapper that has your stylesheet in it, then inject your HTML. var myStyle = '<link rel="stylesheet" href="http://mysite.com/mystyle.css" />'; w.document.write(myStyle + jQuery('.table_disp').html());

Categories : Jquery

window.print() print all div content without scrollbar
This is code to print div content using javascript. <script language="javascript" type="text/javascript"> function printDiv(divID) { //Get the HTML of div var divElements = document.getElementById(divID).innerHTML; //Get the HTML of whole page var oldPage = document.body.innerHTML; //Reset the page's HTML with div's HTML only document.body.innerHTML = "<html><head><title></title></head><body>" + divElements + "</body>"; //Print Page window.print(); //Restore orignal HTML document.body.innerHTML = oldPage; } </script> <div id="printme" style="width: 100%; background-color: Blue; height: 200px"> Print me I am in

Categories : Javascript

R: Print multiple lines without printing the print()
This will do what you are looking for cat("Line 1 Line 2") >cat("Line 1 Line 2") Line 1 Line 2 See R - new line character

Categories : R

How to Print PDF file without print preview in java
Check this blog http://blog.idrsolutions.com/2010/01/printing-pdf-files-from-java/; might helpful for you. Also you could look for PDFRenderer Java API, might help. Edit : How to set print attribute - Ref : http://docs.oracle.com/javase/7/docs/technotes/guides/jps/spec/attributes.fm4.html PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); aset.add(new Copies(5)); aset.add(MediaSize.ISO_A4); aset.add(Sides.DUPLEX); Pass this attribute to printJob.print(pdfDoc, new HashPrintRequestAttributeSet()) Also, you could try getting the supported attribute first and then use accordingly. Please read the above documentation, it is very rich in examples.

Categories : Java

Extra blank page when I print (except in IE) - is it my print css?
I'm gonna suggest that you try using a CSS reset. Resets are supposed to help different browsers display the website in the same way. You could try the one at http://meyerweb.com/eric/tools/css/reset/ but I have never used it so I can't really say how it will work. You could also try googling for a CSS reset specifically for print styles.

Categories : CSS

Getting the user's domain name for a print job from the Print Spooler API
I don't know for sure, but it occurs to me that maybe the user name will include the user's domain (somelike name@domain), and maybe that only happens if the user is printing to a printer in another domain. It might be worth writing some code and checking this out.

Categories : C#

Why StringBuilder does not print what it should print in a small code
When there is a return statement inside the try block, it will execute the finally block before actually returning. And the method doesn't return null because the return statement holds a reference to the actual StringBuilder object, not to the variable builder. Setting builder == null doesn't delete the StringBuilder itself, it just drops builder's reference to it. This behavior can be confusing. To make things clear it could be helpful to return from outside the try/catch/finally block: StringBuilder builder = new StringBuilder(); try { builder.append("John"); builder.append("Ibrahim"); } finally { System.out.println("In finaly"); // builder.append("-DarElBeida"); builder = null; } return builder;

Categories : Java

Print Intent for Google Cloud Print App
The answer is pretty straightforward, but it still took me a few days to figure it out: Intent printIntent = new Intent(Intent.ACTION_SEND); printIntent.setType("text/html"); printIntent.putExtra(Intent.EXTRA_TITLE, "some cool title for your document"); printIntent.putExtra(Intent.EXTRA_STREAM, uri); startActivity(printIntent); That's the correct way to do it. Important: Intent.ACTION_SEND_MULTIPLE does NOT work at the moment.

Categories : Android

print button is also print on myprint
if u want to remove any button when u print the page, u can simply use css by following the step below: Set id to your button. <p:commandButton id="btnPrint" ... /> Simply include your print.css at the Head of your web page. Note that the media is now set to print.<link rel="stylesheet" href="URL to your print.css" type="text/css" media="print" /> Hide your button by declaring display: none; in the CSS.#btnPrint{display:none;}

Categories : Hibernate

How To Print Images with php print function
The problem must lie when you are posting the path for the image file. I have tested the following php with an image "test.png" and it works. <?php $image="test.png"; print"<img src="$image" width="100px" height="100px"/>"; ?>

Categories : PHP

AS3: Print Job without Print Dialog Box/Print Setup Dialog
It appears there's an answer out there just did some googling: http://forums.adobe.com/thread/854070 var pj:PrintJob = new PrintJob(); var started:Boolean = pj.start2(null, false); if(started) { pj.addPage(this); pj.send(); }; pj = null;

Categories : Actionscript

Why does my python method print out 'None' when I try to print out the string that the method returns?
You're not returning in the first branch of the if toward the end. Change that to if word in new_word: return censor(new_word,word) Your function will also return None if word in text is false, so you might want to add an else at the end to return an empty string or some other default value in that case.

Categories : Python

Creating New Xcode Project Based On Existing Files. (Creating Laps into an NSTimer)
You can open your project and choose "add files" from the "file" menu (or drag and drop from finder). I'd suggest choosing the option to copy them to your folder, and make sure you have a checkmark next to your project as you're adding the files. Unfortunately, the process of integrating this new code into your app is a non-trivial exercise and depends entirely upon the particulars of your project, and on the code you're adding to your project. For example, copying .h and .m files (if the names are unique), is easy. But does your project use NIBs or Storyboards? How about the code you're copying in? How are you going to integrate the user interface files. It's non-trivial and it's hard for us to answer in the abstract. If you want to create a new project for your LapTimer.xib, LapTim

Categories : IOS

Creating multiple lockup tables Vs. creating single lookup table
If you just plan to use for a lookup, I would go for the one table solution. If you where planing to store other information about the assets based on their model, for example whether a vehicle was petrol / diesel, or a PC was a desktop or laptop, then the multi table solution may work much better.

Categories : Database

print<
Using EOF is equivalent to "EOF" - the here document is interpolated as if in double quotes. Backslash the dollar sign $ or explicitly use single quotes to supress interpolation. print << 'EOF'; ... EOF

Categories : Perl

Print PDF without print dialog in asp.net
Like Steven V said, JavaScript on it`s own will never ever print without a dialog box. Can you imagine your creepy printer suddenly printing strange pages all of the sudden? I can suggest an alternative however. Since you are using ASP.NET why not use a third party PDF generator, generate a PDF file on the serverside, then ajax back a link to the user. User will see a button: "Get PDF," he will click on it and a link to real PDF appears! Voila! PS: You can look at some third party pdf-generators here: How to create PDF in ASP.NET

Categories : C#

design object with open, print and close which call normal open, print and close
You can access the native methods via CORE::, eg in your method open(): sub open { # ... CORE::open(my $fh, '>', 'foo'); CORE::print($fh, 'bar'); CORE::close($fh); } See perldoc CORE

Categories : Perl

Is creating tasks via a for loop different to creating them individually?
The problem is that your lambda expression captures c - the variable c, not its value at the time of task creation. So by the time you start the tasks, c will be 9. Even if you started them within the loop, there's still no guarantee that the code in the lambda expression will start to execute before the change to c. To fix this, you can use a separate local variable for each iteration of the loop: int c = 1; for (int i = 1; i <= 4; i++) { int temp = c; taskArray[i-1] = new Task(() => calculateRows(temp, true)); c = c + 2; } foreach (Task t in taskArray) { t.Start(); } Or bypass c entirely and compute temp from i: for (int i = 1; i <= 4; i++) { int temp = i * 2 - 1; taskArray[i-1] = new Task(() => calculateRows(temp, true)); } foreach (Task t in tas

Categories : C#

creating a relationship between two tables and creating a foreign key
You should create a constraint: http://dev.mysql.com/doc/refman/5.6/en/innodb-foreign-key-constraints.html

Categories : Mysql

Python, if 'word' is in link print link else if '2ndword' in link print that one
if 'impressum' in newurl: print newurl elif 'kontakt' in newurl: print 'Not impressum:' print newurl I didn't see any way you distinguish from which "if" case cough the link, so try this and you'll see if it's the if or elif block printing the link. And as @Joshua writes, you don't need to do "'impressum' not in newurl" Since it's already been checked in the if block.

Categories : Python

Error creating applicationContext.xml: Error creating bean with name 'sessionFactory' defined in ServletContext resource
Your log hints "java.lang.ClassCastException: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider cannot be cast to org.hibernate.service.jdbc.connections.spi.ConnectionProvider" It seems that you're using Hibernate4 with spring-hibernate3-support: hibernate-core-4.1.8.Final.jar org.springframework.orm.hibernate3.LocalSessionFactoryBean

Categories : Java



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