logo
down
shadow

Exclude <> from searching tags


Exclude <> from searching tags

By : cp11
Date : November 17 2020, 11:58 AM
Hope this helps You could capture the tag before finding it, get rid of the <> characters, and then find what's left:
code :
(defun sm-find-tag-other-window ()
  (interactive)
  (let ((tag (funcall (or find-tag-default-function
                          (get major-mode 'find-tag-default-function)
                          'find-tag-default))))
    (if tag
        (find-tag-other-window
         (replace-regexp-in-string "[<>]" "" (regexp-quote tag))))))


Share : facebook icon twitter icon
jQuery: count of first level of li tags (exclude decendent ul > li tags)

jQuery: count of first level of li tags (exclude decendent ul > li tags)


By : Senior Architect
Date : March 29 2020, 07:55 AM
will be helpful for those in need $("#top_nav > li").size() should do the trick.
This works because a selector akin to foo > bar selects the immediate children of foo that match bar. the size() function returns the number of entities selected.
How to get all <img> tags but exclude <img> tags under a <div> with an id of footer using xpath?

How to get all <img> tags but exclude <img> tags under a <div> with an id of footer using xpath?


By : Aaron Garner
Date : March 29 2020, 07:55 AM
Tags system - searching with 'some tags' AND without 'other tags'

Tags system - searching with 'some tags' AND without 'other tags'


By : Francisco Ruiz Rivas
Date : March 29 2020, 07:55 AM
hop of those help? I was trying to do this like that: , One way to approach this is using aggregation with a having clause:
code :
SELECT `question_id`
FROM `tags_and_questions`
GROUP BY question_id
HAVING sum(`tag_id` IN ($ok_tags_id)) > 0 and
       sum(`tag_id` NOT IN ($no_tags_id)) = 0;
SELECT `question_id`
FROM `tags_and_questions`
GROUP BY question_id
HAVING sum(find_in_set(`tag_id`, $ok_tags_id) > 0) > 0 and
       sum(find_in_set(`tag_id`, $no_tags_id) > 0) = 0;
Exclude tags inside tags with preg_match

Exclude tags inside tags with preg_match


By : N.Mehralizadeh
Date : March 29 2020, 07:55 AM
This might help you Here is a regex you can try:
(?:<(h\d)>[^<>]*?)(?:<(?!\2).*>)\K(.+?)<\/\1>
code :
<?php
    $re = "/(?:<(h\\d)>([^<>]*?))(?:<(?!\\2).*>)\\K(.+?)(?=<\\/\\1>)/"; 
    $str = "<h3>Maybe this, too. <p>I dont want this text</p><p>I dont want this text</p>But I do want this!</h3><p>some other text that I dont want</p>"; 
    preg_match_all($re, $str, $matches);
    $group2 = each($matches[2]);
    $group3 = each($matches[3]);
    print_r($group2["value"]);
    print_r($group3["value"]);
?>
Exclude HTML tags and some UNICODE Characters while searching in SQLite

Exclude HTML tags and some UNICODE Characters while searching in SQLite


By : Naim uddin
Date : March 29 2020, 07:55 AM
may help you . Answer to Original Question
NOTE: As I have recently learned it, I maybe wrong at many places, kindly correct my mistakes
code :
# Sets the minimum version of CMake required to build the native
# library. You should either keep the default value or only pass a
# value of 3.4.0 or lower.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
cmake_minimum_required(VERSION 3.4.1)

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds it for you.
# Gradle automatically packages shared libraries with your APK.

add_library( # Sets the name of the library.
             native-lib

             # Sets the library as a shared library.
             SHARED

             # Provides a relative path to your source file(s).
             # Associated headers in the same location as their source
             # file are automatically included.
             src/main/cpp/native-lib.cpp )

include_directories(${CMAKE_SOURCE_DIR}/src)
add_library(sqlite3 STATIC src/main/cpp/sqlite3.c src/main/cpp/sqlite3.h src/main/cpp/sqlite3ext.h)
add_executable(sqlite src/main/cpp/sqlite3.c src/main/cpp/sqlite3.h src/main/cpp/sqlite3ext.h)
set_target_properties(sqlite PROPERTIES OUTPUT_NAME sqlite3)

# Searches for a specified prebuilt library and stores the path as a
# variable. Because system libraries are included in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.


find_library( # Sets the name of the path variable.
              log-lib

              # Specifies the name of the NDK library that
              # you want CMake to locate.
              log )

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in the
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
                       native-lib

                       # Links the target library to the log library
                       # included in the NDK.
                       sqlite3
                       log )
static void strip_text(sqlite3_context *context, int argc, sqlite3_value **argv) {
if(argc == 1) {
    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "inside strip_text");
    char *result = (char *) sqlite3_value_text(argv[0]);
    std::string text(result);
    std::regex regex_head("YOUR REGEX");

    if (!text.empty()) {
        text = std::regex_replace(text, regex_head, "");

        sqlite3_result_text(context, text.c_str(), -1, SQLITE_TRANSIENT);

        __android_log_print(ANDROID_LOG_VERBOSE, "STRIPPED TEXT", "%s", text.c_str());
        return;
        }

    }
    sqlite3_result_null(context);

}
extern "C"
void
Java_com_kfmwa916_testapp_SearchResult_createFunction(JNIEnv * env, jobject object, jstring search) {
    const char * search_term = env->GetStringUTFChars(search, 0);
    env->ReleaseStringUTFChars(search, search_term);

    std::string q(search_term);

    std::string query = "SELECT text FROM dummy WHERE LIKE('%" + q + "%', strip_text(text))=1";

    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "%s", query.c_str());

    //GetJStringContent(env, search, search_term);
    sqlite3 *db;
    //Open database
    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "Opening database");
    int rc = sqlite3_open("/data/data/com.kfmwa916.testapp/databases/MyDBName.db", &db);
    //It'll be good to check 'rc' for error(s).

    //Attach function to database
    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "Attaching function");
    rc = sqlite3_create_function(db, "strip_text", 1, SQLITE_ANY, NULL, &strip_text, NULL, NULL);

    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "Executing query");
    rc = sqlite3_exec(db, query.c_str(), callback, NULL, NULL);

}
static int callback(void *NotUsed, int argc, char **argv, char **azColName)                      {
    __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "FOUND");
    int i;
    for (i = 0; i < argc; ++i) {
        __android_log_print(ANDROID_LOG_VERBOSE, "TAG", "%s = %sn", azColName[i], argv[i] ? argv[i] : "NULL");
    }
    return 0;
}
static {
    System.loadLibrary("native-lib");
}

public native void createFunction(String search);
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org