How to read tcp / ip headers in PHP?

I want to get the source endpoint . Basically i want to block some ips by geting the port/ip from tcp/ip headers not from http header. Are there any built in methods for PHP to achieve that or i should do a workaround ?If you are just looking to bloc

How do I delete old Lucene / Lucene.NET documents

What is the idiomatic way to delete old documents from a Lucene Index? I have a date field (YYYYMMddhhmmss) on all of the documents, and I'd like to remove anything more than a day old (for example). Should I perform a filtered search or enumerate th

C # upcasting is still allowed

In Java, "Up-casting is casting to a supertype, while downcasting is casting to a subtype. Supercasting is always allowed, but subcasting involves a type check and can throw a ClassCastException." (What is the difference between up-casting and d

Updating TextView from DatePicker

I am trying to update a TextView from inside a Datepicker, however I am getting the error "non-static method (updateDateTextView(long)) can not be referenced from a static context" Here is my public class DatePickerFragme

Ios - set the uibutton image in the interface generator

I have few uibuttons in my interface builder, and they all have image value. I am wondering which method that the IB uses to set the button image. I checked and it's not setImage: forState: Thanks in advance.Im not sure if this is what you are asking

javascript - format xxx-xxxx for match function ()

I want to use str.match(xxx-xxxx); but don't know what syntax to use. can someone help me out i want something like /^[0-9]{3}-[0-9]{4}$/ Thanks.Try this: var str = "123-1234"; var isMatch = (str.match(/^\d{3}-\d{4}$/)!==null); isMatch equals tr

Durandal SPA supports the regular routing of the website

I'm building a plain old website that has a single page application in one of it's pages. There are other pages on the nav bar, such as Home, About, Blog, with my app being in Dashboard. After looking through my SPA option, I've decided to try Durand

Add a record only if it does not exist in Access 2007

I have a table, let's say it stores staff names (this isn't the exact situation, but the concept is the same), and the primary key is set to an autonumber. When adding a a new member of staff I want to check to see if that name exists in the database

How to list the properties of a JavaScript object

Say I create an object thus: var myObject = {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}; What is the best way to retrieve a list of the property names? i.e. I would like to c # trying to run an executable on the server

I have this method which generates a license by running an exe program on our server: /// <summary> /// Generate a new license /// </summary> public static void GenerateLicense(string Name, string EmailAddress, Licensing.Types.LicenseType Type

Contains & lt; T & gt; () and how to implement it

Say a class Person +Name: string +Contacts: List<Person> I want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance. person.Contacts.Contains<string>("aPersonName"); This

Web Application Layout Guidelines

I am transitioning from Desktop apps (WPF/Winforms) to Browser Apps and am looking for a good resource on laying out an app. I don't mean design here, just the mechanics of the layout. For example, "don't use tables for layout" seems to come up

writing the log file for the php program

I'm working on a php project which is processing and modifying data entries on a large scale. Data is taken from database and goes through 7 validation tests. Data is then sorted and inserted to database again. This process is time consuming and diff

delphi hashmap?

i have java-code filling a hashmap from a textfile. HashMap<String, String[]> data = new HashMap<String, String[]>(); i use this to make key-value-pairs. the values are an array of string. i have to iterate over every possible combo of the key

How to make PHP integrated in HTML?

I am a beginner in PHP and I am trying to embed PHP in HTML as that is how I am going to need it in my project. This one is a very simple code saved as Trial.html <html> <head> <title>Trial Page</title> </head> <body> H

Magento 2 time zones

I have a problem with getting datetime in magento 2 collection. for example this is database data: entity_id | paid_at ------------------------------------------ 1 | 2016-12-13 07:30:39 full database query: CREATE TABLE `pmnt` ( `entity_id` int(10) u

Language for .Net Framework programming

Is it recommendable to use C++/CLI as main language for a new .Net application? The application won't use native code (pure CLI). The reason for this question is, that I want to use the framwork but not leaning a new language like C# or VB. StefanYou

Obtain items in order with REXML XPath

I'd like to iterate through all the <HeadA> and <HeadB> elements in an XML file, and add a unique id to each. The approach I've tried so far is: @xml.each_element('//HeadA | //HeadB') do |heading| #add a new id end The problem is, the nodeset

Find a process that tries to connect to an Android device

Without ADB Running or any application listening on port 5037, lsof | grep "5037" is empty COM:platform-tools user$ ./adb devices List of devices attached * daemon not running. starting it now at tcp:5037 * * daemon started successfully * ** dae

Read / keep a PixelFormat.Format48bppRgb PNG Bitmap in .NET?

I've been able to create a Format48bppRgb .PNG file (from some internal HDR data) using the the following C# code: Bitmap bmp16 = new Bitmap(_viewer.Width, _viewer.Height, System.Drawing.Imaging.PixelFormat.Format48bppRgb); System.Drawing.Imaging.Bit