How to ignore .phpt files in Netbeans 10? [duplicate] - php

Anyone know how to ignore the build folder when doing a 'Find in Projects' on NetBeans (v6.9.1).
Currently the Search results pane shows all results from src folders but also those from the build folder so if your project contains a lot of JSP files for example, many results are duplicated...

I think I've figured out how to ignore the build folder of projects when doing a 'Find in Projects' in NetBeans 6.9.1:
Go to Tools->Options-Miscellaneous.
Click the Files tab.
In Files Ignored by the IDE, edit the Ignored Files Pattern
regular expression and include the build folder. For example, on
my system I simply added build thus:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn|build)$|~$|^\.(?!htaccess$).*$
Click OK to save the options and close the dialog.
(Nerd Note: Took me exactly 1 year to the day to figure this out!)

You may be able to get similar behavior with a multiple node selection search.
From the 'Files' Window (Found in the Window/Files Menu), expand all
of your projects and select all of them with a Ctrl+A (PC) or
Command+A (Mac).
Then with Control(PC) or Command(Mac) key held down, click the
folders that you don't want to search.
Finally, use Ctrl+F(PC) or Command+F(Mac) to open a search, enter the
text you're looking for, and then choose 'Selection ( # nodes)' under
the Scope where the '#' symbol is the number of folders you just selected.
It is a little more manual than applying a filter, but you should be able to better control your results.

Related

How can i get result if word wrong or spelling wrong or greek word get english result

How can i get result if word wrong or spelling wrong or Greek word enter get English result
example:
in my web site i want to search "jeans" or "jenz" get same result its a simple examples my main concern if user enter same meaning word or wrong greek word but my site develop in English format how can this word search
can any one give me idea how i get solution for this problem my site in Laravel 5.2
For the "spelling wrong" part (Did you mean)
You could do some LIKE queries in the db e.g. LIKE %j%e%a%n%s% but if you want to do it well, you should use a search library like this:
https://github.com/TomLingham/Laravel-Searchy
http://tnt.studio/blog/did-you-mean-functionality-with-laravel-scout
You can publish the configuration file to your app directory and
override the settings by running php artisan vendor:publish to copy
the configuration to your config folder as searchy.php
You can set the default driver to use for searches in the
configuration file. Your options (at this stage) are: fuzzy, simple
and levenshtein.
You can also override these methods using the following syntax when
running a search:
By defining levenshtein distance you can finetune how far off a word can be.
If you need better performance you should consider something like solr or elasticsearch for this task.
https://wiki.apache.org/solr/SpellCheckComponent
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
For the translation part
You just should have a dictionary ready in your database or localization files and run the input trough that as well. Expect high computing times for both spelling correction and translation in your code.

PHPStorm - xDebugg - variables listing

When going though my code with the debugg, you are able to see the variable and their values etc etc.
However, if an array has 200 odd variables or if an object has 300+ defs for it. It takes ages to find it straight away (once i find the variable i need, i put it under my watch list)
My questions is: How can you list the variable in alphabetical order or in any order at all within the debug variables list?
Debug tool window has an option to sort variables/array keys alphabetically. For that -- activate that option via "cog" icon:
NOTE: you can add that option as separate button on debug toolbar (look for A-Z icon on screenshot above) if you need to turn this option ON or OFF often. This can be done via Settings/Preferences | Appearance & Behaviour | Menus and Toolbars.
Standard in place search works there (in variables panel) as well. For that just start typing while panel has focus.
NOTE that search looks trough already expanded nodes only (just like in other places) -- it will NOT open nodes for you (e.g. if you are trying to find variable/key that is located in closed node then it will not be found).

Double click highlight variable Sublime Text 3 include $

I wanted ST3 to include the "$" when selecting PHP files so I edited word_separators by removing $ as such :
"word_separators": "./\\()\"':,.;<>~!##%^&*|+=[]{}`~?"
And now it highlight the whole varibale including the "$" when double clicking a variable. However, now Sublime is not matching/outlining those variables using the default match_selection functionality.
Any thoughts on this? Is there a setting I am missing. Much appreciated.
Please see my answer to this question for an in-depth look at the effect of changing word_separators and various find and select options. Long story short, altering word_separators changes the behavior of double-clicking, as you noted, but other operations, including match_selection, rely on an internal word separators list that apparently can't be altered by the user. So, when you double-click to select a PHP variable, you'll get the $ selected, but other instances of the variable won't be highlighted. They will be selected when using CtrlD to make multiple selections, however:
Additionally, when using the Find dialog, other instances will be highlighted:
So, to address your original problem, if you need to see all the instances of the currently-selected variable, set "find_selected_text": true in your user preferences, double-click to select your variable of interest, then hit CtrlF (⌘F on OS X) to view all occurrences. Just make sure you don't have the regex search button selected, as $ has a special meaning in regexes.

Having Lower-Case Page Titles in Mediawiki

I am building a Mediawiki at here.
It is going OK, but now I want to have some articles to document things that begin with a lower-case letter such as Unix commands: "man", "chmod", "ls", "iPod", etc. I don't want them to show up like Mediawiki tries to make all page titles and article titles begin with an upper-case letter.
Also, I don't want the searches to be case-sensitive. I want searching for "apple" to find "Apple", etc.
I believe that I've achieved having case-insensitive searches by following the instructions from the web page.
I believe that this is good, but I am a little squeamish about what I had to do:
Change the Structure of the database table _pages, changing the type of the page title to be VARCHAR(255) and changing the collation sequencing to be a kind of utf-8 case-insensitive.
Adding a global function to globalFunctions.php.
Changing the php code in the wiki's skin.
It seems like this should just be a php variable in LocalSettings.php
But this all seems to work. I mean, I could enter "apple" and it would find the article on "Apple" rather than prompting me to create a new article called "apple".
But then, I noticed that the page titles were still capitalized for such things as new article such as an article on "chmod".
I went back to googling and I found a web page that said to use the Mediawiki global variable called:
$wgAllowDisplayTitle = true;
and that this would enbled me to use templates such as the following:
{{DISPLAYTITLE:chmod}}
http://www.learnbymac.com/wiki/index.php?title=Chmod
This partially works. The title of the article is now "chmod", but really, in the database the title is still "Chmod" which wouldn't be so bad, but when I go to the Category "Unix", all of the Unix commands show up starting with an upper-case letter.
I read on the Mediawiki site that beginning a page title with a lower-case letter, in any language, is disallowed.
I would like things on my wiki to be like they are on my Mac, not case-sensitive, but case-preserving.
I know that Mediawiki has to consider about every language in the world, but I don't.
I really would rather not modify the structure of my Mediawiki database any further, but maybe that's what's required. I just noticed that not only are the page titles wrong in the category pages, but they are also wrong in the title when you are editing pages.
Here's a link to a category that lists the titles in the wrong case:
---Edit---
I figured it out. I believe that it is fine now. I was missing the following line in my Mediawiki configuration file, called "LocalSettings.php:.
# disable first-letter capitalization of page names
$wgCapitalLinks = false;
I know that I entered this the first time. I believe what happened was the changes got saved in my local file system instead of being saved by my text editor, via ftp, to my website.
As you noted, setting $wgCapitalLinks = false; in LocalSettings.php will do the trick. If you already had pages in your wiki, you will probably want to run the maintainence script CleanupCaps as well: http://www.mediawiki.org/wiki/Manual:CleanupCaps.php
For your second question: To have the search case insensitive you can use the TitleKey extension (http://www.mediawiki.org/wiki/Extension:TitleKey).
It is stable, and used on many major wikis. There is also the possibility to plug in a the Lucene serach engine, if you want more control over the behaviour (http://www.mediawiki.org/wiki/Extension:MWSearch)

Finding an image in a folder with subfolders which contains a post value

I am using Jquery to post a value to a page which should then search a folder and its sub-folders to see where the file exists.
The start of the filename will always have something like "HAV_" and then the product code...
HAV_345GG.jpg
I need to take the posted value which is the product code and search all folders to find a match then return the location as a link ie:
http://www.mydomain.co.uk/folder/subfolder/HAV_345GG.jpg
Any help would be great.
Another option is to make use of PHPs glob function which returns an array based on a pattern match. This seems like it could be used in this case. You would need to be careful of files with similar names partially matching though such as:
HAV_123
HAV_1234
You need to create a lookup table so you can quickly find things by product code.
Create a script to rip through all the folders and index the location of the image files by product code. Cache this scripts output somewhere (db, redis memcached, etc).
Create a search script that uses the cached lookup table to find the path to the correct file.
You cache might be a PHP array such as:
array(
'ProductCode123' => array(
'/location/to/image1.jpg',
'/path/to/image2.jpg',
),
'SerialNumber12233' => array(
'/some/location/to/image1.jpg',
'/another/folder/image2.jpg',
),
);
Without this caching method you are going to find performance to be an issue if there is a lot of files and directories.
A colleague wrote a PHP script called uberloader, which does a similar thing but acts a PHP autoloader for disparate file structures such as yours in legacy projects. It is intended to autoload class files but a similar concept of hunting and caching is used.

Categories