text:
Q: Passing a dynamic set of variadic arguments to a C function I'm trying to call a C function that takes variadic arguments, and I need to pass in a dynamic number of arguments to the function. Additionally, this is an API I can't modify without going to a lot of effort, so if there's any possible to make this work I'll take it.
As far as I can tell, va_list is not sufficient for this purpose since you can't pass a va_list where ... was written in the original function signature.
Answers for other questions like this one talk about how to pass a ... from one function to another, but that's not what I'm doing. I need to actually dynamically generate the list of arguments, I'm not getting it in as a .... Also, all the answers I can find rely being able to modify the function to take a va_list, which is not an option here.
There was also this question, which was marked as a dupe of the previous question despite not actually asking the same question. Again, the only answer suggests converting the call to use va_list which is not an option.
I would understand if the standard didn't include a way to do this, but this seems like a case where I can imagine a perfectly reasonable implementation. This isn't so different from, say, alloca. Anyway, if it's not possible, that's fine, but I'd like the SO community to realize that this isn't a dupe of this question and deserves a definitive answer.
The API I'm calling is in C, but if there's a way to do this in C++ I would consider it.
Edit: If you have these requirements, it looks like this answer using libffi is the best way to go. There does not appear to be a way to do this either in standard C or with GCC extensions otherwise.

A: If you use gcc compiler, you can use __builtin_va_arg_pack() or __builtin_apply(), see here.
Examples:
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>

int my_printf(const char *fmt, ...)
{
    void *args = __builtin_apply_args();
    void *ret = __builtin_apply((void(*)())printf, args, 100);
    __builtin_return(ret);
}

extern int my2_printf(const char *, ...);
extern inline __attribute__((__always_inline__,__gnu_inline__))
int my2_printf(const char *fmt, ...) {
    return printf(fmt, __builtin_va_arg_pack());
}

int main()
{
    my_printf("%s %s %s %s %s\n", "Hi", "I", "am", "kamil", "!");
    my2_printf("%s %s %s %s\n", "Variadic", "args", "are", "fun");
    return 0;
}

@edit:
As the question is also about on how to construct a dynamic argument list and then pass it to function. You can create a function for each case you need to support and use a big switch to differentiate between them.
A example for printing an array of unknown compile size:
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdlib.h>
#include <boost/preprocessor/repetition/repeat.hpp>

void print_array(size_t cnt, ...)
{
        va_list va;
        va_start(va, cnt);
        printf("%s cnt=%d :", __func__, cnt);
        for (size_t i = 0; i < cnt; ++i) {
                printf(" %d", va_arg(va, int));
        }
        va_end(va);
        printf("%s\n");
}

// we support an array up to that many arguments
#define CALL_PRINT_ARRAY_MAX  128

#define CALL_PRINT_ARRAY_ARGS(z, n, text) \
        , arr[n]
#define CALL_PRINT_ARRAY_DECLARE(z, n, text) \
void call_print_array_##n (int arr[]) \
{ \
        print_array(n BOOST_PP_REPEAT(n, CALL_PRINT_ARRAY_ARGS, ())); \
}
BOOST_PP_REPEAT(CALL_PRINT_ARRAY_MAX, CALL_PRINT_ARRAY_DECLARE, ())
#undef CALL_PRINT_ARRAY_DECLARE
#undef CALL_PRINT_ARRAY_ARGS

int call_print_array(int arr[], size_t n)
{
        switch(n) {

#define CALL_PRINT_ARRAY_CASE(z, n, text) \
        case n: call_print_array_##n(arr); break;
                BOOST_PP_REPEAT(CALL_PRINT_ARRAY_MAX, CALL_PRINT_ARRAY_CASE, ())
#undef CALL_PRINT_ARRAY_CASE

        default:
                fprintf(stderr, "Array size is too big for what we're prepared\n");
                return -1;
        }
        return 0;
}

int main()
{
        //int a1[5] = {1,2,3,4,5};
        //call_print_array(a1, sizeof(a1)/sizeof(a1[0]));

        size_t size;
        scanf("%zu", &size); // insecure
        int * a2 = calloc(size, sizeof(*a2));
        for (size_t i = 0; i < size; ++i)
                a2[i] = i;
        call_print_array(a2, size);

        return 0;
}

A: The easiest way to do this would be with variadic macros, kind of like the way it's done for eprintf:
#define eprintf(…) fprintf (stderr, __VA_ARGS__)

__VA_ARGS__ expands into the full argument list passed into the macro with which you can then call the other function declared with .... Unfortunately what you want to do cannot be done within a function without going through a lot of effort that you seem to want to avoid.


text:
Q: MVC - display a user profile setting in dropdown list on several pages I would like to display the value of a specific user profile setting in the header of every page (_Layout.cshtml). I see how a default MVC Web Application displays the user's name in "Welcome user!", but this name is obtained by calling User.Identity.GetUserName(). The setting I want to display is a custom setting.
It would seem that I need to pass the custom setting from the controller, but I'm not sure how to get to the controller from within _Layout.cshtml. I've tried @Html.RenderPartial, but that doesn't trigger a Controller Action/method, or can it?
I've tried @Html.RenderAction which gets me into the controller, that requires an entire View to be rendered, or is there a way around this?
Could someone tell me what razor syntax I would use from any view to trigger a Controller Action that will render just an input control? I don't need the Controller/Action logic other than the return statement.
EDIT
@Rowan Freeman seems to be pointing me back in a direction that I already tried. In fairness he didn't know I need to perform a POST with this user setting. Here is the code I've tried:
ViewModel
public class LanguageListPartialViewModel
{
    public string SelectedLanguage { get; set; }
    public IEnumerable<System.Web.Mvc.SelectListItem> Languages { get; set; }
}

~/Views/Shared/_LanguageListPartial.cshtml
@model GPS_Web_App.Models.LanguageListPartialViewModel

@Html.DropDownListFor(
    x => x.SelectedLanguage,
    Model.Languages,
    new { @class = "form-control", onchange = "this.form.submit();" }
)

~/Views/Shared/_Layout.cshtml
<form action="/Account/LanguageListPartial" method="post">
    @{Html.RenderAction("LanguageListPartial", "Account");}
</form>

GET Controller Action
[AllowAnonymous]
[ChildActionOnly]
public ActionResult LanguageListPartial()
{
    // Logic to create a populate model's List<SelectListItem> Languages
    // Logic to set model's string SelectedLanguage
    // Logic is already written and returns correct list.

    return PartialView("_LanguageListPartial", model);
}

POST Controller Action
[AllowAnonymous]
[HttpPost]
public async Task<ActionResult> LanguageListPartial(string SelectedLanguage)
{
    // Logic to set user profile setting to selection
    // Logic is already written and correctly sets user profile setting

    return RedirectToLocal(Request.UrlReferrer.AbsolutePath);
}

The reason I wrap the partial view with  in _Layout.cshtml is because there are times when I only want to display the list within a form on a different page - for example, EditProfile page - it contains it's own  wrapper. I do have one caveat, that is that the PartialView has an onSubmit() which has the undesirable effect of submitting any form it's contained it. I'll fix that later.
The problem with the above layout seems to be specifically with the return() in the POST action - the rendered page on return consists only of the dropdown list instead of rendering the dropdown list within the page it was called from.

A: Use Html.Action in conjunction with a partial view.
You're very close to a good solution. Let me clarify the steps.

*

*Create a partial view. A partial view is just a regular view but they're usually small and are used to be part of the final page to be rendered. The partial view might be called "_UserProfile.cshtml". An underscore at the beginning is a good convention for indicating a partial view. The view should use a simple model, perhaps UserProfileModel.

*Create an appropriate controller and action. The controller could be called PartialsController and the action might be UserProfile(). Attach the attribute [ChildActionOnly] to the action (or controller) so that it can't be accessed by a regular URL. The action should return PartialView("_UserProfile");.

*Call the action from your _Layout using @Html.Action("UserProfile", "Partials").

redpajama_set_name: RedPajamaStackExchange


text:
Q: schm-reduplication (yiddish) morphological process By definition, schm-reduplication is a form of reduplication in which the original word or its first syllable (the base) is repeated with the copy (the reduplicant) beginning with shm-.
baby -> schmaby
sprinkler -> schminkler
artist -> schmartist

So all of the letters up till the first vowel of the word are removed with a 'schm' prepended to it.
How do translate this into code?
I'm thinking..
(1) Get the list. (2) Remove all elements until the first vowel is detected. So I'm thinking this will be useful: vowel(X):- member(X,[a,e,i,o,u]). So I would need to scan first element to the end and once I get to a vowel, I keep that and prepend a 'schm'.
I'm having trouble with the removing all elements till vowel part. Can someone help?
I have:
yiddish(A,B):-
append([s,c,h,m],A,B).

?- yiddish([h,o,u,s,e],X).
X = [s, c, h, m, h, o, u, s, e].

A: your schema could be implemented like
yiddish(A,B) :- after_first_vowel(A,AFV), append([s,c,h,m],AFV,B).

% here some decision should be taken about data correctness
after_first_vowel([C|Cs],[C|Cs]) :- memberchk(C,[a,e,i,o,u]), !.
after_first_vowel([_|Cs],Rs) :- after_first_vowel(Cs,Rs).

basic test:
?- atom_chars(baby,Cs),yiddish(Cs,L).
Cs = [b, a, b, y],
L = [s, c, h, m, a, b, y]


