Is it possible to search for a particular filename on GitHub?

Is it possible to search for a particular filename on GitHub?

Does the search user.rb in:path do what you want to do?
Alternatively there is also this search filename:user.rb

Found on: https://help.github.com/articles/searching-code/

In search input, you can use filename parameter to search in multiple repositories, for example:

filename:my_filename.txt

If youre looking for a filename in specific repository, you can just press t and start typing the file name (see: GH keyboard shortcuts).

Is it possible to search for a particular filename on GitHub?

GitHub introduced FileFinder in 2011.

Try it out: just hit t on any repos file or directory view.[1]

So, Youre still restricted to repository.

[1]https://github.com/blog/793-introducing-the-file-finder

Another approach to Your question:

Can I use Git to search for matching filenames in a repository?
Related Posts

How to truncate date in PostgreSQL?

How to truncate date in PostgreSQL?

> select now();
2013-09-09 11:43:29.307089+02
> select date_trunc(week,now()-1 week::interval);
2013-09-02 00:00:00+02 //start of previous week
> select date_trunc(week,now())
2013-09-09 00:00:00+02 // start of current week
> select date_trunc(week,now())-1 s::interval;
2013-09-08 23:59:59+02 // end of previous week

So using date_trunc(week,now())-1 s::interval; on the right side of your date operator should work. This is a timestamp with time zone value which refers in fact to 23:59:59 on sunday, but with 2 hours of difference with UTC time, depends on your locale and settings.

You can fix a date or remove days from current day.

Show this: are the date/time operators and functions present in Postgres

I linked 9.1 functions because youve tagged with postgres 9.1, exists too the 9.2 reference page

How to truncate date in PostgreSQL?

Related Posts

python – What is the shortcut key to comment multiple lines using PyCharm IDE?

python – What is the shortcut key to comment multiple lines using PyCharm IDE?

This is a setting you can change and define in Settings.

The default is with Ctrl+/ for Windows, or Cmd+/ for Mac.

Is depends on youre text editor , but probably all text editor use (ctrl + /) just highlight all the code you need to comments and use the shortcut , to know what shortcut using in youre favorite text editor search in google : YourTextEditor shortcuts

python – What is the shortcut key to comment multiple lines using PyCharm IDE?

This heavily depends on where youre writing your python code. If youre writing it in Notepad, there wont be a shortcut for commenting a line.

However, if you use an IDE, you will probably have such capability alongside the ability to change the shortcut.
Just search Google for keyboard shortcuts for your preferred IDE.
Related posts

split – STRING_SPLIT in SQL Server 2012

split – STRING_SPLIT in SQL Server 2012

Other approach is too use XML Method with CROSS APPLY to split your Comma Separated Data :

SELECT Split.a.value(., NVARCHAR(MAX)) DATA
FROM
(
    SELECT CAST(<X>+REPLACE(@ID, ,, </X><X>)+</X> AS XML) AS String
) AS A
CROSS APPLY String.nodes(/X) AS Split(a);

Result :

DATA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Example :

DECLARE @ID NVARCHAR(300)= 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20;
DECLARE @Marks NVARCHAR(300)= 0,1,2,5,8,9,4,6,7,3,5,2,7,1,9,4,0,2,5,0;
DECLARE @StudentsMark TABLE
(id    NVARCHAR(300),
 marks NVARCHAR(300)
); 
--insert into @StudentsMark 
;WITH CTE
     AS (
     SELECT Split.a.value(., NVARCHAR(MAX)) id,
            ROW_NUMBER() OVER(ORDER BY
                             (
                                 SELECT NULL
                             )) RN
     FROM
     (
         SELECT CAST(<X>+REPLACE(@ID, ,, </X><X>)+</X> AS XML) AS String
     ) AS A
     CROSS APPLY String.nodes(/X) AS Split(a)),
     CTE1
     AS (
     SELECT Split.a.value(., NVARCHAR(MAX)) marks,
            ROW_NUMBER() OVER(ORDER BY
                             (
                                 SELECT NULL
                             )) RN
     FROM
     (
         SELECT CAST(<X>+REPLACE(@Marks, ,, </X><X>)+</X> AS XML) AS String
     ) AS A
     CROSS APPLY String.nodes(/X) AS Split(a))
     INSERT INTO @StudentsMark
            SELECT C.id,
                   C1.marks
            FROM CTE C
                 LEFT JOIN CTE1 C1 ON C1.RN = C.RN;
