File_get_contents or readfile to display the file system image

Can anyone advise on what is the best PHP function for displaying an image stored in a filesystem - file_get_contents or readfile. We are switching from displaying images stored in the database so we still need to call the images through a PHP file a

How do I match 4 recurring numbers using regex (PCRE)

I would like to detect whether a user-chosen pin contains 4 identical numbers e.g 1111 or 2222. I'm using preg_match in PHP. How can I adapt this answer to do this?Adapting from the answer you link to: \b(\d)\1{3}\b Instead of using \1+ that would ma

Enlarge logic AND / OR for columns with type 'bit'

For the T-SQL (SQL Server 2016) bit type, is there some way to achieve an aggregate equivalent of a logical AND and a logical OR? For example, with this table: CREATE TABLE #Example (id int, category int, isRed bit, isBlue bit) INSERT INTO #Example V

Obtaining aggregated SQL data

I have a StatementsEntries table as follows ID | Name | CaseId | StatementID | Amount | Balance | Paid -------------------------------------------------------------------------- 1 | Statement 1 | 1 | 1 | 1000 | 1000 | 1 ------------------------------

Exception when accessing the FileInfo class

I am trying to access all the files inside sub folders which are present inside a master folder, along with their last access times. I am able to get all the files, the problem arises when I'm trying to get the last access times. I receive the 'Objec

Jquery list show / hide 5 items onclick

i have a jquery problem with lists. I have a big list and i want when a link is clicked; each time the next 5 items of that list will be shown and the previous items hide. How can i do this? <ul> <li>1</li> <li>2</li> <li&

Jquery: joining duplicate information management

I have ajax which fetches information from two different tables: One table is information and other is images. There is unique information row which can join up to three rows from images table. MySQL: SELECT information.pointID, sName, sAddr, sPhone,

Bootstrap 3 Vertical Text Alignment in Neighboring Necks

Issue is that i am trying to vertically align text within neighboring divs in a bootstrap 3 row where one cell has text of varying size. the text in neighboring cells aligns along the top, but i need it to align along the bottom. Fiddle of the proble

animation jquery from inside ajax loaded div

I have a simple jquery animation on a div, which is inside a div, that has been loaded dynamically. Ie: User clicks link, drilldown.php loads up inside a div below. Then I have a bunch of divs inside that, one for each option. Upon clicking the optio

Querying RLMObject with NSPredicate returns no results

Here's my Realm model: Pet.h #import <Realm/Realm.h> @interface Pet : RLMObject @property NSString *species; @end Pet.m #import "Pet.h" @implementation Pet + (NSString *)primaryKey { return @"species"; } @end Write into Realm - (

Swift UITableView didSelectRowAtIndexPath is not called

New to IOS development and am having trouble with handling cell selection on a table. Whenever I select, the method is not getting called below - any idea why? My project structure is: View Controller -> View -> Table View The below code demonstrate

underlying in r based on a condition vector

This is a restatement of my poorly worded previous question. (To those who replied to it, I appreciate your efforts, and I apologize for not being as clear with my question as I should have been.) I have a large dataset, a subset of which might look

Convert the string to date and compare for date 2 diff

Question 1: I have 2 fields to let user enter start date and end date, but in string format - DateStart (string: yyyy/mm/dd hh:mm) - DateEnd (string: yyyy/mm/dd hh:mm) May I how to compare both datetime? I want to know total how many hours is differe

Does Netbeans support coloring for .sh (bash) scripts?

I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.I have not tried this myself but you can get shell

This Android code continues to break. I need help?

This is the code I did. But it did not work. Please help? The app itself lets the user enter his/her name on the EditText, he clicks on the button and the TextView will say like for example his name is Sam. "Your name is Sam". package com.exampl

Keep a list of work to be done in the future

Since function pointers need to know what arguments are supplied ahead of time I don't know how to do this. Essentially I want a list of work. Each entry is a function to be called with specific arguments. I.e. I want to add foo(3, "abcd") to th

Replace the entire div instead of the div

i am using the following ajax script to replace the contents of a div. But it only changes the contents inside that div. I want to replace the entire div. <script> function sendmessage() { var message_content=$("#message").val(); $.ajax({

$ location error in angularJS

I have a master controller and I would like to set up the login page to take me to "/tables" path if username=admin and password=admin, however I am getting this error everytime I try to login TypeError: Cannot read property 'path' of undefined

Access to WINAPI methods in C

I would like to access the DeleteFile WINAPI system call within my C Code. When checking the Windows File Management functions it outlines me just the C++ Syntax: C++ BOOL WINAPI DeleteFile( __in LPCTSTR lpFileName ); What I would like to know is how

Yii findAll () does not work

I am new in yii framework. I'm trying to get all records by conditition from a table using model but every time I failed. I solved it by simple mysqli1 query. But i want to get it yii findAll();. Below my i tried $criteria = new CDbCriteria; $criteri