text:
Q: Binding data to Html tags with data received from REST API | IONIC and Angular trying to build woocommerce app using rest API
Basically, i am receiving data using promise into a variable
and i have used same variable to display data to front end HTML

Rs. {{productregprice}} / {{productonsaleprice}}

Rs. {{productonsaleprice}}

the problem i am facing is - data is loaded in variable productregprice and productonsaleprice async as rest API call is finished
meanwhile on front end - HTML view is rendered and so the it gives error undefined
i am unable to understand how to wait for async call to finish and then give data to HTML tags so as to display actual price and not 0
my typescript code is
productregprice = 0;
    productonsaleprice = 0;
    onsale = true;
    productshortdescription =   "";

catids = this.route.getCurrentNavigation().extras.state.productid;
    secondurl = `${this.url}/wp-json/wc/v3/products/${this.catids}?consumer_key=${this.key}&consumer_secret=${this.secretkey}`;

constructor(private http: HttpClient,private route: Router)
   {
     console.log(this.route.getCurrentNavigation().extras.state.productid);
     this.product = this.getProductsData().then(res=>console.log(res));
     console.log(this.product);
     if(typeof this.product.images != 'undefined')
                    {
                        this.productimages = this.product.images;
                    }
                    else
                    {

                        this.productimages = [];
                    }
                    console.log("loaded");
   }

getProductsData()
    {
            return new Promise(resolve => {this.http.get(this.secondurl).subscribe(productdata => {resolve(productdata);});});
    }

Please help

A: Edit: use *ngIf="product && (other conditions)" for that HTML element.
This should be a comment but due to low reputation, adding it as an answer.
Could you please share the code where you have used this.product to assign values to productregprice and productonsaleprice.
You have initialized productonsaleprice = 0 which maybe be throwing the error as you are using it in the denominator.


text: Q: Solutions to Rao's book I hope this is the appropriate forum and the questions hasnt been asked already but does anyone know if there is a solution manual for Rao's 'Linear statistical inference and its applications'(2nd ed)?


text:
Q: Safely extract only directory path from file path and create directory if not exists in python Is there anyway safely we can extract directory path from file and create directory if not exists
Example:
path = "/a/b/c/d/e/f/1.txt"
extract_directory_path_only = path.split("/")[0:-1]
dir = "/".join(extract_directory_path_only)
Path(dir.mkdir(parents=True, exist_ok=True))


text:
Q: Azure Pipeline - Caching NPM - Jest Unexpected token ] I have a monorepo with Lerna and yarn workspaces. I use Azure Devops to build and publish the application.
Commands
"emis-app:test": "yarn --cwd apps/my-app test", is located on the root package.json
What works
When there is a cache miss or when I don't cache NPM modules,
yarn my-app:test which then trigger yarn --cwd apps/my-app test is successful
What does not work
When the cache is used yarn emis-app:test which then triggers yarn --cwd apps/my-app test does not work and tests are failing.
Here is the output of the cache hit
Resolving key:
 - **/yarn.lock, !**/node_modules/**/yarn.lock, !*... [file pattern; matches: 4]
   - s/apps/my-app/yarn.lock        --> 0E8B2ACAB9CF0A6F80305D0BD6C99FDFA703EE248C33DB254DF57F46CC67B6AF
   - s/apps/my-app-1/yarn.lock         --> 95AB055F93FBE7A5E118B9C1391F81E1E9885D5ED5F0B6EAAB46985D0619C81D
   - s/libs/my-lib/yarn.lock --> C8B48CB9F78F4AAE95941EE10588B139FEE51E2CEDA3313E7FE2B78A32C680B0
   - s/yarn.lock                       --> 31D5354CDC72614EEE3B29335A5F6456576FAEF27417B811967E7DDA9BD91E48

Workspaces
"workspaces": {
"packages": [
  "apps/*",
  "libs/*"
]

}
Each app is a vue application. Each app contains its own package.json, babel.config, jest.config etc.
jest.config.base extended in each app.
module.exports = {
  preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
  transform: {
    'vee-validate/dist/rules': 'babel-jest',
    '.*\\.(vue)$': 'vue-jest',
    '^.+\\.(ts|tsx)$': 'ts-jest',
  },
  testMatch: [
    '**/*.(spec|test).(js|jsx|ts|tsx)',
  ],
  testEnvironmentOptions: {
    // Allow test environment to fire onload event
    // See https://github.com/jsdom/jsdom/issues/1816#issuecomment-355188615
    resources: 'usable',
  },
  reporters: [
    'default',
    [
      'jest-trx-results-processor',
      {
        outputFile: './coverage/test-results.trx',
        defaultUserName: 'user name to use if automatic detection fails',
      },
    ],
  ],
  moduleFileExtensions: [
    'js',
    'ts',
    'json',
    'vue',
  ],
  testURL: 'http://localhost/',
  snapshotSerializers: [
    'jest-serializer-vue',
  ],
  runner: 'groups',
};

jest.config (my-app)
const baseConfig = require('../../jest.config.base');

const packageJson = require('./package.json');

module.exports = {
  ...baseConfig,
  transformIgnorePatterns: [],
  roots: [
    '<rootDir>/src',
  ],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1',
    '^@libs/registration-lib/(.*)$': '<rootDir>/../../libs/registration-lib/src/$1',
  },
  name: packageJson.name,
  displayName: packageJson.name,
};

Questions

*

*Am I using the cache correctly?

*Is it possible to use the caching when working with workspaces
Errors

FAIL @apps/my-app src/ui/views/pages/registration/individual/Individual.vue.spec.js
● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

SyntaxError: Unexpected token ] in JSON at position 467
    at JSON.parse (<anonymous>)

  at parse (../../node_modules/tsconfig/src/tsconfig.ts:195:15)
  at readFileSync (../../node_modules/tsconfig/src/tsconfig.ts:181:10)
  at Object.loadSync (../../node_modules/tsconfig/src/tsconfig.ts:151:18)
  at find (../../node_modules/vue-jest/lib/load-typescript-config.js:33:39)
  at loadTypescriptConfig (../../node_modules/vue-jest/lib/load-typescript-config.js:73:26)
  at compileTypescript (../../node_modules/vue-jest/lib/compilers/typescript-compiler.js:9:20)
  at processScript (../../node_modules/vue-jest/lib/process.js:23:12)
  at Object.module.exports [as process] (../../node_modules/vue-jest/lib/process.js:42:18)
  at ScriptTransformer.transformSource (../../node_modules/@jest/transform/build/ScriptTransformer.js:453:35)

Pipeline YAML
- task: NodeTool@0
  inputs:
    versionSpec: '15.x'
  displayName: 'Install Node.js'

 - task: Cache@2
   displayName: Cache yarn packages
   inputs:
     key: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
     path: $(Build.SourcesDirectory)/node_modules
     cacheHitVar: CACHE_HIT

  - task: Yarn@3
    condition: ne(variables['CACHE_HIT'], 'true')
    inputs:
      customRegistry: 'useFeed'
      customFeed: ${{ parameters.packageFeed }}
      arguments: --frozen-lockfile
      displayName: 'Install NPM dependencies'

  - script: yarn my-app:test
     displayName: "Test My App"


text:
Q: Simplifying Fractions With A Variable Simplify:
$$\frac{1}{P(1-\frac{P}{N})(1-\frac{m}{P})}$$ To show that it is equal to:
$$\frac{N}{N-m}  \left[\frac{1}{N-P}+\frac{1}{P-m}\right].$$
I honestly have no idea how to even start the question. I am wondering if the question is asking to go backward, i.e. to go from the second part to the first, but it doesn't seem that way. If someone could show me how to do this or even get me started would be very helpful!

A: Hint:
$$\frac{1}{P(1-\frac{P}{N})(1-\frac{m}{P})}=\frac{1}{(1-\frac{P}{N})(P-m)}=\frac{N}{(N-P)(P-m)}.$$
Then use partial fractions.
$$\frac{N}{(N-P)(P-m)}=\frac{\alpha}{N-P}+\frac{\beta}{P-m}$$
Expand the expression on the right and compare it with the expression on the left-hand side to determine $\alpha$ and $\beta$.

Euler's trick: Instead of expanding the right-hand side you can also use Euler's trick. For example to obtain $\alpha$ multiply by the associated denominator $N-P$ and then set $N-P=0\implies P=N$ to obtain:
$$\frac{N}{P-m}\biggl|_{P=N}=\alpha+\frac{N-P}{P-m}
\biggl|_{P=N}\beta \implies \alpha = \frac{N}{N-m}$$


text:
Q: Pegar uma propriedade css com jquery Teria como eu verificar uma propriedade css com jquery ou js puro?

Obs: Usar is.(':visible') não é viável no que eu preciso.

Exemplo:
var display = $('.test').get('display').val()
        if(display == 'block')
        {
            alert('block');
        }

A:
var display = document.querySelector('.sua_classe').style.display;
if(display == 'block')
{
    alert('block');
}

A: Sim, você pode usar css para ler as propriedades computadas de um objeto, exemplo: $('#id').css('background-color');
Referência: http://api.jquery.com/css/

console.log($('#div1').css('display'));
console.log($('#div2').css('display'));
console.log($('.divClass').css('border'));
#div1 {
  display: inline;
  background-color: red;
  width: 50px;
  height: 50px
}

