text:
package com.^^=ns$$.gen.provider;

import com.^^=ns$$.gen.provider.DatabaseConstant.^^=ucfirst(db)$$Constant;

import org.json.JSONObject;
import org.json.JSONException;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;

public class ^^=ucfirst(name)$$Utils {
	public static String getToken(Context context) {
		Cursor c = context.getContentResolver().query(^^=ucfirst(db)$$Constant.CONTENT_URI, null, ^^=ucfirst(db)$$Constant.PRESENT + " = ? ", new String[] { "1" }, null);
		String s = null;
		if (c != null) {
			if (c.moveToNext()) {
				s = c.getString(c.getColumnIndex(^^=ucfirst(db)$$Constant.^^=schema.tokenField.toUpperCase()$$));
			}
			c.close();
		}
		return s;
	}
	public static String getId(Context context) {
		Cursor c = context.getContentResolver().query(^^=ucfirst(db)$$Constant.CONTENT_URI, null, ^^=ucfirst(db)$$Constant.PRESENT + " = ? ", new String[] { "1" }, null);
		String s = null;
		if (c != null) {
			if (c.moveToNext()) {
				s = c.getString(c.getColumnIndex(^^=ucfirst(db)$$Constant.^^=schema.idField.toUpperCase()$$));
			}
			c.close();
		}
		return s;
	}
	^^if(dbdef.getType(schema.fields[0], "java")=="long"){$$
	public static long getIdLong(Context context) {
		Cursor c = context.getContentResolver().query(^^=ucfirst(db)$$Constant.CONTENT_URI, null, ^^=ucfirst(db)$$Constant.PRESENT + " = ? ", new String[] { "1" }, null);
		long s = 0;
		if (c != null) {
			if (c.moveToNext()) {
				s = c.getLong(c.getColumnIndex(^^=ucfirst(db)$$Constant.^^=schema.idField.toUpperCase()$$));
			}
			c.close();
		}
		return s;
	}
		^^}$$
	public static String getUser(Context context) {
		Cursor c = context.getContentResolver().query(^^=ucfirst(db)$$Constant.CONTENT_URI, null, ^^=ucfirst(db)$$Constant.PRESENT + " = ? ", new String[] { "1" }, null);
		String s = null;
		if (c != null) {
			if (c.moveToNext()) {
				s = c.getString(c.getColumnIndex(^^=ucfirst(db)$$Constant.^^=schema.usernameField.toUpperCase()$$));
			}
			c.close();
		}
		return s;
	}
	public static boolean save(JSONObject jo, Context context) throws JSONException {
		ContentValues values = new ContentValues();
		values.put(^^=ucfirst(db)$$Constant.^^=schema.idField.toUpperCase()$$, jo.getString("id"));
		values.put(^^=ucfirst(db)$$Constant.^^=schema.usernameField.toUpperCase()$$, jo.getString("username"));
		values.put(^^=ucfirst(db)$$Constant.^^=schema.tokenField.toUpperCase()$$, jo.getString("token"));

		values.put(^^=ucfirst(db)$$Constant.PRESENT, 1);

		int count = context.getContentResolver().update(
			^^=ucfirst(db)$$Constant.CONTENT_URI, values, null, null);
		return count > 0;
	}
	public static boolean save(String id, String user, String token, Context context) {
		ContentValues values = new ContentValues();
		values.put(^^=ucfirst(db)$$Constant.^^=schema.idField.toUpperCase()$$, id);
		values.put(^^=ucfirst(db)$$Constant.^^=schema.usernameField.toUpperCase()$$, user);
		values.put(^^=ucfirst(db)$$Constant.^^=schema.tokenField.toUpperCase()$$, token);
		values.put(^^=ucfirst(db)$$Constant.PRESENT, 1);

		int count = context.getContentResolver().update(
			^^=ucfirst(db)$$Constant.CONTENT_URI, values, null, null);
		return count > 0;
	}

}


text:
# VSCode JSON Language Server