SELECT *
FROM @StudentsMark;

Inline function based on Yogesh Sharma and Salman A answers:

Create FUNCTION [dbo].[fn_split_string]
(
    @string    nvarchar(max),
    @delimiter nvarchar(max)
)
/*
    The same as STRING_SPLIT for compatibility level < 130
    https://docs.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql?view=sql-server-ver15
*/
RETURNS TABLE AS RETURN
(
    SELECT 
      --ROW_NUMBER ( ) over(order by (select 0))                            AS id     --  intuitive, but not correect
        Split.a.value(let $n := . return count(../*[. << $n]) + 1, int) AS id
      , Split.a.value(., NVARCHAR(MAX))                                 AS value
    FROM
    (
        SELECT CAST(<X>+REPLACE(@string, @delimiter, </X><X>)+</X> AS XML) AS String
    ) AS a
    CROSS APPLY String.nodes(/X) AS Split(a)
)

Example:

DECLARE @ID NVARCHAR(300)= abc,d,e,f,g;
select * from fn_split_string(@ID,,)

-- If you need exactly string_split functionality (without id column):
select value from fn_split_string(@ID,,)

split – STRING_SPLIT in SQL Server 2012

Another approach would be to use CHARINDEX and SUBSTRING in a WHILE:

DECLARE @IDs VARCHAR(500);
DECLARE @Number VARCHAR(500);
DECLARE @charSpliter CHAR;

SET @charSpliter = ,;
SET @IDs = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 + @charSpliter;

WHILE CHARINDEX(@charSpliter, @IDs) > 0
BEGIN
    SET @Number = SUBSTRING(@IDs, 0, CHARINDEX(@charSpliter, @IDs));
    SET @IDs = SUBSTRING(@IDs, CHARINDEX(@charSpliter, @IDs) + 1, LEN(@IDs));

    PRINT @Number;

END;

Related posts

applet – How to stop java warning pop ups from appearing again and again

applet – How to stop java warning pop ups from appearing again and again

https://www.java.com/en/download/help/java_blocked.xml

Java has further enhanced security to make the user system less
vulnerable to external exploits. Starting with Java 7 Update 51, Java
does not allow users to run applications that are not signed
(unsigned), self-signed (not signed by trusted authority) or that are
missing permission attributes.

WORKAROUND

It is highly recommended not to run these types of applications. However if you still want to run these apps, run only if you understand the risks and implications.

As a workaround, you can use the Exception Site list feature to run the applications blocked by security settings. Adding the URL of the blocked application to the Exception Site list allows it to run with some warnings.
Steps to Add URLs to the Exception Site list

  1. Go to the Java Control Panel (On Windows Click Start and then Configure Java)
  2. Click on the Security tab
  3. Click on the Edit Site List button
  4. Click Add in the Exception Site List window
  5. Add url to Exception Site list
    Click in the empty field under the Location field to enter the URL

applet – How to stop java warning pop ups from appearing again and again

Related Posts

Difference between console.log and return in javascript?

Difference between console.log and return in javascript?

From http://blogs.msdn.com/b/cdndevs/archive/2011/05/26/console-log-say-goodbye-to-javascript-alerts-for-debugging.aspx

console.log will display the parameter passed to the log method in the
console window. Use this method to display a string or variable in the
console window.

You can use the console class in your code as well, much like we can
use JavaScript alerts.

<script type = text/javascript> 
    function tryConsole() { 
        console.log(hello world); 
    } 
</script>

When using the return statement, the function will stop executing, and return the specified value.

Actually theres nothing in common between them.

return – returns execution to the caller with optional result

console.log() – logs out information in console.

Difference between console.log and return in javascript?

console.log prints the string in firebug console. Just found the below link, you can refer
What is console.log and how do I use it?

and

return just return from the function without processing further code or you can say, A function immediately stops at the point where return is called.

Related posts

tcp – Java libgdx(desktop/android) multiplayer game how to

tcp – Java libgdx(desktop/android) multiplayer game how to

The best approach (or at least 1 approach) would be to use normal HTTP requests : http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Net.html

You create a webservice implementing REST and create calls for both updating and consuming data.

Alternatively, if youre just going to use Android and Desktop you may also use WebSockets : https://github.com/pepedeab/libGDX-Net

For those who dont read comments, but still looking for tcp client.

You can use KryoNet which supports Desktop and Android
https://github.com/EsotericSoftware/kryonet

tcp – Java libgdx(desktop/android) multiplayer game how to

Have you guys looked at the multiplayer super jumper tutorial? Its written using AppWarp and is being actively used in the libgdx community as well.

Related Posts

shell – Git says Warning: Permanently added to the list of known hosts

shell – Git says Warning: Permanently added to the list of known hosts

Solution: create a ~/.ssh/config file and insert the line:

UserKnownHostsFile ~/.ssh/known_hosts

You will then see the message the next time you access Github, but after that youll not see it anymore because the host is added to the known_hosts file. This fixes the issue, rather than just hiding the log message.

This problem was bugging me for quite some time. The problem occurs because the OpenSSH client compiled for Windows doesnt check the known_hosts file in ~/.ssh/known_hosts

ssh -vvvvvvvvvvvvvvvvvvv [email protected]

debug3: check_host_in_hostfile: filename /dev/null
debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: filename /dev/null
debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts
Warning: Permanently added github.com,207.97.227.239 (RSA) to the list of known hosts.

Add the following line to your ssh config file ($HOME/.ssh/config):

LogLevel=quiet

If running ssh from the command line add the following option to the command string:

-o LogLevel=quiet

For example, the following prints out the gcc version installed on machine.example.org (and no warning):

ssh -o UserKnownHostsFile=/dev/null 
    -o StrictHostKeyChecking=no 
    -o LogLevel=quiet 
    -i identity_file 
    machine.example.org 
    gcc -dumpversion

shell – Git says Warning: Permanently added to the list of known hosts

Set LogLevel to ERROR (not QUIET) in ~/.ssh/config file to avoid seeing these errors:

Host *
   StrictHostKeyChecking no
   UserKnownHostsFile /dev/null
   LogLevel ERROR

Related Posts

plot – Change the aspect ratio (with pbaspect) for a plotyy in Matlab

plot – Change the aspect ratio (with pbaspect) for a plotyy in Matlab

You probably need to specify the axes handles:

[AX,H1,H2] = plotyy(...)
pbaspect(AX(1),...) % set aspect ratio of the first axis
pbaspect(AX(2),...) % set aspect ratio of the second axis

plot – Change the aspect ratio (with pbaspect) for a plotyy in Matlab

Related Posts

printf – How to display (print) vector in Matlab?

printf – How to display (print) vector in Matlab?

I prefer the following, which is cleaner:

x = [1, 2, 3];
g=sprintf(%d , x);
fprintf(Answer: %sn, g)

which outputs

Answer: 1 2 3

You can use

x = [1, 2, 3]
disp(sprintf(Answer: (%d, %d, %d), x))

This results in

Answer: (1, 2, 3)

For vectors of arbitrary size, you can use

disp(strrep([Answer: ( sprintf( %d,, x) )], ,), )))

An alternative way would be

disp(strrep([Answer: ( num2str(x,  %d,) )], ,), )))

printf – How to display (print) vector in Matlab?

Heres another approach that takes advantage of Matlabs strjoin function. With strjoin its easy to customize the delimiter between values.

x = [1, 2, 3];
fprintf(Answer: (%s)n, strjoin(cellstr(num2str(x(:))),, ));

This results in: Answer: (1, 2, 3)
Related posts