#div2 {
  display: inline-block;
  background-color: blue;
  width: 50px;
  height: 50px;
}

.divClass {
   border: solid 1px #000
}


text:
Q: Resize issue in Windows form application in 2560x1600 resolution display I have a form application working fine on various displays with varying screen resolution but in a machine with 2560x1600 resolution it shrinks to a very small size.
It works fine all smaller resolution and i am not able to find a reason behind it. I have used anchor, docking, autoscalemode and various other properties still it fails only in this above mentioned screen resolution

A: You can resize the window on startup, for example:
private void Form1_Load(object sender, EventArgs e) {
    Size = new Size(Screen.PrimaryScreen.WorkingArea.Right / 2, Screen.PrimaryScreen.WorkingArea.Bottom / 2);
}

That's the example only. You have to modify the above code to ensure you are finding the right screen and the right coordinantes.


text:
Q: .NET Core MVC com jQuery Vertical Accordion Menu Estou usando o menu accordion vertical do jQuery do seguinte template: https://templatemag.com/demo/Dashio/ No entanto, a operação não funciona como nele.
Clicando em um menu
<li> <a asp-area="" asp-controller="PaymentMethods" asp-action="Index"> List </a> </li>

Ele não permanece aberto e não altera a classe do link para indicar que ele foi clicado. Alguém pode me dizer o porquê?

A: Segue o trecho:
$(function() {
  $('#nav-accordion').dcAccordion({
    eventType: 'click',
    autoClose: true,
    saveState: true,
    disableLink: true,
    speed: 'slow',
    showCount: false,
    autoExpand: true,
    //        cookie: 'dcjq-accordion-1',
    classExpand: 'dcjq-current-parent'
  });
});


text:
Q: use of ntp service I'm developing an app that needs to control real time in any location on the Earth and do something when time comes. At the same time not to rely on system time because user can easily change it.
Does anybody have an experience of implementing "sntp/ntp" service on android device or is there any other solution to do it?
Thanks

A: Check out the SNTP client code at:
https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/net/SntpClient.java


text:
Q: @Index annotation in SDN4 Why there is an @Index annotation in SDN4 if it does not manage Neo4j indexes anymore? In SDN3 it was used to populate indexes in the database, but now, taking into account the documentation, it is not.

A: It shouldn't be there any more- it isn't used and will be removed.


text:
Q: Проблема при сохранении данных через Pool.map Как я понял после выполнения функции сохраняется только те данные которые идут от 1 процесса, а второй процесс не сохраняет данные.
import csv
import json
import time
from selenium import webdriver
from bs4 import BeautifulSoup as bs
from fake_useragent import UserAgent
from multiprocessing import Pool, cpu_count

All_players_list = list()

time_speed = time.time()
ua = UserAgent()
options = webdriver.ChromeOptions()
options.add_argument('--disable-blink-features=AutomationControlled')
options.headless = True
options.add_argument(f'user-agent={ua.random}')

with open('Test[2].csv', 'w', encoding='utf-8') as file:
    pass

with open('help_poop.html', 'r', encoding='utf-8') as file:
    All_clans = json.load(file)

def entry(players) -> dict:
    with open('Test[2].csv', 'a', encoding='utf-8') as file:
        writer = csv.writer(file)
        for keys, values in players.items():
            writer.writerow((keys, values))

def Parsing(url):
    time_speed_def = time.time()
    driver = webdriver.Chrome(executable_path=r'C:\Users\Костьян\Desktop\Projects\SELENIUM AND BS4\chromedriver.exe', options=options)
    try:
        driver.get(url)
        time.sleep(1)
        Website_code = driver.page_source
        Code_Website = bs(Website_code, 'lxml')
        driver.close()
        driver.quit()
        All_players = Code_Website.find(id='clanplayers').find('tbody').find_all('tr', role='row')
        sorted_players_statistics = {}
        for players_statistics in All_players:
            player_statistic = players_statistics.find_all('td')
            if int(player_statistic[3].text.replace(' ', '')) < 16001:
                sorted_players_statistics[player_statistic[3].text.replace(' ', '')] = player_statistic[2].text
            else:
                entry(sorted_players_statistics)
                break
        print(f'Данные были скопированны с сайта[{url}] за {int(time.time()-time_speed_def)} секунд', f'№{All_clans.index(url)+1}')
    except Exception as ex:
        print(ex)

if __name__ == '__main__':
    with Pool(2) as p:
        p.starmap(Parsing, All_clans[0:5])
    print('Программа закончила свою работу за', int(time.time()-time_speed), 'секунд')


text:
Q: How to connect to MySQL on shared Host? I am web developer and i just wonder Why i can't connect to mysql database on almost all my website with command line (all of theme use cpanel) and when i saw that port 3306 is closed !!
How could i connect theme with mysql command ?
Why mysql port is shown closed ? How it work if it's port is closed ?
Is that something Cpanel do ?
my command is :

mysql -h remoteipaddress -u username -pmypassword -D mydatabase