[![NPM Version](https://img.shields.io/npm/v/vscode-json-languageserver.svg)](https://npmjs.org/package/vscode-json-languageserver)
[![NPM Downloads](https://img.shields.io/npm/dm/vscode-json-languageserver.svg)](https://npmjs.org/package/vscode-json-languageserver)
[![NPM Version](https://img.shields.io/npm/l/vscode-json-languageserver.svg)](https://npmjs.org/package/vscode-json-languageserver)

The JSON Language server provides language-specific smarts for editing, validating and understanding JSON documents. It runs as a separate executable and implements the [language server protocol](https://microsoft.github.io/language-server-protocol/overview) to be connected by any code editor or IDE.

## Capabilities

### Server capabilities

The JSON language server supports requests on documents of language id `json` and `jsonc`.
- `json` documents are parsed and validated following the [JSON specification](https://tools.ietf.org/html/rfc7159).
- `jsonc` documents additionally accept single line (`//`) and multi-line comments (`/* ... */`). JSONC is a VSCode specific file format, intended for VSCode configuration files, without any aspirations to define a new common file format.

The server implements the following capabilities of the language server protocol:

- [Code completion](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for JSON properties and values based on the document's [JSON schema](http://json-schema.org/) or based on existing properties and values used at other places in the document. JSON schemas are configured through the server configuration options.
- [Hover](https://microsoft.github.io/language-server-protocol/specification#textDocument_hover) for values based on descriptions in the document's [JSON schema](http://json-schema.org/).
- [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to properties in the document.
- [Document Colors](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor) for showing color decorators on values representing colors and [Color Presentation](https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation) for color presentation information to support color pickers. The location of colors is defined by the document's [JSON schema](http://json-schema.org/). All values marked with `"format": "color-hex"` (VSCode specific, non-standard JSON Schema extension) are considered color values. The supported color formats are `#rgb[a]` and `#rrggbb[aa]`.
- [Code Formatting](https://microsoft.github.io/language-server-protocol/specification#textDocument_rangeFormatting) supporting ranges and formatting the whole document.
- [Folding Ranges](https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange) for all folding ranges in the document.
- Semantic Selection for semantic selection for one or multiple cursor positions.
- [Goto Definition](https://microsoft.github.io/language-server-protocol/specification#textDocument_definition) for $ref references in JSON schemas
- [Diagnostics (Validation)](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics) are pushed for all open documents
   - syntax errors
   - structural validation based on the document's [JSON schema](http://json-schema.org/).

In order to load JSON schemas, the JSON server uses NodeJS `http` and `fs` modules. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP.

### Client requirements:

The JSON language server expects the client to only send requests and notifications for documents of language id `json` and `jsonc`.

The JSON language server has the following dependencies on the client's capabilities:

- Code completion requires that the client capability has *snippetSupport*. If not supported by the client, the server will not offer the completion capability.
- Formatting support requires the client to support *dynamicRegistration* for *rangeFormatting*. If not supported by the client, the server will not offer the format capability.

## Configuration

### Initialization options

The client can send the following initialization options to the server:

- `provideFormatter: boolean | undefined`. If defined, the value defines whether the server provides the `documentRangeFormattingProvider` capability on initialization. If undefined, the setting `json.format.enable` is used to determine whether formatting is provided. The formatter will then be registered through dynamic registration. If the client does not support dynamic registration, no formatter will be available.
- `handledSchemaProtocols`: The URI schemas handles by the server. See section `Schema configuration` below.
- `customCapabilities`: Additional non-LSP client capabilities:
  - `rangeFormatting: { editLimit: x } }`: For performance reasons, limit the number of edits returned by the range formatter to `x`.

### Settings

Clients may send a `workspace/didChangeConfiguration` notification to notify the server of settings changes.
The server supports the following settings:

- http
   - `proxy`: The URL of the proxy server to use when fetching schema. When undefined or empty, no proxy is used.
   - `proxyStrictSSL`: Whether the proxy server certificate should be verified against the list of supplied CAs.

- json
  - `format`
    - `enable`: Whether the server should register the formatting support. This option is only applicable if the client supports *dynamicRegistration* for *rangeFormatting* and `initializationOptions.provideFormatter` is not defined.
  - `schemas`: Configures association of file names to schema URL or schemas and/or associations of schema URL to schema content.
    - `fileMatch`: an array of file names or paths (separated by `/`). `*` can be used as a wildcard. Exclusion patterns can also be defined and start with '!'. A file matches when there is at least one matching pattern and the last matching pattern is not an exclusion pattern.
    - `url`: The URL of the schema, optional when also a schema is provided.
    - `schema`: The schema content.
  - `resultLimit`: The max number folding ranges and outline symbols to be computed (for performance reasons)

```json
    {
        "http": {
            "proxy": "",
            "proxyStrictSSL": true
        },
        "json": {
            "format": {
                "enable": true
            },
            "schemas": [
                {
                    "fileMatch": [
                        "foo.json",
                        "*.superfoo.json"
                    ],
                    "url": "http://json.schemastore.org/foo",
                    "schema": {
                        "type": "array"
                    }
                }
            ]
        }
    }
```

### Schema configuration and custom schema content delivery

[JSON schemas](http://json-schema.org/) are essential for code assist, hovers, color decorators to work and are required for structural validation.

To find the schema for a given JSON document, the server uses the following mechanisms:
- JSON documents can define the schema URL using a `$schema` property
- The settings define a schema association based on the documents URL. Settings can either associate a schema URL to a file or path pattern, and they can directly provide a schema.
- Additionally, schema associations can also be provided by a custom 'schemaAssociations' configuration call.

Schemas are identified by URLs. To load the content of a schema, the JSON language server either tries to load from that URI or path itself or delegates to the client.

The `initializationOptions.handledSchemaProtocols` initialization option defines which URLs are handled by the server. Requests for all other URIs are sent to the client.

`handledSchemaProtocols` is part of the initialization options and can't be changed while the server is running.

```ts
let clientOptions: LanguageClientOptions = {
		initializationOptions: {
			handledSchemaProtocols: ['file'] // language server should only try to load file URLs
		}
        ...
}
```

If `handledSchemaProtocols` is not set, the JSON language server will load the following URLs itself:

- `http`, `https`: Loaded using NodeJS's HTTP support. Proxies can be configured through the settings.
- `file`: Loaded using NodeJS's `fs` support.

#### Schema content request

Requests for schemas with URLs not handled by the server are forwarded to the client through an LSP request. This request is a JSON language server-specific, non-standardized, extension to the LSP.

Request:
- method: 'vscode/content'
- params: `string` - The schema URL to request.
- response: `string` - The content of the schema with the given URL

#### Schema content change notification

When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server-specific, non-standardized, extension to the LSP.
The server will, as a response, clear the schema content from the cache and reload the schema content when required again.

#### Schema associations notification

In addition to the settings, schemas associations can also be provided through a notification from the client to the server. This notification is a JSON language server-specific, non-standardized, extension to the LSP.

Notification:
- method: 'json/schemaAssociations'
- params: `ISchemaAssociations` or `ISchemaAssociation[]` defined as follows

```ts
interface ISchemaAssociations {
  /**
   * An object where:
   *  - keys are file names or file paths (using `/` as path separator). `*` can be used as a wildcard.
   *  - values are an arrays of schema URIs
   */
  [pattern: string]: string[];
}

interface ISchemaAssociation {
  /**
   * The URI of the schema, which is also the identifier of the schema.
   */
  uri: string;

  /**
   * A list of file path patterns that are associated to the schema. The '*' wildcard can be used. Exclusion patterns starting with '!'.
   * For example '*.schema.json', 'package.json', '!foo*.schema.json'.
   * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.
   */
  fileMatch: string[];
  /*
   * The schema for the given URI.
   * If no schema is provided, the schema will be fetched with the schema request service (if available).
   */
  schema?: JSONSchema;
}

```
`ISchemaAssociations`
  - keys: a file names or file path (separated by `/`). `*` can be used as a wildcard.
  - values: An array of schema URLs

Notification:
- method: 'json/schemaContent'
- params: `string` the URL of the schema that has changed.

### Item Limit

If the setting `resultLimit` is set, the JSON language server will limit the number of folding ranges and document symbols computed.
When the limit is reached, a notification `json/resultLimitReached` is sent that can be shown that can be shown to the user.

Notification:
- method: 'json/resultLimitReached'
- params: a human readable string to show to the user.

## Try

The JSON language server is shipped with [Visual Studio Code](https://code.visualstudio.com/) as part of the built-in VSCode extension `json-language-features`. The server is started when the first JSON file is opened. The [VSCode JSON documentation](https://code.visualstudio.com/docs/languages/json) for detailed information on the user experience and has more information on how to configure the language support.

## Integrate

If you plan to integrate the JSON language server into an editor and IDE, check out [this page](https://microsoft.github.io/language-server-protocol/implementors/tools/) if there's already an LSP client integration available.

You can also launch the language server as a command and connect to it.
For that, install the `vscode-json-languageserver` npm module:

`npm install -g vscode-json-languageserver`

Start the language server with the `vscode-json-languageserver` command. Use a command line argument to specify the preferred communication channel:

```
vscode-json-languageserver --node-ipc
vscode-json-languageserver --stdio
vscode-json-languageserver --socket=<port>
```

To connect to the server from NodeJS, see Remy Suen's great write-up on [how to communicate with the server](https://github.com/rcjsuen/dockerfile-language-server-nodejs#communicating-with-the-server) through the available communication channels.

## Participate

The source code of the JSON language server can be found in the [VSCode repository](https://github.com/microsoft/vscode) at [extensions/json-language-features/server](https://github.com/microsoft/vscode/tree/master/extensions/json-language-features/server).

File issues and pull requests in the [VSCode GitHub Issues](https://github.com/microsoft/vscode/issues). See the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute) on how to build and run from source.

Most of the functionality of the server is located in libraries:
- [jsonc-parser](https://github.com/microsoft/node-jsonc-parser) contains the JSON parser and scanner.
- [vscode-json-languageservice](https://github.com/microsoft/vscode-json-languageservice) contains the implementation of all features as a re-usable library.
- [vscode-languageserver-node](https://github.com/microsoft/vscode-languageserver-node) contains the implementation of language server for NodeJS.

Help on any of these projects is very welcome.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the [MIT](https://github.com/microsoft/vscode/blob/master/LICENSE.txt) License.

redpajama_set_name: RedPajamaGithub


text:
<?php

class RadioGroupBox extends Box {

	private $debug = false;
	public function WithDebug( $value ) { $this->debug = $value; return $this; }

	public function Render(){
		$ns = $this->name;

		echo HiddenBox::Make($this->name,$this->value)->WithHttpName($this->http_name)->WithDebug($this->debug);

		echo Js::BEGIN;
		echo "window.$ns = {";
		echo "  all_values : null";
		echo " ,Init : function(){ if(this.all_values!==null)return; this.all_values=[]; jQuery('.radio-$ns').each(function(){var x=window[this.id];if(!x.GetListValue)return;window.$ns.all_values.push(x.GetListValue());});}";
		echo " ,GetValue:function(){ return jQuery('#$ns').val(); }";
		echo " ,SetValue:function(v){ jQuery('.radio-$ns').each(function(){var x=window[this.id];if(!x.GetListValue)return; if(v===x.GetListValue()) { x.SetValue(true); var xx = jQuery('#$ns'); if (v!==xx.val()) { xx.val(v); $this->on_change; xx.trigger('change'); }} else x.SetValue(false); }); }";
		echo " ,GetAllValues:function(){ this.Init(); return this.all_values;}";
		echo "};";
		echo Js::END;

	}
}


text:
#ifndef UTILS_CLUTIL_FORMAT_LOGGER_HPP
#define UTILS_CLUTIL_FORMAT_LOGGER_HPP

/*                       Titles                                          Authors                        Date
 * -Add boost formatt util                                               Chatsiri.rat                   23/11/2012
 * -Add align right for printing detail                                  Chatsiri.rat                   13/12/2012
 *
 */
//BOOST
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/find_iterator.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/tokenizer.hpp>
//STL
#include <iostream>
#include <iterator>
#include <vector>
#include <sstream>
#include <string>

namespace utils
{

    // CENTER [   XXX   ]
    // LIFT   [xxx      ]
    // RIGHT  [      xxx]

    namespace format_type
    {
        enum type { type_header = 0, type_center = 1, type_lift = 2, type_right =3, type_right_detail = 4 };
    }

    using namespace boost;

    template<typename TypeData, typename CONST = int>
    class format_logger
    {
        public:
            format_logger(TypeData str, const format_type::type&  type) : str_(str), type_(type) { };
            void adjust_header();
            void adjust_center();
            void adjust_lift();
            void adjust_right();

            void align_right_detail();

            void common_adjust(TypeData& _str, TypeData& format_str);

            std::vector<TypeData> *get_str_format();

        private:
            TypeData str_;
            format_type::type type_;
            std::vector<TypeData>  vec_string;
    };

}

#endif /*  HNMAV_UTIL_CLUTIL_FORMAT_LOGGER_HPP */


text:
class MElement;
class MTetrahedron;
class MHexahedron;
class MPrism;
class MPyramid;
class MPolyhedron;
class MTrihedron;
class ExtrudeParams;
class BoundaryLayerColumns;

// A model region.
class GRegion : public GEntity {
protected:
    std::vector<GFace *> l_faces;
    std::vector<GVertex *> embedded_vertices;
    std::vector<GFace *> embedded_faces;
    std::vector<GEdge *> embedded_edges;
    std::vector<int> l_dirs;
    BoundaryLayerColumns _columns;

public:
    GRegion(GModel *model, int tag);
    virtual ~GRegion();

    // delete mesh data
    virtual void deleteMesh(bool onlyDeleteElements = false);

    // get the dimension of the region (3)
    virtual int dim() const { return 3; }

    // returns the parent entity for partitioned entities
    virtual GEntity *getParentEntity() { return 0; }

    // set the visibility flag
    virtual void setVisibility(char val, bool recursive = false);

    // set color
    virtual void setColor(unsigned int val, bool recursive = false);

    // add embedded vertices/edges/faces
    void addEmbeddedVertex(GVertex *v) { embedded_vertices.push_back(v); }
    void addEmbeddedEdge(GEdge *e) { embedded_edges.push_back(e); }
    void addEmbeddedFace(GFace *f) { embedded_faces.push_back(f); }

    // get/set faces that bound the region
    int delFace(GFace *face);

    virtual std::vector<GFace *> faces() const { return l_faces; }

    virtual std::vector<int> faceOrientations() const { return l_dirs; }
    void set(std::vector<GFace *> const &f) { l_faces = f; }
    void setOrientations(const std::vector<int> &f) { l_dirs = f; }
    void setFace(GFace *const f, int const orientation)
    {
        l_faces.push_back(f);
        l_dirs.push_back(orientation);
    }

    // vertices that are embedded in the region
    virtual std::vector<GVertex *> &embeddedVertices()
    {
        return embedded_vertices;
    }
    // edges that are embedded in the region
    virtual std::vector<GEdge *> embeddedEdges() const { return embedded_edges; }
    virtual std::vector<GEdge *> &embeddedEdges() { return embedded_edges; }
    // faces that are embedded in the region
    virtual std::vector<GFace *> embeddedFaces() const { return embedded_faces; }

    // edges that bound the region
    virtual std::vector<GEdge *> const &edges() const;

    // vertices that bound the region
    virtual std::vector<GVertex *> vertices() const;

    // get the bounding box
    virtual SBoundingBox3d bounds(bool fast = false) const;

    // get the oriented bounding box
    virtual SOrientedBoundingBox getOBB();

    // check if the region is connected to another region by an edge
    bool edgeConnected(GRegion *r) const;

    // compute volume, moment of intertia and center of gravity
    double computeSolidProperties(std::vector<double> cg,
                                  std::vector<double> inertia);

    // return a type-specific additional information string
    virtual std::string getAdditionalInfoString(bool multline = false);

    // export in GEO format
    virtual void writeGEO(FILE *fp);

    // number of types of elements
    int getNumElementTypes() const { return 6; }

    // get total/by-type number of elements in the mesh
    std::size_t getNumMeshElements() const;
    std::size_t getNumMeshElementsByType(const int familyType) const;
    std::size_t getNumMeshParentElements();
    void getNumMeshElements(unsigned *const c) const;

    // get the start of the array of a type of element
    MElement *const *getStartElementType(int type) const;

    // get the element at the given index
    MElement *getMeshElement(std::size_t index) const;
    // get the element at the given index for a given familyType
    MElement *getMeshElementByType(const int familyType,
                                   const std::size_t index) const;

    // reset the mesh attributes to default values
    virtual void resetMeshAttributes();

    struct {
        // do we recombine the tetrahedra of the mesh into hex?
        int recombine3D;
        // is this surface meshed using a transfinite interpolation
        char method;
        // the extrusion parameters (if any)
        ExtrudeParams *extrude;
        // corners of the transfinite interpolation
        std::vector<GVertex *> corners;
        // structured/unstructured coupling using pyramids
        int QuadTri;
    } meshAttributes;

    // a array for accessing the transfinite vertices using a triplet of
    // indices
    std::vector<std::vector<std::vector<MVertex *> > > transfinite_vertices;

    std::vector<MTetrahedron *> tetrahedra;
    std::vector<MHexahedron *> hexahedra;
    std::vector<MPrism *> prisms;
    std::vector<MPyramid *> pyramids;
    std::vector<MTrihedron *> trihedra;
    std::vector<MPolyhedron *> polyhedra;

    void addTetrahedron(MTetrahedron *t) { tetrahedra.push_back(t); }
    void addHexahedron(MHexahedron *h) { hexahedra.push_back(h); }
    void addPrism(MPrism *p) { prisms.push_back(p); }
    void addPyramid(MPyramid *p) { pyramids.push_back(p); }
    void addPolyhedron(MPolyhedron *p) { polyhedra.push_back(p); }
    void addTrihedron(MTrihedron *t) { trihedra.push_back(t); }
    void addElement(int type, MElement *e);
    void removeElement(int type, MElement *e);

    // get the boundary layer columns
    BoundaryLayerColumns *getColumns() { return &_columns; }

    virtual bool reorder(const int elementType, const std::vector<std::size_t> &ordering);

    // set the reverseMesh constraint in the bounding surfaces so that the
    // boundary mesh has outward pointing normals, based on the STL triangulation
    bool setOutwardOrientationMeshConstraint();
};

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl_PL">
<context>
    <name>App</name>
    <message>
        <location filename="../stacer/app.cpp" line="80"/>
        <source>Dashboard</source>
        <translation type="Deska rozdzielcza"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="85"/>
        <source>System Cleaner</source>
        <translation type="Czyszczenie systemu"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="90"/>
        <source>System Startup Apps</source>
        <translation type="Aplikacje startowe"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="95"/>
        <source>System Services</source>
        <translation type="Usługi systemowe"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="100"/>
        <source>Uninstaller</source>
        <translation type="Deinstalator"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="105"/>
        <source>Resources</source>
        <translation type="Zasoby"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="110"/>
        <source>Processes</source>
        <translation type="Procesy"></translation>
    </message>
    <message>
        <location filename="../stacer/app.cpp" line="115"/>
        <source>Settings</source>
        <translation type="Ustawienia"></translation>
    </message>
</context>
<context>
    <name>DashboardPage</name>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.ui" line="153"/>
        <source>SYSTEM INFO</source>
        <translation type="INFORMACJE SYSTEMOWE"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.ui" line="240"/>
        <source>Dostępne są nowe aktualizacje.</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.ui" line="253"/>
        <source>Download</source>
        <translation type="Pobieranie"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="18"/>
        <source>CPU</source>
        <translation type="PROCESOR"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="19"/>
        <source>MEMORY</source>
        <translation type="PAMIĘĆ RAM"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="20"/>
        <source>DISK</source>
        <translation type="DYSK"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="21"/>
        <source>DOWNLOAD</source>
        <translation type="POBIERANIE"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="22"/>
        <source>UPLOAD</source>
        <translation type="WYSYŁANIE"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="107"/>
        <source>Hostname: %1</source>
        <translation type="Nazwa hosta"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="108"/>
        <source>Platform: %1</source>
        <translation type="Platforma"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="109"/>
        <source>Distribution: %1</source>
        <translation type="Dystrybucja"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="110"/>
        <source>Kernel Release: %1</source>
        <translation type="Wydanie jądra Linux"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="111"/>
        <source>CPU Model: %1</source>
        <translation type="Model CPU"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="112"/>
        <source>CPU Speed: %1</source>
        <translation type="Zegar CPU"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="113"/>
        <source>CPU Core: %1</source>
        <translation type="Rdzenie CPU"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="182"/>
        <location filename="../stacer/Pages/Dashboard/dashboard_page.cpp" line="186"/>
        <source>Total: %1</source>
        <translation type="Łącznie"></translation>
    </message>
</context>
<context>
    <name>ProcessesPage</name>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.ui" line="55"/>
        <source>Processes</source>
        <translation type="Procesy"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.ui" line="68"/>
        <source>All Processes</source>
        <translation type="Wszystkie Procesy"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.ui" line="88"/>
        <source>Search...</source>
        <translation type="Wyszukaj"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.ui" line="206"/>
        <source>End Process</source>
        <translation type="Zakończ Proces"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="35"/>
        <source>User</source>
        <translation type="Użytkownik"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="35"/>
        <source>Resident Memory</source>
        <translation type="Zajęta Pamięć"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="35"/>
        <source>%Memory</source>
        <translation type="Pamięć"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="35"/>
        <source>Virtual Memory</source>
        <translation type="Pamięć Wirtualna"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="36"/>
        <source>Start Time</source>
        <translation type="Czas Startu"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="36"/>
        <source>State</source>
        <translation type="Stan"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="36"/>
        <source>Group</source>
        <translation type="Grupa"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="36"/>
        <source>Nice</source>
        <translation type="Nice"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="36"/>
        <source>CPU Time</source>
        <translation type="Czas CPU"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="37"/>
        <source>Session</source>
        <translation type="Sesja"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="37"/>
        <source>Seat</source>
        <translation type="Seat"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="37"/>
        <source>Process</source>
        <translation type="Proces"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="104"/>
        <source>Processes (%1)</source>
        <translation type="Procesy"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Processes/processes_page.cpp" line="198"/>
        <source>Refresh (%1)</source>
        <translation type="Odśwież"></translation>
    </message>
</context>
<context>
    <name>ResourcesPage</name>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="26"/>
        <source>CPU History</source>
        <translation type="Historia użycia CPU"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="29"/>
        <source>Memory History</source>
        <translation type="Historia użycia pamięci"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="32"/>
        <source>Network History</source>
        <translation type="Historia wykorzystania internetu"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="76"/>
        <source>Download %1/s Total: %2</source>
        <translation type="Łącznie"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="81"/>
        <source>Upload %1/s  Total: %2</source>
        <translation type="Łącznie"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="122"/>
        <source>Swap %1 (%2%) %3</source>
        <translation type="Swap"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Resources/resources_page.cpp" line="131"/>
        <source>Memory %1 (%2%) %3</source>
        <translation type="Pamięć RAM"></translation>
    </message>
</context>
<context>
    <name>ServicesPage</name>
    <message>
        <location filename="../stacer/Pages/Services/services_page.ui" line="79"/>
        <source>System Services</source>
        <translation type="Usługi Systemowe"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Services/services_page.ui" line="123"/>
        <source>Startup at boot ?</source>
        <translation type="Uruchamiane przy starcie systemu ?"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Services/services_page.ui" line="176"/>
        <source>Running Now ?</source>
        <translation type="Obecnie działające ?"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Services/services_page.ui" line="246"/>
        <source>Not Found System Service</source>
        <translation type="Nie znaleziono usług systemowych"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Services/services_page.cpp" line="50"/>
        <source>System Services (%1)</source>
        <translation type="Usługi Systemowe"></translation>
    </message>
</context>
<context>
    <name>SettingsPage</name>
    <message>
        <location filename="../stacer/Pages/Settings/settings_page.ui" line="54"/>
        <source>Language</source>
        <translation type="Język"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Settings/settings_page.ui" line="71"/>
        <source>Theme</source>
        <translation type="Motyw"></translation>
    </message>
</context>
<context>
    <name>StartupApp</name>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app.cpp" line="23"/>
        <source>Delete</source>
        <translation type="Usuń"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app.cpp" line="24"/>
        <source>Edit</source>
        <translation type="Edytuj"></translation>
    </message>
</context>
<context>
    <name>StartupAppEdit</name>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="20"/>
        <source>Startup App</source>
        <translation type="Aplikacja Startowa"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="50"/>
        <source>Save</source>
        <translation type="Zapisz"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="60"/>
        <source>Fields cannot be left blank. </source>
        <translation type="Pole nie może być puste"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="67"/>
        <source>App Comment</source>
        <translation type="Komentarz do aplikacji"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="74"/>
        <source>App Name</source>
        <translation type="Nazwa Aplikacji"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="81"/>
        <source>Command</source>
        <translation type="Polecenie"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_app_edit.ui" line="88"/>
        <source>Application</source>
        <translation type="Aplikacja"></translation>
    </message>
</context>
<context>
    <name>StartupAppsPage</name>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_apps_page.ui" line="192"/>
        <source>Not Found Startup Apps</source>
        <translation type="Nie znaleziono aplikacji startowych"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_apps_page.ui" line="112"/>
        <source>System Startup Applications</source>
        <translation type="Systemowe Aplikacje Startowe"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_apps_page.ui" line="95"/>
        <source>Add Startup App</source>
        <translation type="Dodaj Aplikację Startową"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/StartupApps/startup_apps_page.cpp" line="79"/>
        <source>System Startup Applications (%1)</source>
        <translation type="Systemowe Aplikacje Startowe"></translation>
    </message>
</context>
<context>
    <name>SystemCleanerPage</name>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="63"/>
        <source>Crash Reports</source>
        <translation type="Raporty błędów"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="168"/>
        <source>Application Logs</source>
        <translation type="Logi aplikacji"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="206"/>
        <source>Application Caches</source>
        <translation type="Pamięć podręczna aplikacji"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="327"/>
        <source>Trash</source>
        <translation type="Kosz"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="365"/>
        <source>Package Caches</source>
        <translation type="Pamięć podręczna pakietów"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.ui" line="473"/>
        <source> Back</source>
        <translation type="Powrót"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.cpp" line="32"/>
        <source>File Name</source>
        <translation type="Nazwa Pliku"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.cpp" line="32"/>
        <source>Size</source>
        <translation type="Rozmiar"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/SystemCleaner/system_cleaner_page.cpp" line="285"/>
        <source>%1 size files cleaned.</source>
        <translation type="wyczyszczono"></translation>
    </message>
</context>
<context>
    <name>UninstallerPage</name>
    <message>
        <location filename="../stacer/Pages/Uninstaller/uninstallerpage.ui" line="228"/>
        <source>System Installed Packages</source>
        <translation type="Pakiety zainstalowane w systemie"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Uninstaller/uninstallerpage.ui" line="271"/>
        <source>Search...</source>
        <translation type="Wyszukaj"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Uninstaller/uninstallerpage.ui" line="178"/>
        <source>Not Found Installed Packages</source>
        <translation type="Nie znaleziono zainstalowanych pakietów"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Uninstaller/uninstallerpage.ui" line="132"/>
        <source>Uninstall Selected</source>
        <translation type="Odinstaluj zaznaczone"></translation>
    </message>
    <message>
        <location filename="../stacer/Pages/Uninstaller/uninstaller_page.cpp" line="65"/>
        <source>System Installed Packages (%1)</source>
        <translation type="Pakiety zainstalowane w systemie"></translation>
    </message>
</context>
</TS>


text:
"""Descriptions class update descriptions on BQ objects.

  Typical usage example:

  Descriptions.get_sql_statement(
    execution_context= self.execution_context,
    task_config=self.task_config)
"""

import pathlib
from typing import Optional
from google.cloud import bigquery
from grizzly.grizzly_typing import TGrizzlyOperator
from grizzly.grizzly_typing import TGrizzlyTaskConfig
from grizzly.etl_action import parse_table

DESCRIPTION_FAIL_IF_NOT_EXISTS = True

class Descriptions:
  """Descriptions class update descriptions on BQ objects.

  If yaml file of object contains tag
    descriptions:
      table: free-text
      columns:
        col1: free-text
        col2: free-text

  """

  supported_write_mode = ["WRITE_APPEND",
                          "WRITE_EMPTY",
                          "WRITE_TRUNCATE",
                          "CREATE_VIEW",
                          "UPDATE",
                          "DELETE"]

  @classmethod
  def update_description(cls,
                        execution_context: TGrizzlyOperator,
                        task_config: TGrizzlyTaskConfig
                        ) -> None:
    """Update descriptions in BQ object.

    This method used to update/delete/add descriptions to BQ object.

    Args:
      execution_context (TGrizzlyOperator): execution context of task
      task_config (TGrizzlyTaskConfig): task configuration

    Returns:
      None
    """
    target_table = parse_table(task_config.target_table_name)
    target_table = ".".join(target_table.values())

    bq_table = execution_context.bq_client.get_table(target_table)
    original_schema = bq_table.schema[:]

    table_desirable_desc = task_config.descriptions.get("table", None)

    fail_if_not_exists = DESCRIPTION_FAIL_IF_NOT_EXISTS

    if table_desirable_desc != bq_table.description:
      bq_table.description = table_desirable_desc
      bq_table = execution_context.bq_client.update_table(bq_table, ["description"])

    if task_config.descriptions and "columns" in task_config.descriptions:
      desirable_cols_desc = {k.lower():v for k,v in task_config.descriptions["columns"].items() }

      if fail_if_not_exists:
        orig_columns = [col.name.lower() for col in original_schema]
        notfound_columns = [k for k,v in desirable_cols_desc.items() if k.lower() not in orig_columns]

        if notfound_columns:
          notfound_columns_st = ", ".join(notfound_columns)
          msg = f"The [{notfound_columns_st}] columns in descriptions.columns section are not found."
          execution_context.log.info(msg)
          execution_context.log.info("The ETL step will be stopped. But the data is already processed. ")
          raise Exception(f"[{notfound_columns_st}] should be presented in the {target_table} table.")

      new_schema = []
      for col in original_schema:
        column_data = col.to_api_repr()
        column_name = column_data["name"]

        if column_name.lower() in desirable_cols_desc:
          column_data["description"] = desirable_cols_desc[column_name.lower()]
        elif column_name.lower() not in desirable_cols_desc and column_data.get("description", None) is not None:
          column_data["description"] = None

        col = bigquery.SchemaField.from_api_repr(column_data)
        new_schema.append(col)

      bq_table.schema = new_schema
      execution_context.bq_client.update_table(bq_table,["schema"])


text:
        <input type="checkbox" class="kuiCheckBox">

        Title

        Status

        Date created

        Date last modified

          <input type="checkbox" class="kuiCheckBox">

          Alligator

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          <input type="checkbox" class="kuiCheckBox">

          Boomerang

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          <input type="checkbox" class="kuiCheckBox">

          Celebration of some very long content that will affect cell width and should eventually become truncated

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          <input type="checkbox" class="kuiCheckBox">

          Dog

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)

          Tue Dec 06 2016 12:56:15 GMT-0800 (PST)