A: Remote MySQL connections are disabled by default in cPanel servers because they are considered a potential security threat. Using the tools in the Web Host Manager (WHM) and the domain-level cPanel interface (usually http://domainname.com/cpanel) remote hosts can be added which the server allows to connect to the MySQL service.

A: I use SQLyog to connect to remote hosts. And this link - https://answers.syr.edu/display/ischool/Enable+Remote+MySQL+on+cPanel - gives the steps to connect to the MySQL database remotely when using cpanel.


text:
Q: set min and max value in js slot application I found this Jquery slots master and right now I want to add function.
When the button is pressed it shows 4 digit random numbers between 0001 to 9999.
but I want to set it's limit between 0001-9885
You can see this here
it says please add more details and I think I said enough...
HTML

1

9

8

7

6

5

4

3

2

0

    <input type="button" id="playFancy" value="Let's Roll" style="background: #ff6a00;  background-image: -webkit-linear-gradient(top, #ff6a00, #ee0979);  background-image: -moz-linear-gradient(top, #ff6a00, #ee0979);  background-image: -ms-linear-gradient(top, #ff6a00, #ee0979);  background-image: -o-linear-gradient(top, #ff6a00, #ee0979);  background-image: linear-gradient(to bottom, #ff6a00, #ee0979);  -webkit-border-radius: 13;  -moz-border-radius: 13;  border-radius: 13px;  font-family: Arial;  color: #ffffff;  font-size: 19px;  padding: 10px 20px 10px 20px;  text-decoration: none; background: #ee0979;  background-image: -webkit-linear-gradient(top, #ee0979, #ff6a00);  background-image: -moz-linear-gradient(top, #ee0979, #ff6a00);  background-image: -ms-linear-gradient(top, #ee0979, #ff6a00);  background-image: -o-linear-gradient(top, #ee0979, #ff6a00);  background-image: linear-gradient(to bottom, #ee0979, #ff6a00);  text-decoration: none;">

"jQueryjSlots.min.js"
(function(a){a.jSlots=function(c,b){var d=this;d.$el=a(c);d.el=c;    d.$el.data("jSlots",d);d.init=function(){d.options=a.extend({},a.jSlots.defaultOptions,b);d.setup();d.bindEvents();};a.jSlots.defaultOptions={number:3,winnerNumber:1,spinner:"",spinEvent:"click",onStart:a.noop,onEnd:a.noop,onWin:a.noop,easing:"swing",time:7000,loops:6};d.randomRange=function(e,f){return Math.floor(Math.random()*(1+f-e))+e;};d.isSpinning=false;d.spinSpeed=0;d.winCount=0;d.doneCount=0;d.$liHeight=0;d.$liWidth=0;d.winners=[];d.allSlots=[];d.setup=function(){var e=d.$el;var g=e.find("li").first();d.$liHeight=g.outerHeight();d.$liWidth=g.outerWidth();d.liCount=d.$el.children().length;d.listHeight=d.$liHeight*d.liCount;d.increment=(d.options.time/d.options.loops)/d.options.loops;e.css("position","relative");g.clone().appendTo(e);d.$wrapper=e.wrap('

').parent();d.$el.remove();for(var f=d.options.number-1;f>=0;f--){d.allSlots.push(new d.Slot());}};d.bindEvents=function(){a(d.options.spinner).bind(d.options.spinEvent,function(e){if(!d.isSpinning){d.playSlots();}});};d.Slot=function(){this.spinSpeed=0;this.el=d.$el.clone().appendTo(d.$wrapper)[0];this.$el=a(this.el);this.loopCount=0;this.number=0;};d.Slot.prototype={spinEm:function(){var e=this;e.$el.css("top",-d.listHeight).animate({top:"0px"},e.spinSpeed,"linear",function(){e.lowerSpeed();});},lowerSpeed:function(){this.spinSpeed+=d.increment;this.loopCount++;if(this.loopCount<d.options.loops){this.spinEm();}else{this.finish();}},finish:function(){var e=this;var g=d.randomRange(1,d.liCount);var f=-((d.$liHeight*g)-d.$liHeight);var h=((this.spinSpeed*0.5)*(d.liCount))/g;e.$el.css("top",-d.listHeight).animate({top:f},h,d.options.easing,function(){d.checkWinner(g,e);});}};d.checkWinner=function(f,g){d.doneCount++;g.number=f;if((a.isArray(d.options.winnerNumber)&&d.options.winnerNumber.indexOf(f)>-1)||f===d.options.winnerNumber){d.winCount++;d.winners.push(g.$el);}if(d.doneCount===d.options.number){var e=[];a.each(d.allSlots,function(h,i){e[h]=i.number;});if(a.isFunction(d.options.onEnd)){d.options.onEnd(e);}if(d.winCount&&a.isFunction(d.options.onWin)){d.options.onWin(d.winCount,d.winners,e);}d.isSpinning=false;}};d.playSlots=function(){d.isSpinning=true;d.winCount=0;d.doneCount=0;d.winners=[];if(a.isFunction(d.options.onStart)){d.options.onStart();}a.each(d.allSlots,function(e,f){this.spinSpeed=0;this.loopCount=0;this.spinEm();});};d.onWin=function(){if(a.isFunction(d.options.onWin)){d.options.onWin();}};d.init();};a.fn.jSlots=function(b){if(this.length){return this.each(function(){(new a.jSlots(this,b));});}};})(jQuery);

"jQueryEasing1.3.js"
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
    //alert(jQuery.easing.default);
    return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
    return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
    return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return c/2*t*t + b;
    return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
    return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
    return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return c/2*t*t*t + b;
    return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
    return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
    return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
    return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
    return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
    return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
    return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
    return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
    return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
    return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
    return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
    if (t==0) return b;
    if (t==d) return b+c;
    if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
    return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
    return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
    return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
    return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
    var s=1.70158;var p=0;var a=c;
    if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
    if (a < Math.abs(c)) { a=c; var s=p/4; }
    else var s = p/(2*Math.PI) * Math.asin (c/a);
    return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
    var s=1.70158;var p=0;var a=c;
    if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
    if (a < Math.abs(c)) { a=c; var s=p/4; }
    else var s = p/(2*Math.PI) * Math.asin (c/a);
    return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
    var s=1.70158;var p=0;var a=c;
    if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
    if (a < Math.abs(c)) { a=c; var s=p/4; }
    else var s = p/(2*Math.PI) * Math.asin (c/a);
    if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
    return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
    if (s == undefined) s = 1.70158;
    return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
    if (s == undefined) s = 1.70158;
    return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
    if (s == undefined) s = 1.70158;
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
    return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
    if ((t/=d) < (1/2.75)) {
        return c*(7.5625*t*t) + b;
    } else if (t < (2/2.75)) {
        return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
    } else if (t < (2.5/2.75)) {
        return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
    } else {
        return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
    }
},
easeInOutBounce: function (x, t, b, c, d) {
    if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
    return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}

});

A:

function myFunction() {
    var x = document.getElementById("demo")
    x.innerHTML = Math.floor((Math.random() * 8556) + 1);
}
<!DOCTYPE html>

Click the button to display a random number between 1 and 8556.

<button onclick="myFunction()">Try it</button>

Math.floor((Math.random() * 9885) + 1);

Not sure if this is what you are looking for.
Hope this helps
-https://www.w3schools.com/jsref/jsref_random.asp


text:
Q: How to create a regex for a Notepad++ search over a range of integers in a CSV file rows I have a have CSV file containing entries with ranges like [12, 22[ that I want to replace with ranges like [12; 22[.
What is the regex to use in Notepad++ in this case ?
sample row of my dataset:
1,2,[21, 30[,......
4,3,[22, 32[,......
...

A: *

*Ctrl+H

*Find what: \[\d+\K,(?=\h*\d+\[)

*Replace with: :

*CHECK Wrap around

*CHECK Regular expression

*Replace all
Explanation:
\[      # open square bracket
\d+     # 1 or more digits
\K      # forget all we have seen until this position
,       # a comma
(?=     # positive lookahead, make sure we have after:
  \h*     # 0 or more horizontal spaces
  \d+     # 1 or more digits
  \[      # open square bracket
)       # end lookahead

Screenshot (before):

Screenshot (after):


text:
Q: starting multiple activities in chain Hello android developers
I have three Activities, which are started in some kind of chain.
Activity A -> has start button,which starts Activity B.
Activity B ->
cancel button,which returns back to Activity A.
And capture button,which starts activity C with some data.
Activity C ->
retake button,which returns back to  Activity B
use,which must resume activity A with some data.
My question is which is correct way to start these activities in chain,and how can I maintain flow from Activity C to A.

A: Intents are the best way to move from one activity to other Activity.Code
public void onClick(View v)
{
    Intent myIntent = new Intent(A.this, B.class);
        startActivityForResult(myIntent, 0);
}

A: You can start activity C from Activity B as startActivityForResult(intent,requestCode). While returning back from activity C to B get results implemet onActivityResult.
You can do same workflow for C to A and wise-versa.
Refer this

A: Activity A -> has start button,which starts Activity B.
Start new Activity like
Intent myIntent = new Intent(A.this, B.class);
        startActivityForResult(myIntent);

Activity B -> cancel button,which returns back to Activity A. And capture button,which starts activity C with some data.
On cancel button you can simply call finish() , and on capture button you can start new activity C .
Activity C -> retake button,which returns back to Activity B use,which must resume activity A with some data.
on retake button you can call finish() , and if  you want to get some input from Activity A  then you should call StartActivityForResult(1212) and Receive that code in onActivityResult  make the operation that you want in it and finish()  Activity A when you  done , it will autonetically redirect to Activity C , in Activity C's onResume() you can able to retrieve that data value .


text:
Q: How to change the correct answer text to green while changing the wrong answer text color to red I have a TextView and a radio group with four radio buttons in a ListView. when user select the radio button the text color changes to green if answer is correct and if answer is wrong text color changes to red which is working perfectly but I want if answer is wrong it also changes the correct answer text to green.
    if (opt1.getText.toString.equals(correctans)) {
                opt1.setTextColor(getResources().getColor(R.color.correct_ans));
                iv_optA.setImageResource(R.drawable.correctans);
                iv_optB.setImageResource(R.drawable.dontknowans);
                iv_optC.setImageResource(R.drawable.dontknowans);
                iv_optD.setImageResource(R.drawable.dontknowans);

            } else {
                opt1.setTextColor(getResources().getColor(R.color.wrong_ans));
                iv_optA.setImageResource(R.drawable.wrongans);
                iv_optB.setImageResource(R.drawable.dontknowans);
                iv_optC.setImageResource(R.drawable.dontknowans);
                iv_optD.setImageResource(R.drawable.dontknowans);
            }

A: I solved it myself.
    String opt_1 = opt1.getText().toString();
    if (opt_1.equals(correctans)) {
                opt1.setTextColor(getResources().getColor(R.color.correct_ans));
                iv_optA.setImageResource(R.drawable.correctans);
            } else {
                opt1.setTextColor(getResources().getColor(R.color.wrong_ans));
                iv_optA.setImageResource(R.drawable.wrongans);
                if (opt_1.equals(correctans))
                    opt1.setTextColor(Color.BLUE);
                if (opt_2.equals(correctans))
                    opt2.setTextColor(Color.BLUE);
                if (opt_3.equals(correctans))
                    opt3.setTextColor(Color.BLUE);
                if (opt_4.equals(correctans))
                    opt4.setTextColor(Color.BLUE);
            }


text:
Q: pandas count regex matches and groupby I am looking for a way to extract the most frequent hashtags (per user and in total) from a DataFrame containing user names and twitter texts. The twitter texts can contain hashtags.
           username tweet_id    created_at  text    in_reply_to_tweet_id    in_reply_to_user    retweet_count   favorite_count
    0   mmitchell_ai    1506357982061158401 2022-03-22 19:51:44+00:00   What does it mean to "sanction" Google? What a...   NaN NaN 1   12
    1   mmitchell_ai    1506357632793149441 2022-03-22 19:50:21+00:00   RT @SanhEstPasMoi: @ClementDelangue @aurelieng...   NaN NaN 1   0

See example data above.
I am able to get the overal occurence of each hashtag as follows
import re

df.text.str.extractall(r'(\#\w+)')[0].value_counts()

but I am not able to group the result by user name.

A: You are close. You missed to join the result to your original dataframe:
hashtags = df['text'].str.extractall(r'(?P<hashtag>\#\w+)').droplevel(1)
out = df[['username']].join(hashtags).value_counts()
print(out)

# Output
username      hashtag
mmitchell_ai  #hashtag2    2
              #hashtag1    1
              #hashtag3    1
dtype: int64

Input data:
>>> df
       username                                     text
0  mmitchell_ai  blah blah #hashtag1 blah #hashtag2 blah
1  mmitchell_ai       blah #hashtag3 blah blah #hashtag2


text:
Q: C# - Filtering form objects (e.g. textbox) for times How in C# forms can you filter (for example a textbox) in the following format (for time)
XX:XX
24 hour clock

A: Have a look at the System.Windows.Forms.MaskedTextBox control.


text:
Q: Selecting sentences in HTML body having a specific charachter in java using regex I have an html page. I want to extrac the text within only those tags that have a question mark at the end of their sentence/text. I using:
<.+?>(.+?)<.+?>

To get the text inside tags. but there are two problems with this: 1- All the nested tags are also extracted which I don't want.(I just want plain text) 2-I only want to get those text within tags that have a question mark at the end.
I don't know how to do this. Can someone help me please(in Java).
PS: the html pages that I have are malformed, therefore, using tools such as JSoup is not a choice. That's why I am using regex only.

A: Detecting the nesting and not matching it is difficult or impossible if you have unlimited nesting, but you can try this:
<(.+?)>(.+?\?)</$1>

It matches tags that close again and only with a question mark at the end.
See on rubular

A: Have you a good reason to use regular expressions?
You can analyse your html code yourself. Perhaps it is faster... Here a small solution if you don't have any tag inside <mytag?> and </mytag?>
    final LinkedList<String> chunks = new LinkedList<String>();

    final String text = "<i>italic</i><mytag?>text</mytag?><href>anchor</href> <mySecondTag?>word</mySecondTag?>";

    String rest = text;
    int pos;
    while ( (pos = rest.indexOf("?>") )!=-1)
    {
        final int endTag = rest.indexOf("<", pos);
        chunks.add(rest.substring(pos+2, endTag));
        rest = rest.substring(rest.indexOf(">", endTag+1)+1);
    }

    System.out.println(chunks);


text:
Q: validation of radiobuttonlist in asp.net using javascript i have to validate a radio button using javascript. it should show a message if none of the option is selected.
my radio button code is:
<asp:RadioButtonList ID="welldata" runat="server" RepeatDirection="Horizontal" Width="100px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:RadioButtonList>

and the submit button is:
<asp:Button ID="next2" runat="server" Text=">>" Width="46px"
        OnClientClick="return next2()"/>

the corresponding javascript function is :
        function next2() {

        var listItemArray = document.getElementById('<%=welldata.ClientID %>');
        var isItemChecked = false;
        var length1 = listItemArray.length;

        for (var i=0; i<length1; i++)
          {
              var listItem = listItemArray[i];
              document.write(listItem);

             if ( listItem.checked )
                 {
               alert(listItem.value);
               isItemChecked = true;
                 }
           }

            if ( isItemChecked == false )
              {
              alert('Nothing is checked for welldata!');

              return false;
                 }

             return true;
    }

while debugging i noticed thaat function is executed but doesn't enter the for loop.
also i tried
        document.write(isItemChecked);
        document.write(listItemArray);
        document.write(length1);

and the output was :

false [object HTMLTableElement] undefined

A: You are using a RadiobuttonList which is rendered as table per default. If you select the dom element by id document.getElementById('<%=welldata.ClientID %>') then you are selecting the table and not the RadioButtonList. If you want to select the radio buttons then you have to loop through the childNodes of listItemArray to get the radio buttons. Alternatively you could use jquery to select the radio buttons, as their ids will start with the id of your radio button list (they will look like welldata_0 or welldata_1).
This line of jquery code will get the your radio buttons
var listItemArray = $("input[id^='welldata']")

A: The wellData RadioButtonList ASP.NET server control will render in the browser as a table with a number of input type="radio" controls under it, each with the same name.
So, you need to get the input tags inside the table tag first:
var wellData = document.getElementById('<%=welldata.ClientID %>');
var listItemArray = wellData.getElementsByTagName('input');

This is, of course, if you are doing this manually for some odd reason. You can do it automatically with a RequiredFieldValidator control.
<asp:RadioButtonList ID="welldata" runat="server" RepeatDirection="Horizontal" Width="100px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="rfvWellData" runat="server" ControlToValidate="wellData" Display="Dynamic" ErrorMessage="Pick yourself some well data" />

A: Try this:
function next2() {

        if(document.getElementById('<%=welldata.ClientID %>').checked==false)
{
alert('Nothing is checked for welldata!');
return false;
}
return true;
}
                   or

Use RequiredFieldValidator
<asp:RequiredFieldValidator
            ID="ReqiredFieldValidator1"
            runat="server"
            ControlToValidate="welldata"
            ErrorMessage="Select your welldata!"
            >

Check these below links
http://asp-net-example.blogspot.in/2009/02/aspnet-requiredfieldvalidator-example.html
http://www.itechies.net/tutorials/jscript/jsexample.php-pid-jform.htm#rb
http://www.codeproject.com/Questions/499602/RequiredplusFieldplusValidatorplusForplusRadioplus

A: var rblItems = document.getElementById('<%=radioBtnListId.ClientID %>').getElementsByTagName('input');

var checkedItems = true;
for (var i = 0; i < rblItems.length; i++) {
    if (rblItems[i].checked) {
        checkedItems = true;
        break;
    }
    else {
        checkedItems = false;
    }
}

if (!checkedItems) {//Hence No items checked
   alert("Nothing is checked");
   return false;
}


text:
Q: Android Activity indicator with bar style How can i implement an activity indicator with bar style. As according to the following documentation http://developer.android.com/design/building-blocks/progress.html "Activity indicators are for operations of an indeterminate length." and "Two styles are available: a bar and a circle. Each is offered in a variety of sizes, in both Holo Light and Holo Dark themes."  that's fine but where can i get example of that... i really tried a lot but not able to find any single example. In short i just want to use the following activity indicator as shown in image.

plus i want to use this Activity indicator in notification as already shown in above image to show some progress if you can guide or provide example same as according to my scenario then it'll be much better but at least guide me how can i show this view in my layout.

A: After further search at last i found the answer...
from xml
 <ProgressBar
    android:id="@+id/progressBar1"
    style="@android:style/Widget.Holo.ProgressBar.Horizontal"
    android:layout_width="100dp"
    android:layout_height="wrap_content"
    android:indeterminate="true" />

from java you can simply set mode to indeterminate by using method
((ProgressBar) findViewById(R.id.progressBar1)).setIndeterminate(true);

Actually the name Activity Indicator is confusing and other confusion in my mind was that the progressbar is different from the activity indicator but in actual both are same... only the difference is of their mode.

A: try some thing like this.
ProgressDialog progressBar = new ProgressDialog(v.getContext());
progressBar.setMessage("File downloading ...");
progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressBar.setProgress(0);
progressBar.setMax(100);
progressBar.show();

I think this will help you.

A: you can use Smmothprogressbar  github
its is as per your requirement


text: Q: Git merge not "merging" So while trying to merge my branch with main, a conflict resulted in bash/alx which I'm supposed to resolve and successfully did. However when I used the checker, it says there's a problem with bash/school, and I tried to merge again but it says "already up to date". I then checked github and realized the change in the file "school" in the branch was not reflected in main. So how do i solve this when git keeps saying "up to date"?


text:
Q: angular polymer if else condition for div element i have polymer template in which i have 3 divs . i want to keep condition on based on name m fetching in expression. How to keep condition for the same.
code is below:

    {{item.id.optnName}}

    {{_toMoneyFormat(item.optnCtd)}}

    {{_toMoneyFormat(item.optnGoFwd)}}

    {{_toMoneyFormat(item.optnTotal)}}

I need to keep check on item.id.optnName . If it contains KEFH then it should remove _toMoneyFormat function from span.
plz review .

A: use ng-if in your div. Here i create a simple ng-if example
plnkr here
for more information read AngularJS/ng-if doc


text:
Q: Convert integer to categorical vector of fixed size in Python I have a set of N integers with the range of values to be from 1-6. I would like to produce the corresponding categorical vector of size 6 per each integer (therefore an array of size Nx6) which will be the categorical representation of my initial set. In the case that my integer will be 1 the result should be:
[1, 0, 0, 0, 0, 0]

While for 6:
[0, 0, 0, 0, 0, 1]

And etc..

A: You could use a simple list comprehension:
>>> x = 1
>>> [int(i+1 == x) for i in range(6)]
[1, 0, 0, 0, 0, 0]

>>> x = 6
>>> [int(i+1 == x) for i in range(6)]
[0, 0, 0, 0, 0, 1]

Likewise for an Nx6 list of lists:
>>> X = [4,1,5]
>>> [[int(i+1 == x) for i in range(6)] for x in X]
[[0, 0, 0, 1, 0, 0],
 [1, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 1, 0]]

A: If you are happy to use a 3rd party library, this can be achieved efficiently with NumPy:
import numpy as np

np.random.seed(0)

m, n = 6, 10
L = np.random.randint(1, m+1, n)  # construct array of 10 numbers between 1 and 6

A = np.zeros((n, m))              # initialize array of zeros
A[np.arange(n), L-1] = 1          # use advanced indexing to assign values

The result is a NumPy array which you can then index via A[0], A[1], etc.
print(A)

array([[ 0.,  0.,  0.,  0.,  1.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  1.],
       [ 1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  1.],
       [ 0.,  0.,  1.,  0.,  0.,  0.]])

A: You can use numpy.fill_diagonal to fill diagonals with value of your need:
import numpy as np

a = np.zeros((6, 6), int)
np.fill_diagonal(a, 1)

print(a)

Output:
[[1 0 0 0 0 0]
 [0 1 0 0 0 0]
 [0 0 1 0 0 0]
 [0 0 0 1 0 0]
 [0 0 0 0 1 0]
 [0 0 0 0 0 1]]

Now, if your integer is 1, use a[0],... for 6, use a[5].
Eg:
input_integer = 1
print(a[input_integer-1])

# [1 0 0 0 0 0]


text:
Q: Convert a JSON object to a STRUCT Is it possible to do something like the following in BigQuery:
SELECT CAST(JSON '{"x": 3}' AS STRUCT<x INT>)

Or basically, how do I get json data into a typed value? I was hoping I could do:
SELECT AS STRUCT STRUCT(3 as x, 4 as y).*

But even that gives me:
SELECT AS STRUCT JSON '{"x": 3}'.*

Dot-star is not supported for type JSON at [1:18]. The closest I've gotten is with a manual specification:

WITH json AS (
  SELECT JSON '{"x": 3, "y": true}' val
) SELECT STRUCT(json.val.x AS INT64, json.val.y AS BOOL) FROM json

A: I'm not sure this would work, but this is what I would try:

*

*define the schema of your BigQuery table using JSON schema

*create a JavaScript user-defined function (UDF) whose input is the JSON string

*parse the JSON string in the JavaScript UDF


text:
Q: Equivalence of the Classical and Approximate Intermediate Value Theorems in Classical Logic IVT (Classical) Let $f:\left[a,b\right]\to\mathbb{R}$ be continuous. If $f\left(a\right)<0$ and $f\left(b\right)>0$, then there exists $c\in\left(a,b\right)$ such that $f\left(c\right)=0$.
In intuitionistic logic, there's no proof of the classical form of the Intermediate Value Theorem. However, there is an approximate form which can be proved in intuitionistic logic.
IVT (Approximate) Let $f:\left[a,b\right]\to\mathbb{R}$ be continuous. If $f\left(a\right)<0$ and $f\left(b\right)>0$, then, for any $\varepsilon>0$, there exists $c\in\left(a,b\right)$ such that $|f\left(c\right)|<\varepsilon$.
While IVT (Classical) and IVT (Approximate) are not equivalent in intuitionistic logic, they are in classical logic. Below is my attempt at a proof of this equivalence.
Proposition. IVT (Classical) is equivalent to IVT (Approximate) in classical logic.
Proof.
Let $f:\left[a,b\right]\to\mathbb{R}$ be continuous such that $f\left(a\right)<0$ and $f\left(b\right)>0$.
For any $\varepsilon>0$, the classical form immediately determines a $c\in\left(a,b\right)$ such that $|f\left(c\right)|=0<\varepsilon$.
On the other hand, suppose that, for all $\varepsilon>0$, we have that there exists $x\in\left(a,b\right)$ such that $|f\left(x\right)|<\varepsilon$. Then, we may define a sequence $\left(c_{N}\right)_{N\geq1}$ such that $|f\left(c_{N}\right)|<1/N$. Then, $|f\left(c_{N}\right)|\to0$ as $N\to0$.
Since $\left(c_{N}\right)_{N\geq1}$ is bounded below and above by $a$ and $b$, respectively, there is a convergent subsequence (Bolzano-Weierstrass). Since we may evaluate $f$ along a convergent subsequence, we may, without loss in generality, assume $c_{N}\to c\in\left(a,b\right)$.
Therefore, $|f\left(c_{N}\right)|\to|f\left(c\right)|$, and so we have a $c\in\left(a,b\right)$ such that $f\left(c\right)=0$, as required.
QED
Is my proof correct?


text:
Q: Check if user is authenticated for the first time with Firebase phone Authentication in Android I need to detect and differentiate two users using Firebase phone authentication. This should be done before granting a privilege to enter into the home activity of the app. When I did as suggested here (Stackoverflow), it does well by detecting the user using timeStamp() method. The answer does its job but the fancy thing is I need some data input from the new user before the verification code is sent.
In order for a verification code to be sent, a user provides a number which is directly authenticated in the firebase. Hence I cannot check if it's a new user (phone number) or current user (phone number).
Here is the code using TimeStamp() method.
private void signInWithPhoneAuthCredential(PhoneAuthCredential credential)
{
    _firebaseAuth.signInWithCredential(credential).addOnCompleteListener(Objects.requireNonNull(getActivity()), task ->
    {
        if(task.isSuccessful())
        {
            //Sign in success, update UI with the signed-in user's information.
            FirebaseUser _user = Objects.requireNonNull(task.getResult()).getUser();
            long creationTimestamp = Objects.requireNonNull(Objects.requireNonNull(_user).getMetadata()).getCreationTimestamp();
            long lastLoginTimestamp = Objects.requireNonNull(Objects.requireNonNull(_user).getMetadata()).getLastSignInTimestamp();

            if(creationTimestamp == lastLoginTimestamp)
            {
                //Create a new user with account
                setUserDataToDatabase(_user, _username, _university, _course, _year);
                sendUserToWelcome();
            }
            else
            {
                //User exists, just login
                sendUserToHome();
            }
        }
        else
        {
            FancyToast.makeText(getContext(), "Enter sent code", FancyToast.LENGTH_SHORT, FancyToast.INFO, false).show();
        }
    });
}

A: After several research with no success. I decided to walk around, I'm using firestore database. I decided to track every user's number in a new collection with auto-generated document id. I called the collection USERS whereas each document has a unique random id.
I get the user's number and check it if any of the registered user has that number with the USERS's collection using a whereEqualTo() method with the phone_number field. If the number is exists I login the user else display a registration screen.
 _firestore.collection(USERS).whereEqualTo("phone_number", _phoneCheck).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>()
                    {
                        @Override
                        public void onComplete(@NonNull Task<QuerySnapshot> task)
                        {
                            if(task.isSuccessful())
                            {
                                //If task is greater than 0 means there is a presence of a phone number.
                                if(Objects.requireNonNull(task.getResult()).size() > 0)
                                {

                                //Here I allow user to login as usual.
                                PhoneAuthOptions options = PhoneAuthOptions.newBuilder(_firebaseAuth).setPhoneNumber(_phone).setTimeout(60L, TimeUnit.SECONDS).setActivity(Objects.requireNonNull(getActivity())).setCallbacks(_callbacks).build();
                                PhoneAuthProvider.verifyPhoneNumber(options);
                                }
                            }
                            else
                            {
                                //Else the task is empty means there is no a presence of a phone number.

                                //Check if there is a presence of registration data to bind with new user.
                                if(_registrationData != null)
                                {

                                    //I login user with the new data and save the information into the firestore plus the phone number.
                                    PhoneAuthOptions options = PhoneAuthOptions.newBuilder(_firebaseAuth).setPhoneNumber(_phone).setTimeout(60L, TimeUnit.SECONDS).setActivity(Objects.requireNonNull(getActivity())).setCallbacks(_callbacks).build();
                                    PhoneAuthProvider.verifyPhoneNumber(options);
                                    userInputs();
                                }
                                else
                                {
                                    //Display a welcome a screen to register an account.
                                    FancyToast.makeText(getContext(), "Welcome! Open an account", FancyToast.LENGTH_SHORT, FancyToast.INFO, false).show();
                                }
                            }
                        }
                    }
                });

Allowing unauthenticated user to have a privilege into the database is very risk. Hence, I implemented a rule to allow unauthenticated user to read only.
match /USERS/{document=**}
{
    allow read: if true;
}

Though this still is risky, any rule suggestions I will be grad and appreciable.


text:
Q: How do I enable Terminal's color highlighting in OS X for root? I've added the following lines to my .bash_profile at /Users/[my username] :
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

And it works fine. However, when I did the same for root's .bash_profile at /var/root it doesn't work. Any ideas why this doesn't work for root?
Thanks.

A: You can toss those into ~/.profile or source the relevant file from ~/.profile inside the home directory for the root user, and then log in via sudo su - to simulate a full login. It works for me on BASH on Snow Leopard.
As a side note, I define the alias, alias ls='ls -G', in my .bashrc files to enable colour output for ls.

A: Put the following into the /var/root/.bashrc file:
export PS1="\[\033[03;31m\][\u@\h\[\033[03;37m\] \W \[\033[03;31m\]]\\$ \[\033[00m\]"
alias grep='grep --color'
export CLICOLOR='yes'
TERM=xterm-color

Being root, type the following:
chsh -s /bin/bash

Exit and 'sudo su' back to root.


text:
Q: Annotating a candlestick chart with matplotlib I am trying to "annotate" a candlestick chart with matplotlib, but I'm having a hard time finding the coordinates for each candle in order to annotate. For example I would like to write a number above or below a particular candle ..
Any idea on how to proceed ?
thanks !

A: It would be better if you at least gave some indication which approaches you have already tried.
If we take the example in the documentation http://matplotlib.sourceforge.net/examples/pylab_examples/finance_demo.html and add the line:
import datetime
dt = datetime.datetime(2004, 3, 8)

ax.annotate('A bad day at the office', xy=(dt, 24), xytext=(dt, 25),
            arrowprops=dict(facecolor='black', shrink=0.05),
           )

Just before the show, does that achieve what you are asking?


text:
Q: How do I override __type__ method in python object? I create a Python class for some mathematical calculations. In that object, I am trying to change type(type) methods result. And my attempts failed.
When I try type() method for my object that appears
<class '__main__.MyClassName'>
I override type method in my method :
class MyMathOBJ():
.
.
.
    def __type__(self):
        return "MyMathOBJ"

But when I do that nothing changed. The same result. I was expecting just that result MyMathOBJ.

A: You seem to fundamentally misunderstand what type does. type itself is just a class, a metaclass. When you call type on an instance, it returns the class object that corresponds to that instance, pretty much equivalent to instance.__class__. However, you simply want to change the way the class object is represented when you print it, so you'd need to implement a metaclass for MyMathOBJ that overrides __repr__ in the metaclass to accomplish this.
Here is how you accomplish what you are actually trying to do:
In [12]: class PrettyType(type):
    ...:     def __repr__(self):
    ...:         return self.__name__
    ...:

In [13]: class MyMathOBJ(metaclass=PrettyType):
    ...:     pass
    ...:

In [14]: obj = MyMathOBJ()

In [15]: obj
Out[15]: <MyMathOBJ at 0x1060cbcc0>

In [16]: type(obj)
Out[16]: MyMathOBJ


text:
Q: Adding a field to tx_news is causing template not found error I'm trying to add a thumbnail field to tx_news file records but when I do try use the new field I get an error.
These are the steps I've taken,

Added the column to sql

Add the new field to the tx_news_domain_model_file tca

I now have the new field in my news file record.

Then I added my thumbnail stuff to Classes/Domain/Model/File.php. Then I use the new variable in my template {relatedFile.thumbnail}

This is the error I now get on the frontend when I view a single news. The news display works when I remove the new field.
I am using Typo3 6.1 with:

*

*Fluidpages 2.1.0

*Fluidcontent 3.1.0

*Flux 6.0.3

*VHS 1.8.5

A: You are just seeing the error message about not finding a template to display the real error message. Without the real error message, it is impossible to help you.
Did you clear all caches (install tool) or truncated the extbase reflection and the fluid rendering caches? To be sure, also clear typo3temp/Cache/*.


text:
Q: auto deploying static nuxt js project with github action Hi i created a repository with the same name of my github account called mortezasabihi. and in this repository i pushed my personal website (nuxtjs static) to it and created github action for autodeployment, but I don't know why my github page URL is this:

I want to be https://mortezasabihi.github.io.
this is my gh action:

name: cd

on: [push, pull_request]

jobs:
  cd:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]
        node: [14]

    steps:
      - name: Checkout
        uses: actions/checkout@master

      - name: Setup node env
        uses: actions/setup-node@v2.1.2
        with:
          node-version: ${{ matrix.node }}

      - name: Install dependencies
        run: yarn

      - name: Generate
        run: yarn run generate

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist

what's wrong? I didn't understand!

A: The own action-gh-pages documentation allows you to configure many things inside your workflow file.
You can have one site published to https://<username>.github.io by publishing to the master (or main) branch of a repository named "username.github.io" (substituting your actual username), as explained here.
You can also have an additional site per GitHub project published to https://<username>.github.io/<project> (which seems to be what you did here using your username profile repository).
Project sites will publish whatever you push to the gh-pages branch by default, but you can change the publishing source in the repository settings.
Another description is available in the GitHub Pages documentation, including options for using custom domain names.

A: I have my personal website on Github pages too, and use this strategy:
I create a branch named development and working on that branch.
Based on Nuxt documentation, I add some script in my package.json file:
"scripts": {
    "dev": "nuxt",
    "generate": "nuxt generate",
    "start": "nuxt start",
    "deploy": "push-dir --dir=dist --branch=master --cleanup"
},

and when running these commands, the dist folder automatically will be pushed to master.
npm run generate
npm run deploy


text:
Q: CopyField issue on Solr4.1 I am using Solr 3.6.1 and I am very satisfied. Now I want to move on solr4.1. So I took "schema.xml" and "solrconfig.xml" (with minor changes) and place them under my new solr4.1 configuration. The indexing was successful (DIH). But, I have noticed an issue. In "schema.xml" I have "copyField" directives in order to index same fields using different "types". When I try to index using the same configuration on solr4.1, the index size is the half of the index size on solr3.6.1 (and when I query I get different results). Has anything changed on Solr4.1? I need little help on this.
The schema.xml:
<?xml version="1.0" encoding="UTF-8" ?>

<schema name="areios_pagos" version="1.5">
  <types>
    <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
    <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
    <!-- boolean type: "true" or "false" -->
    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
    <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
    <fieldtype name="binary" class="solr.BinaryField"/>
    <!--
      Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
    -->
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>

    <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>

    <fieldType name="pint" class="solr.IntField"/>
    <fieldType name="plong" class="solr.LongField"/>
    <fieldType name="pfloat" class="solr.FloatField"/>
    <fieldType name="pdouble" class="solr.DoubleField"/>
    <fieldType name="pdate" class="solr.DateField" sortMissingLast="true"/>

    <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>

    <fieldType name="random" class="solr.RandomSortField" indexed="true" />

    <!-- Greek -->
    <fieldType name="text_el" class="solr.TextField" positionIncrementGap="1000">
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <!-- greek specific lowercase for sigma -->
        <filter class="solr.GreekLowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
        <filter class="solr.GreekStemFilterFactory"/>
      </analyzer>
    </fieldType>

    <!-- THIS IS FOR TIKA-PDF -->
    <fieldType name="text" class="solr.TextField" positionIncrementGap="1000">
        <analyzer type="index">
            <charFilter class="solr.HTMLStripCharFilterFactory"/>
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.GreekLowerCaseFilterFactory"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
            <filter class="solr.GreekStemFilterFactory"/>
            <!--<filter class="solr.HunspellStemFilterFactory" dictionary="dictionaries/el_GR.dic" affix="dictionaries/el_GR.aff" ignoreCase="true" />-->
        </analyzer>
        <analyzer type="query">
            <charFilter class="solr.HTMLStripCharFilterFactory"/>
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.GreekLowerCaseFilterFactory"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
            <filter class="solr.GreekStemFilterFactory"/>
            <!--<filter class="solr.HunspellStemFilterFactory" dictionary="dictionaries/el_GR.dic" affix="dictionaries/el_GR.aff" ignoreCase="true" />-->
        </analyzer>
    </fieldType>

    <!-- THIS FIELDTYPE IN CONJUNCTION WITH THE COPYFIELD DEFINITION
         HELPS FOR TERMS RELEVANCY
    -->
    <fieldType name="text_areios_pagos_s" class="solr.TextField" positionIncrementGap="100" >
        <analyzer type="index">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="20"/>
            <filter class="solr.GreekLowerCaseFilterFactory"/>
            <!-- <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="100"/> -->
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="20"/>
            <filter class="solr.GreekLowerCaseFilterFactory"/>
            <!-- <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="100"/> -->
        </analyzer>
    </fieldType>
    <!-- END -->

    <fieldType name="text_areios_pagos" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.GreekLowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
        <filter class="solr.GreekStemFilterFactory"/>
        <!--<filter class="solr.HunspellStemFilterFactory" dictionary="dictionaries/el_GR.dic" affix="dictionaries/el_GR.aff" ignoreCase="true" />-->
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.GreekLowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
        <filter class="solr.GreekStemFilterFactory"/>
      </analyzer>
    </fieldType>

    <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />

    <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>

    <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>

    <fieldtype name="geohash" class="solr.GeoHashField"/>

    <fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
 </types>

 <fields>
  <field  name="ida" type="string" indexed="true" stored="true" multiValued="false"/>
  <field  name="solr_id" type="string" indexed="true" stored="true" multiValued="false"/>
  <field  name="apofasi_number" type="text_areios_pagos" indexed="true" stored="true" multiValued="true"/>
  <field  name="apofasi_date" type="text_areios_pagos" indexed="true" stored="true"/>
  <field  name="apofasi_tmima" type="text_areios_pagos" indexed="true" stored="true"/>
  <field  name="apofasi_taxonomy" type="text_areios_pagos" indexed="true" stored="true"/>
  <field  name="content" type="text_areios_pagos" indexed="true" stored="true" multiValued="true"/> <!-- SET "multiValued=true" IN ORDER TO "copyField" -->
  <field  name="type" type="string" indexed="true" stored="true"/>
  <field  name="model" type="string" indexed="true" stored="true" multiValued="false"/>
  <field  name="url" type="string" indexed="true" stored="true"/>
  <field  name="search_tag" type="text_areios_pagos" indexed="true" stored="true"/>
  <field  name="contentbin" type="text" indexed="true" stored="true" multiValued="true"/>
  <field  name="last_modified" type="string" indexed="true" stored="true"/>
  <field  name="title" type="text_areios_pagos" indexed="true" stored="true" multiValued="true"/>
  <field  name="grid_title" type="text_areios_pagos" indexed="true" stored="true"/>
  <field  name="contentS" type="text_areios_pagos_s" indexed="true" stored="true"/>
 </fields>

 <uniqueKey>solr_id</uniqueKey>
 <defaultSearchField>content</defaultSearchField>
 <solrQueryParser defaultOperator="AND"/>

   <copyField source="apofasi_number" dest="content" />
   <copyField source="apofasi_date" dest="content" />
   <copyField source="apofasi_tmima" dest="content" />
   <copyField source="apofasi_taxonomy" dest="content" />
   <copyField source="title" dest="content" />
   <copyField source="search_tag" dest="content" />
   <copyField source="contentbin" dest="content"/>
   <copyField source="content" dest="contentS" />

</schema>

The solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>

<config>

  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>

  <luceneMatchVersion>LUCENE_41</luceneMatchVersion>

  <dataDir>${solr.data.dir:}</dataDir>

  <directoryFactory name="DirectoryFactory"
                    class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>

  <indexConfig>

  </indexConfig>

  <jmx />

  <updateHandler class="solr.DirectUpdateHandler2">
  </updateHandler>

  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       Query section - these settings control query time things like caches
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <query>

    <maxBooleanClauses>2048</maxBooleanClauses>

    <filterCache class="solr.FastLRUCache"
                        size="2048"
                        initialSize="1024"
                        autowarmCount="512"
                        cleanupThread="true" />

    <queryResultCache class="solr.FastLRUCache"
                        size="2048"
                        initialSize="1024"
                        autowarmCount="512"
                        cleanupThread="true" />

    <documentCache class="solr.FastLRUCache"
                        size="2048"
                        initialSize="2048"
                        autowarmCount="512" />

    <fieldValueCache class="solr.FastLRUCache"
                        size="2048"
                        initialSize="512"
                        autowarmCount="512"
                        cleanupThread="true" />

    <enableLazyFieldLoading>true</enableLazyFieldLoading>

    <queryResultWindowSize>150</queryResultWindowSize>

    <queryResultMaxDocsCached>200</queryResultMaxDocsCached>

    <listener event="newSearcher" class="solr.QuerySenderListener">
      <arr name="queries">
        <lst>
          <str name="q">χρησικτησια νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΛΙΤΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
        <lst>
          <str name="q">νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΛΙΤΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
        <lst>
          <str name="q">χρησικτησια νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΙΝΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
      </arr>
    </listener>

    <listener event="firstSearcher" class="solr.QuerySenderListener">
      <arr name="queries">
        <lst>
          <str name="q">χρησικτησια νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΛΙΤΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
        <lst>
          <str name="q">νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΛΙΤΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
        <lst>
          <str name="q">χρησικτησια νομη</str>
          <str name="fq">apofasi_taxonomy:ΠΟΙΝΙΚΕΣ</str>
          <str name="sort">apofasi_date asc,ida desc,apofasi_tmima desc</str>
          <str name="start">0</str>
          <str name="rows">150</str>
        </lst>
      </arr>
   </listener>

   <useColdSearcher>false</useColdSearcher>

   <maxWarmingSearchers>2</maxWarmingSearchers>

  </query>

  <requestDispatcher>
    <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />
    <httpCaching never304="true" />
  </requestDispatcher>

  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
        <str name="config">data-config.xml</str>
    </lst>
  </requestHandler>

  <requestHandler name="/select" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="defType">edismax</str>
       <str name="qf">content contentS^10</str>
       <str name="pf">content^10 contentS^100</str>
       <str name="ps">100</str>
       <str name="echoParams">explicit</str>
       <int name="rows">150</int>
       <str name="sort">score desc</str>
       <str name="defType">edismax</str>
       <str name="qf">content contentS^10</str>
       <str name="pf">content^10 contentS^100</str>
       <str name="ps">100</str>
       <str name="wt">json</str>
       <str name="hl">true</str>
       <str name="fl">solr_id,ida,type,model,keywordlist,title,apofasi_taxonomy,apofasi_tmima,apofasi_date,grid_title</str>
       <str name="hl.fl">content,title</str>
       <str name="f.content.hl.alternateField">content</str>
       <str name="hl.maxAlternateFieldLength">800</str>
       <str name="hl.fragsize">800</str>
     </lst>
  </requestHandler>

  <requestHandler name="/update"
                  class="solr.XmlUpdateRequestHandler">
  </requestHandler>

  <requestHandler name="/update/javabin"
                  class="solr.BinaryUpdateRequestHandler" />

  <requestHandler name="/update/csv"
                  class="solr.CSVRequestHandler"
                  startup="lazy" />

  <requestHandler name="/update/json"
                  class="solr.JsonUpdateRequestHandler"
                  startup="lazy" />

  <requestHandler name="/update/extract"
                  startup="lazy"
                  class="solr.extraction.ExtractingRequestHandler" >
    <lst name="defaults">
      <str name="fmap.content">text</str>
      <str name="lowernames">true</str>
      <str name="uprefix">ignored_</str>
      <str name="fmap.Last-Modified">last_modified</str>
      <str name="captureAttr">true</str>
      <str name="fmap.a">links</str>
      <str name="fmap.div">ignored_</str>
    </lst>
  </requestHandler>

  <requestHandler name="/update/xslt"
                   startup="lazy"
                   class="solr.XsltUpdateRequestHandler"/>

  <requestHandler name="/analysis/field"
                  startup="lazy"
                  class="solr.FieldAnalysisRequestHandler" />

  <requestHandler name="/analysis/document"
                  class="solr.DocumentAnalysisRequestHandler"
                  startup="lazy" />

  <requestHandler name="/admin/"
                  class="solr.admin.AdminHandlers" />

  <!-- ping/healthcheck -->
  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
    <lst name="invariants">
      <str name="q">solrpingquery</str>
    </lst>
    <lst name="defaults">
      <str name="echoParams">all</str>
    </lst>
  </requestHandler>

  <!-- Echo the request contents back to the client -->
  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
    <lst name="defaults">
     <str name="echoParams">explicit</str>
     <str name="echoHandler">true</str>
    </lst>
  </requestHandler>

  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">textSpell</str>
    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="field">name</str>
      <str name="spellcheckIndexDir">spellchecker</str>
    </lst>
  </searchComponent>

  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="df">text</str>
      <str name="spellcheck.onlyMorePopular">false</str>
      <str name="spellcheck.extendedResults">false</str>
      <str name="spellcheck.count">1</str>
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>

  <searchComponent name="terms" class="solr.TermsComponent"/>

  <!-- A request handler for demonstrating the terms component -->
  <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
     <lst name="defaults">
      <bool name="terms">true</bool>
    </lst>
    <arr name="components">
      <str>terms</str>
    </arr>
  </requestHandler>

  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">string</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

  <!-- A request handler for demonstrating the elevator component -->
  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <str name="df">text</str>
    </lst>
    <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>

  <searchComponent class="solr.HighlightComponent" name="highlight">
    <highlighting>
      <fragmenter name="gap"
                  default="true"
                  class="solr.highlight.GapFragmenter">
        <lst name="defaults">
        </lst>
      </fragmenter>
      <fragmenter name="regex"
                  class="solr.highlight.RegexFragmenter">
        <lst name="defaults">
          <!-- slightly smaller fragsizes work better because of slop -->
          <int name="hl.fragsize">70</int>
          <!-- allow 50% slop on fragment sizes -->
          <float name="hl.regex.slop">0.5</float>
          <!-- a basic sentence pattern -->
          <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
        </lst>
      </fragmenter>
      <!-- Configure the standard formatter -->
      <formatter name="html"
                 default="true"
                 class="solr.highlight.HtmlFormatter">
        <lst name="defaults">
          <str name="hl.simple.pre"><shl></str>
          <str name="hl.simple.post"></shl></str>
        </lst>
      </formatter>

      <!-- Configure the standard encoder -->
      <encoder name="html"
               class="solr.highlight.HtmlEncoder" />

      <!-- Configure the standard fragListBuilder -->
      <fragListBuilder name="simple"
                       default="true"
                       class="solr.highlight.SimpleFragListBuilder"/>

      <!-- Configure the single fragListBuilder -->
      <fragListBuilder name="single"
                       class="solr.highlight.SingleFragListBuilder"/>

      <!-- default tag FragmentsBuilder -->
      <fragmentsBuilder name="default"
                        default="true"
                        class="solr.highlight.ScoreOrderFragmentsBuilder">
      </fragmentsBuilder>

      <fragmentsBuilder name="colored"
                        class="solr.highlight.ScoreOrderFragmentsBuilder">
        <lst name="defaults">
          <str name="hl.tag.pre"><![CDATA[
               <b style="background:yellow">,<b style="background:lawgreen">,
               <b style="background:aquamarine">,<b style="background:magenta">,
               <b style="background:palegreen">,<b style="background:coral">,
               <b style="background:wheat">,<b style="background:khaki">,
               <b style="background:lime">,<b style="background:deepskyblue">]]></str>
          <str name="hl.tag.post"><![CDATA[</b>]]></str>
        </lst>
      </fragmentsBuilder>

      <boundaryScanner name="default"
                       default="true"
                       class="solr.highlight.SimpleBoundaryScanner">
        <lst name="defaults">
          <str name="hl.bs.maxScan">10</str>
          <str name="hl.bs.chars">.,!?

</str>
        </lst>
      </boundaryScanner>

      <boundaryScanner name="breakIterator"
                       class="solr.highlight.BreakIteratorBoundaryScanner">
        <lst name="defaults">

          <str name="hl.bs.type">WORD</str>

          <str name="hl.bs.language">en</str>
          <str name="hl.bs.country">US</str>
        </lst>
      </boundaryScanner>
    </highlighting>
  </searchComponent>

  <queryResponseWriter name="json" class="solr.JSONResponseWriter">

    <str name="content-type">text/plain; charset=UTF-8</str>
  </queryResponseWriter>

    <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>

  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
    <int name="xsltCacheLifetimeSeconds">5</int>
  </queryResponseWriter>
  <admin>
    <defaultQuery>*:*</defaultQuery>

  </admin>

</config>

Regards,
Tom

A: Solr 4.1 maintains the stored fields in a compressed way that may explain the Index size reduction.
Also,
<copyField source="content" dest="contentS" />

Documentation @ http://wiki.apache.org/solr/SchemaXml#Copy_Fields

The copy is done at the stream source level and no copy feeds into another copy.

Having a copyfield as the source of copyfield tag does not work.
The copyfield source must be an actual field, which has some value and does no cascade.
You can also check http://lucene.472066.n3.nabble.com/does-copyField-recurse-td2450208.html
Does this work for you ??