text:
Q: Why is volley onErroResponse so useless? Why is Volleys errorResponse So useless?
It barely provides any information?
Bellow is a screen shot of the VolleyError object that it provides me.

It literally tell me nothing? I can explain cause and detailed Message till I go blue.
AM I just missing something or is there another place to find out why the request failed?
Because right now telling me ServerError doesn't help much.
[EDIT]
here is my code making the call:
public void Login(String mEmail, String mPassword) {
    HashMap<String, String> params = new HashMap<String, String>();
    params.put("grant_type", "password");
    params.put("username", "user@email.co.za");
    params.put("password", "123456");
    params.put("client_id","ManagementInterface");

     HashMap<String, String> headers = new HashMap<String, String>();
     headers.put("Accept", "application/json");
     headers.put("Content-Type", "application/x-www-form-urlencoded");

    GsonRequest<JsonObject> tokenRequest = new GsonRequest<JsonObject>(
            Request.Method.POST, "token", JsonObject.class, headers,
            params, new Response.Listener<JsonObject>() {
                @Override
                public void onResponse(JsonObject response) {
                    String Token = "";
                    onOkResponseHandle(Token);
                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    onErrorResponseHandle(error);
                }
            });

    Network.getInstance(this).addToRequestQueue(tokenRequest);
}

I am trying to replicate this request using volley:
Image***
GSONRequest Class:
 public class GsonRequest<T> extends Request<T> {
private final Gson gson = new Gson();
private final Class<T> clazz;
private final Map<String, String> headers;
private final Map<String, String> params;
private final Listener<T> listener;

/**
 * Make a GET request and return a parsed object from JSON.
 *
 * @param url
 *            URL of the request to make
 * @param clazz
 *            Relevant class object, for Gson's reflection
 * @param headers
 *            Map of request headers
 */
public GsonRequest(int method, String url, Class<T> clazz,
        Map<String, String> headers, Map<String, String> params,
        Listener<T> listener, ErrorListener errorListener) {
    super(method, Network.getFullUrl(url), errorListener);
    this.clazz = clazz;
    this.headers = headers;
    this.params = params;
    this.listener = listener;
}

/**
 * Recieves header
 *
 * @param method
 * @param url
 * @param clazz
 * @param params
 * @param listener
 * @param errorListener
 */
public GsonRequest(int method, String url, Class<T> clazz,
        Map<String, String> params, Listener<T> listener,
        ErrorListener errorListener) {
    super(method, Network.getFullUrl(url), errorListener);
    this.clazz = clazz;
    this.headers = new HashMap<String, String>();
    this.params = params;
    this.listener = listener;
}

/**
 * No params or headers
 *
 * @param method
 * @param url
 * @param clazz
 * @param listener
 * @param errorListener
 */
public GsonRequest(int method, String url, Class<T> clazz,
        Listener<T> listener, ErrorListener errorListener) {
    super(method, Network.getFullUrl(url), errorListener);
    this.clazz = clazz;
    this.headers = new HashMap<String, String>();
    this.params = new HashMap<String, String>();
    this.listener = listener;
}

@Override
public Map<String, String> getHeaders() throws AuthFailureError {
    return headers != null ? headers : super.getHeaders();
}

@Override
public Map<String, String> getParams() throws AuthFailureError {
    return params != null ? params : super.getParams();
}

    @Override
protected void deliverResponse(T response) {
    listener.onResponse(response);
}

@Override
protected Response<T> parseNetworkResponse(NetworkResponse response) {
    try {
        String json = new String(response.data,
                HttpHeaderParser.parseCharset(response.headers));
        return Response.success(gson.fromJson(json, clazz),
                HttpHeaderParser.parseCacheHeaders(response));
    } catch (UnsupportedEncodingException e) {
        return Response.error(new ParseError(e));
    } catch (JsonSyntaxException e) {
        return Response.error(new ParseError(e));
    }
}

}


text:
Q: Any C++/C equivalent function with sparse in MATLAB I tried to port m code to c or cpp.
In my code there is a line
A = sparse(I,J,IA,nR,nC);

which converts row index I, col index J, and data IA to sparse matrix A with size nR x nC.
Is there any equivalent code with C++ or C?
An naïve algorithm to duplicate result in full matrix is
double *A;
A = malloc(sizeof(double)*nR*nC);
memset(A, 0, sizeof(double));

for(k=0; k<size_of_IA; k++)
    A[I[k]*nC + J[k]] += IA[k];

Note that if there is common indices, the value is not over overwritten, but accumulated.

A: Eigen is an example of a C++ math matrix library that cobtains sparse matrices.  It overloads operators to make it feel like a built in feature.
There are many C and C++ matrix libraries.  None ship as part of std, nor is there anything built in.
Writing a good sparse matrix library would be quite hard; your best bet is finding a pre-written one.  Recommendation questions are off topic

redpajama_set_name: RedPajamaStackExchange


text:
Q: Writing values to INI file I'm trying to store multiple data and then at the end go a head and push the data into the new .ini file. I found solutions which works but I want to get all the data first and then update the file at the end but the solutions i found updates the file straight away!
A solution I liked and worked is located: https://stackoverflow.com/a/36997282/6613233
I am trying to allow it gather information and then push it to the file at the end. My own attempt at this is below but i keep getting array array in my ini file.
Code:
$fbsettingsDB = parse_ini_file("location.ini", true);
$fbsettingsDB["id"]["value"] = $_POST['fbconfigid'];
$fbsettingsDB["location"]["value"] = $_POST['fbconfigcty'];
file_put_contents('location.ini', implode("\n", $fbsettingsDB));

The above is how I want to collect data. I have a bunch of code which goes in and out of statements, I want it to go ahead.. Assign the values required and at the very end go ahead and put the contents in the file like shown above.
Using the referred code i would then have to do:
config_set("location.ini", "id", "value", $_POST['fbconfigid']);
config_set("location.ini", "location", "value", $_POST['something']);
config_set("location.ini", "result", "value", $_POST['somethingelse']);

Which overwrites the file every time which in my opinion is just crazy! Overkill for my idea, there is obviously some way that can suit my needs so i can just call the function once after making a list of edit/changes and then when i call the function it grabs all my changed data and saves the file the way i want it!

A: I'll try to explain first why your code doesn't work, compared to the other.
Your inifile-array is build up of a nested array, $array[section][item] = value. The first dimension has the section names. The second dimension is the name of the items in the sections. So $fbsettingsDB["location"] contains an array of items, of which "value" is one.
Implode doesn't check if the array is nested. It just takes the first dimension (the sections) and tries to treat their values as a string. Since those values are actually arrays of items, PHP just converts that to the text 'array'.
Apart from that, you can't just implode the whole array. Section names should be enclosed in square brackets, so there is a little more work to do in that regard too.
If you check the solution in the answer you referred to, you'll see that it contains a loop which takes care of the first layer, the sections.
The array of items of each section is converted separately with implode, which is then prefixed by the section name in square brackets, and the whole lot is appended to the end result.
So, your intention here: You don't want to set a value and write it back to file at once, but update multiple values and only write the end result to disk. Well, fortunately the function doesn't have to be atomic. It already performs three separate actions: loading from disk, modifying the data, and serializing it back to disk. Let's see if those can be isolated in separate functions:
Read the data. Well, hardly worth to make a function, but it may make your application somewhat more consistent if you use the same naming et cetera in a collection of related functions.
Note: I just wrote these from scratch. No PHP at hand to test, so they might contain minor syntactical errors.
So here it is:
// Loads ini file data
function config_read($config_file) {
    return parse_ini_file($config_file, true);
}

Setting the config in the loaded data. Again, hardly worth to have a function, but it adds readability and hides how exactly the ini file data is built up, so you don't have to worry about implementation details when using it. Note that the array is passed by reference. The array you specify is updated. The function doesn't return a value.
// Update a setting in loaded inifile data
function config_set(&$config_data, $section, $key, $value) {
    $config_data[$section][$key] = $value;
}

Then writing it:
// Serializes inifile config data back to disk.
function config_write($config_data, $config_file) {
    $new_content = '';
    foreach ($config_data as $section => $section_content) {
        $section_content = array_map(function($value, $key) {
            return "$key=$value";
        }, array_values($section_content), array_keys($section_content));
        $section_content = implode("\n", $section_content);
        $new_content .= "[$section]\n$section_content\n";
    }
    file_put_contents($config_file, $new_content);
}

Note that so far I didn't modify any of the code. I just wrapped it in separate functions. If you like, you could even call those functions in another function, so you still got the shorthand to write everything to disk at once. You'll have the original functionality, but without having duplicate code:
// Short-hand function for updating a single config value in a file.
function config_set_file($config_file, $section, $key, $value) {
    $config_data = config_read($config_file);
    config_set($config_data, $section, $key, $value)
    config_write($config_file, $section, $key, $value);
}

So, now you got this collection of functions, you can decide which to use based on the situation. If you just want to update a single value, you might as well write this:
config_set_file("location.ini", "id", "value", $_POST['fbconfigid']);

But if you have multiple configs to set, you can do this:
// Load
$config_data = config_read("location.ini");
// Set multiple values
config_set($config_data, "id", "value", $_POST['fbconfigid']);
config_set($config_data, "location", "value", $_POST['something']);
config_set($config_data, "result", "value", $_POST['somethingelse']);
// Save
config_write($config_data, $config_file);

I can imagine you can add other shorthands, like config_set_array_file, which you could call like this..  I'll leave the implementation of this one to you for exercise. ;)
array_config_set_file($config_file, array(
    "id" => $_POST['fbconfigid'],
    "location" => $_POST['something'],
    "result" => $_POST['somethingelse']));

And after that, you can poor all this into an IniFile class to make it even nicer. :)


text:
Q: Mavericks Calendar sync with Google seems entirely broken? In a long drawn out story that started with trying to implement CardDAV (I'd like to store my contacts on google if possible), I removed my google account from Internet Accounts, which had existed there from Mountain Lion, and was working perfectly fine for Calendar.app and Messages.app.
Upon trying to re-add the Google account and have it sync my calendars, It's telling me that it cant do it anymore. I'm using two-factor google authentication, and I provide the setup with a generated, app specific password. Contacts and Messages click instantly, but Calendars sits spinning. It eventually informs me that:

A secure connection couldn't be established
Click "Continue" to continue creating the account.
  You can edit the account later in Calendar
  preferences if necessary
Cancel Continue

Console informs me that:
28/10/2013 2:26:38.652 am com.apple.internetaccounts[13796]: [com.apple.calendar.iaplugin.log.CalInternetAccountsPlugin] [Autodiscovery error: [Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x7fbbc50f0550 {NSUnderlyingError=0x7fbbc5629870 "The request timed out.", NSErrorFailingURLStringKey=https://user%40gmail.com@google.com:8443/principals/, NSErrorFailingURLKey=https://user%40gmail.com@google.com:8443/principals/, NSLocalizedDescription=The request timed out.}].]

Continue will just repeat this loop indefinitely.
I've done some digging and found these resources, although evidently they did not work for me:

*

*http://productforums.google.com/d/msg/calendar/7XZkRZzo10I/5oo7RReNhrAJ

*https://developers.google.com/google-apps/calendar/caldav/v2/guide#new_endpoint
It seems that the endpoint is no longer valid? Multiple attempts to create a CalDav account in Advanced mode attempting all flavours and variations bore no fruit.
How can I get this working again?

A: Here's what worked for me:

*

*Open Calendar.app

*Open Preferences (⌘+,)

*Click Accounts tab

*Click plus button (+) to add an account

*Select "Add CalDAV Account..."

*Click Continue

*Select "Account Type" Manual

*Username is your full email address "yourname@gmail.com"

*Password is your password (or application specific password if you use 2 factor auth)

*Server Address is "https://www.google.com"

Notes:

*

*Don't forget the "@gmail.com" on your gmail address! You can also use your own domain name if a Google Apps user

*The "https://" on the Server Address field is critical. Without this you will get an error about not being able to establish a secure connection (https uses SSL where http doesn't).

A: I reattempted the standard google process today, and it failed on ical (no account) but going to internet accounts and attempting to enable calendar worked.
I can only deduce some form of google services were down or misconfigured in this period.


text:
Q: DomainCollectionView with DomainService + Repository pattern i have a view model in silverlight which loads contacts i.e.:
_ContactsSource = new EntityList<ContactItem>(_ContactsDomainContext.ContactItems);
_ContactsLoader = new DomainCollectionViewLoader<ContactItem>(LoadCurrentCategoryContacts, LoadContactsCompleted);
_ContactsView = new DomainCollectionView<ContactItem>(_ContactsLoader, _ContactsSource);

    public LoadOperation<ContactItem> LoadCurrentCategoryContacts()
    {
        var query = _ContactsDomainContext.GetContactsByCategoryIdQuery(CurrentContactCategory.Id);
        query.IncludeTotalCount = true;

        var op = _ContactsDomainContext.Load(query.SortAndPageBy(_ContactsView));
        return op;
    }

    public void LoadContactsCompleted(LoadOperation<ContactItem> op)
    {
        if (op.HasError)
            op.MarkErrorAsHandled();
        else if (!op.IsCanceled)
        {
            _ContactsSource.Source = op.Entities;

            if (op.TotalEntityCount > -1)
                _ContactsView.SetTotalItemCount(op.TotalEntityCount);
        }
    }

and a domain service with method which returns contacts DTO, based on their category:
   public IQueryable<ContactItem> GetContactsByCategoryId(int categoryId)
    {
        List<ContactItem> result = new List<ContactItem>();
        Mapper.Map(_contactRepository.GetAll(x => x.ContactCategoryId == categoryId), result); //automapper
        return result.AsQueryable();
    }

the question is:
every time the domain service is used, it gets all table rows from database (i.e. _ContactsView PageSize is set to 10, the result in "return result.AsQueryable();" will have 140 elements), but only 10 elements is shown.
What is the best way to use DomainCollectionView with wcf ria service + repository pattern, so all the filtering and paging will happen on server side, and only necessary amount of data will be returned to silverlight?
Thank You !

A: The paging is still occurring on the server side, but it happens at the framework level. You're still only pulling 10 records to the client. What you've noticed, however, is that you're pulling 140 records to the middle (web) tier. This is problematic, but likely not to the same degree as pulling them all to the client.
The easiest way to fix this with your repository is to pass the pageIndex and pageSize as parameters to your query method. Instead of calling SoryAndPageBy on the client, just call SortBy and pass the view.PageIndex and view.PageSize values through the query. Also, don't forget to Include the TotalEntityCount request in your query.


text:
Q: MY JList cannot React with another Jlist, in other word, they dont connect somehow, when i click on 2nd jlist it value is null How to make 3 JList that connect each other?
private JList style = new JList(new String[] { "Monday", "Tuesday",
  "Wednesday", "Thursday", "Friday","Saturday","Sunday" });

private JList style2 = new JList(new String[] {"Lucy","bin"});

public void valueChanged(ListSelectionEvent evt) {
        updateFont();
}

  public void updateFont() {

      String m = (String) style.getSelectedValue();
      System.out.println(m);

    if(style.getSelectedValue()== "Monday")
    {
        style2.setListData(new String[]{"Lucy"});
        String mn = (String) style2.getSelectedValue();
        System.out.println(mn);
        //style3.setListData(st.getTime(mn));

    }
    if(style.getSelectedValue()== "Tuesday")
    {
        style2.setListData(new String[]{"Lucy"});
    }

    if(style.getSelectedValue()== "Wednesday")
    {
        style2.setListData(st.getMovieList());
    }

    if(style.getSelectedValue()== "Thursday")
    {
        style2.setListData(st.getMovieList());
    }

    if(style.getSelectedValue()== "Friday")
    {
        style2.setListData(st.getMovieList());
    }

    if(style.getSelectedValue()== "Saturday")
    {
        style2.setListData(new String[] {"Lucy","bin"});
    }
    if(style.getSelectedValue()== "Sunday")
    {
        style2.setListData(new String[] {"Lucy","bin"});
    }

    repaint();


text:
Q: getting Value of type 'Set' has no member 'compactMap' FBAcessToken var grantedSwiftPermissions: Set? { return (permissions?.compactMap { $0 as? String }.map { Permission(name: $0) }).map(Set.init) }

What is wrong in above code, Can you please help

A: This is probably due to your Xcode version,
Currently you are using xCode version <= 9.2 which support flatMap.
In FBCorekit library they included compactMap, which was introduced in xCode v 9.3.
So update your Xcode or use old library of Facebook.
Hope this will work.
If I am wrong or can be correct more than please welcome.


text:
Q: Creating python module with command line arguments I've uploaded a python module to pypi and locally installed the module with:
pip install microarray_quantilenorm
I'm trying to run the module on commandline with pass-through arguments.
When I call the python script directly from site-packages, everything works fine.
python /site-packages/microarray_quantilenorm/microarray_quantilenorm.py *csv

But calling:
python -m microarray_quantilenorm.__main__ *csv

OR:
python -m microarray_quantilenorm *csv

Results in:
/anaconda/bin/python: No module named microarray_quantilenorm.__main__

I cannot track down to whether there is an issue in setup.py, my __init__.py or elsewhere. Thanks.

A: The whole point of __main__.py is that it's the file that's run when the package is run as a module. In other words, just do python -m microarray_quantilenorm, not python -m microarray_quantilenorm.__main__.
However, usually, there's an even better solution. Assuming you're using setuptools rather than trying to do the whole mess manually, use a console_scripts entry point. This will make the setup process automatically create a script named microarray_quantilenorm and install it in your bin or scripts directory that does the right thing to load the package and run its main code (or, if you prefer, some other code within it).


text:
Q: Shiny - Efficient way to use ggplot2(boxplot) & a 'reactive' subset function I have a dataset with > 1000K rows and 5 columns. (material & prices been the relevant columns)
I have written a 'reactive' Shiny app which uses ggplot2 to create a boxplot of the price of the various materials.
e.g the user selects 4-5 materials from a list and then Shiny creates a boxplot of the price of each material :
Price spread of: Made of Cotton, Made of Paper, Made of Wood
It also creates a material combination data plot of the pricing spread of the combination of all the materials
e.g Boxplot of
Price spread of: Made of Cotton & Paper & Wood
It is working relatively quickly for the sample dataset (~5000 rows) but I am worried about scaling it effectively.
The dataset is static so I look at the following solutions:

*

*Calculate the quartile ranges of the various materials (data <-
summary(data)) and then use googleViz to create a candle stick,
however I run into problems when trying to calculate the material combination plot as there are over 100 materials, so calculating
all the possible combinations offline is not feasible.

*Calculate the quartile ranges of the various materials (data <- summary(data)) and then create a matrix which stores the row numberof the summary data (min,median,max,1st&3rd quartile) for each material. I can then use some rough calculations to establish the    summary() data for the material combination plot,
and then plot using GoogleVIZ however I have little experience with this type of calculation using Shiny.
Can anyone suggest the most robust and scalable way to calculate & boxplot reactive subsets using Shiny?
I understand this a question related to method, rather than code, but I am new to the capabilities of R and am still digesting the different class capabilities, and don't want to 'miss a trick' so to speak.
As always thanks!
Please see below for methods reviewed.
Quartile Clustering: A quartile based technique for Generating Meaningful Clusters
http://arxiv.org/ftp/arxiv/papers/1203/1203.4157.pdf
Conditionally subsetting and calculating a new variable in dataframe in shiny

A: If you really have a dataset that has more than 1000K, which is 1M. It is probably in a flat file or in a database. You can always do some precalculations and store the result in a database table and use shiny app to call that table instead of loading everything into R every time people open up your shiny app.
I have built several shiny apps for internal use and the lesson I have learned is that: before you build your app, you need to carefully think about, how can I minimize the calculations for R and at the same time deliver the info to app user. Some of our data is 10billion+ and use Hive query will take more than 1 hour. Then I ended up precalculate result and put it on the crontab to update the result table every midnight.
I prefer, maybe your method2? or store the precalculation in a mysql database. (Maybe a Python script update the table once a day if you need some real-time feature later).


text:
Q: ASP.NET Web service - How to connect it to database using connection string ? I want to retrieve all the registered users from my application using web service in ASP.NET. However, I have problem with connection string.
public static String getRegisteredUsers(string usernameCode)
    {
        string username = "";

        SqlConnection con = new SqlConnection("MyDatabaseConnectionString1");
        SqlCommand cmd = new SqlCommand("Select Username from Users where usernameCode = '" + usernameCode.ToUpper() + "'", con);
        con.Open();

        SqlDataReader dr = cmd.ExecuteReader();

        while (dr.Read())
        {
            username = dr["username"].ToString();
        }

        dr.Close();
        con.Close();

        return username;
    }

This MyDatabaseConnectionString1 is the connection string that I use for the table that I want to retrieve the information from. It works for that table, but not when it comes to web service.
<add name="MyDatabaseConnectionString1" connectionString= "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Korisnik\Desktop\Fitness\App_Data\MyDatabase.mdf;Integrated Security=True"/>

Should I use the same connection string for web service or it's done somehow differently ?
This is the error:

A: You should not use MyDatabaseConnectionString1 (name of the connection string) directly as input for SqlConnection (which expects connection string as the input). Do this instead:
string connStr = ConfigurationManager.ConnectionStrings["MyDatabaseConnectionString1"].ConnectionString;
SqlConnection con = new SqlConnection(connStr);
... //continue as what you have done

You declare your MyDatabaseConnectionString1 in the .config file. The SqlConnection does not read your .config file but take the connStr input. Thus you get the error. You should read your connection string in the .config file by using ConfigurationManager available in the System.Configuration namespace. Then you use the connStr resulting from reading the .config file

A: Ensure System.Configuration assembly is referenced.
Use this syntax:
 SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["MyDatabaseConnectionString1"].ConnectionString);


text:
Q: Regex not working to match markdown header starting with hash Can anyone tell me what i am doing wrong in the following.
i want to match markdown header # with following one space.
function fizz_buzz($markdown) {
    $markdown = trim($markdown);
    preg_match('/^#{1,6}\s(w+)/', $markdown, $matches, PREG_OFFSET_CAPTURE);
        print_r($matches);
}
echo fizz_buzz("# header");
echo fizz_buzz("### header");

Its outputs empty array, should match both.

A: I think you need to use \w+ instead of w+ to match any word character
function fizz_buzz($markdown) {
    $markdown = trim($markdown);
    preg_match('/^#{1,6}\s(\w+)/', $markdown, $matches, PREG_OFFSET_CAPTURE);
    print_r($matches);
}
echo fizz_buzz("# header");
echo fizz_buzz("### header");

Output php


text:
Q: AngularJS and Bootstrap, data-toggle and data-target I`m using Modals from Bootstrap and AngularJS but I want only toggle the modal if userInfo.info.dogeAddress is not '';
Opwaaderen »

so, I know how to do it with classes, but how can we do this with data-target and data-toggle?

A: Just a guess, but probably you should eat the ng-click event before it ever reaches to bootstrap.
Such as:
Opwaaderen »


text:
Q: Retrieve selected option from combobox(form control) excel VBA Hey I don't seem to understand why my code isn't working as I saw this as an answer to another question in SO. I want to retrieve the selected item from the combobox, as I subsequently have to use it in a match index function. Here is my code
Option Explicit
Dim ws As Sheets

Sub test2()
Set ws = Sheets(Array("Sheet1", "Sheet2"))
 With ws(1).Shapes("Drop Down 2").ControlFormat

  .List(.ControlFormat.ListIndex) = ws(1).Range("I8").Value

 End With
End Sub

Also, I wanted to know about how to refer to dropdowns in general? Because I have 10 such comboboxes(dropdowns) each named differently on a numerical basis. So, instead of referring to a specific dropdown like "Drop Down 2" or through using a loop say ("Drop Down " & i), is there a generic way to refer to dropdowns on a particular sheet? I really need help..

A: This is how you retrieve the selected item value:
Dim myindex As Long, myitem As String
Dim ws As Worksheet

Set ws = Sheets("Sheet1")
'~~> Currently selected item index at runtime
myindex = ws.Shapes("Drop Down 1").ControlFormat.Value
'~~> Currently selected item value at runtime
myitem = ws.Shapes("Drop Down 1").ControlFormat.List(myindex)

For your second question, you can use the Shape Collection Object.
Then use For Each loop construct.
Dim shp As Shape, ws As Worksheet: Set ws = Sheets("Sheet1")
Dim myindex As Long, myitem As String

'~~> Iterate the shapes collection object
For Each shp In ws.Shapes
    '~~> Check the type
    If shp.Type = msoFormControl Then
        myindex = shp.ControlFormat.Value
        myitem = shp.ControlFormat.List(myindex)
        '~~> additional codes here
    End If
Next

But if you need to do specific stuff in specific ComboBoxes, use what you described in your question. HTH
Edit1:
For Each shp In ws.Shapes
    '~~> Check the type
    If shp.Type = msoFormControl Then
        With shp.ControlFormat
            myvalue = .List(.ListIndex)
        End With
    End If
Next

Above works as well as you commented.
As to why it works only under With Clause is because that is basically why you use With.
To somehow shorten the code. If you want to do it without With, use below:
myvalue = shp.ControlFormat.List(shp.ControlFormat.ListIndex)


text:
Q: dynamic javascript/php form with radios creating a second field I'm having a little 'teething' problem here is my code so far
<form name="job_app">
    Source?

        <input type="radio" name="source" value="GAZ" id="GAZ" /> Stonoway Gazette

        <input type="radio" name="source" value="JCP" id="JCP" /> Job Center

        <input type="radio" name="source" value="WOM" id="WOM" /> Word of Mouth

</form>

what i want this to do is create (or unhide) the issue or ref text box depending on which radio button is selected without creating multiple text boxes.
sorry for any inconvenience if this is a rookie mistake, i have never worked with java before nor a language like it.
This is the working code as of 07:15 26/05/2012 as thanks to Amy McCrobie.
It has undergone some edits since Amy's version (see below) i have moved all scripts above the form to make adding the next few fields easier, added a statement for word of mouth, omitted  as that is part of index.php and meta.php while this is for form.php, added a spacer and made the function name more specific.
index.php
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

        <?php
            include './meta.php';
        ?>

    <?php
        /*if(isset($_POST['submit'])){
            include './submit.php';
        }
        else{*/
            include './form.php';
        //}
    ?>

meta.php
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta http-Equiv="Cache-Control" Content="no-cache" />
<meta http-Equiv="Pragma" Content="no-cache" />
<meta http-Equiv="Expires" Content="0" />
<title>job_app</title>
<link rel="StyleSheet" type="text/css" href="./style.css"/>

form.php

<form name="job_app" action="" method="post">
    Source?

        <input type="radio" name="source" value="GAZ" id="GAZ" onChange="showHide_source()" /> Stonoway Gazette

        <input type="radio" name="source" value="JCP" id="JCP" onChange="showHide_source()" /> Job Center

        <input type="radio" name="source" value="WOM" id="WOM" onChange="showHide_source()" /> Word of Mouth

Issue
<input type="text" name="issue" />

Ref
<input type="text" name="ref" />

    rest of form
    <input...
     .../>
</form>

style.css
div.hideable{
    height: 62px;
}

A: Try this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-Equiv="Cache-Control" Content="no-cache">
    <meta http-Equiv="Pragma" Content="no-cache">
    <meta http-Equiv="Expires" Content="0">

    <title>Test</title>

<form name="job_app" action="" method="post">
    Source?

        <input type="radio" name="source" value="GAZ" id="GAZ" onChange="showHide()" /> Stonoway Gazette

        <input type="radio" name="source" value="JCP" id="JCP" onChange="showHide()" /> Job Center

        <input type="radio" name="source" value="WOM" id="WOM" onChange="showHide()" /> Word of Mouth

Issue
<input type="text" name="issue" />

Issue
<input type="text" name="ref" />

</form>

A: I would suggest jQuery, it's not hard to learn, in fact I find it much easier than basic javascript
also I would go the route of two textboxes that are hidden, and then showing them via jQuery
as it stands now I think if the user checks one radio button and then the other two text boxes will appear
and with jQuery added (which is as easy as including the sript at the top of your page your code would be more like this...
<form name="job_app">
    Source?

        <input id="GAZ" type="radio" name="source" value="GAZ" id="GAZ" /> Stonoway Gazette

        <input id="JCP" type="radio" name="source" value="JCP" id="JCP" /> Job Center

        <input id="WOM" type="radio" name="source" value="WOM" id="WOM" /> Word of Mouth

        Issue
<input id="issue" type="text" name="issue" />

        Issue
<input id="ref" type="text" name="ref" />

</form>


text:
Q: Django - Render the  of a single form field I'm selectively rendering fields on a form.
class SomeForm(forms.Form):
    foo = forms.ChoiceField(label='Some Foo', ...)
    bar = forms.BooleanField(label='Some Bar', ...)
    ...

I've got a custom tag that, based on some other logic, lets me iterate over the fields of the form that I need using the FIELD context variable in the tag:
{% fieldsineed %}
  {% if FIELD.field.widget|klass == "CheckboxInput" %}

{{ FIELD }} {{ FIELD.field.label }}

  {% else %}

{{ FIELD.label }}: {{ FIELD }}

  {% endif %}
{% endfieldsineed %}

(klass is a filter I got from here which returns the class name of the filtered value.)
Unfortunately, FIELD.label is only a string. Is there an easy way to render a  tag for a given form field?

A: https://docs.djangoproject.com/en/dev/topics/forms/#s-looping-over-the-form-s-fields
Shows you can do
{{ FIELD.label_tag }}

Should render something like
Fieldlabel:

A: You can also do
class SomeForm(forms.Form):
    foo = forms.ChoiceField(label='Some Foo', ...)
    bar = forms.BooleanField(label='Some Bar', ...)

You can render form like:

          {{ form.foo.label }}
          {{ form.foo}}


text:
Q: Display picklist values after they have been submitted I have a Close Case tab with two picklists when performing a close-case action, I'm able to save the values to database. But if I revisit the Close Case tab I just get the default values, is there any way of having the picklist displaying the earlier chosen values just as for reference for agent to see what was chosen in the picklist?
<lightning:select name="reasonPicklist" label="Case Reason" required="true" aura:id="reasonPicklist" value="{!v.objDetail.Reason}" onchange="{!c.pickProblemOption}">
        <option value="">--None--</option>
        <aura:iteration items="{!v.reasonOptions}" var="val">
            <option value="{!val}"  selected="{!val.selected}">{!val}</option>
        </aura:iteration>
    </lightning:select>
    <br/>
    <lightning:select name="problemPicklist" disabled="{!v.disablePickProblem}" label="Problem Type" required="true" aura:id="problemPicklist" value="{!v.objDetail.ProblemType__c}">
        <option value="">--None--</option>
        <aura:iteration items="{!v.problemOptions}" var="p">
            <option value="{!p}" selected="{!p.value == v.record.ProblemType__c}">{!p}</option>
        </aura:iteration>
    </lightning:select>

the controler
({
    doInit : function(component, event, helper) {
        helper.loadCase(component);
    },
    sendDetails : function(component, event, helper){
        const spinner = component.find("fullSpinner");
        if (helper.validateForm(component)) {
            $A.util.removeClass(spinner, "slds-hide");
            const c = component.get("v.record");
            const userId = $A.get("$SObjectType.CurrentUser.Id");
            const qId = component.get("v.queueSettings.Closed_Cases__c");
            c.OwnerId = qId;
            c.Status = 'Closed';
            c.DetailedStatus__c = '';
            c.AgentWorkingId__c = userId;
            c.Has_Been_Closed__c = true;
            c.Reason = component.find("reasonPicklist").get("v.value");
            c.ProblemType__c = component.find("problemPicklist").get("v.value");
            component.set("v.record", c);
            helper.updateCase(component);
        } else {
            const toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
                "title": "Error!",
                "message": "Please select a value in each field to proceed"
            });
            toastEvent.fire();
        }
    },
    sendDetailsWait : function(component, event, helper){
        const spinner = component.find("fullSpinner");
        if(helper.validateForm(component)){
            $A.util.removeClass(spinner, "slds-hide");
            const c = component.get("v.record");
            const userId = $A.get("$SObjectType.CurrentUser.Id");
            const recType = component.get("v.record.RecordTypeId");
            let qId = '';
            if (recType == component.get("v.recSettings.Saga_Club_Case__c")) {
                qId = component.get("v.queueSettings.Saga_Club_Waiting__c");
            }
            else if (recType == component.get("v.recSettings.Holidays_Case__c")) {
                qId = component.get("v.queueSettings.Holidays_Waiting__c");
            }
            else if (recType == component.get("v.recSettings.Saga_Shop_Case__c")) {
                qId = component.get("v.queueSettings.Saga_Shop_Waiting__c");
            }
            else {
                qId = component.get("v.queueSettings.Generic_Waiting__c");
            }
            c.OwnerId = qId;
            c.Status = 'Waiting';
            c.DetailedStatus__c = 'Waiting for Passenger Reply';
            c.AgentWorkingId__c = userId;
            c.Reason = component.find("reasonPicklist").get("v.value");
            c.ProblemType__c = component.find("problemPicklist").get("v.value");
            component.set("v.record", c);
            helper.updateCase(component);
        }else{
            const toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
                "title": "Error!",
                "message": "Please select a value in each field to proceed"});
            toastEvent.fire();
        }
    },
    pickProblemOption : function(component, event, helper) {
        const controllerValueKey = event.getSource().get("v.value");

        const dependentFieldMap = component.get("v.dependentFieldMap");

        const listOfDependentFields = dependentFieldMap[controllerValueKey];

        if (!listOfDependentFields || listOfDependentFields.length == 0) {
            component.set("v.problemOptions", ['--None--']);
            component.set("v.disablePickProblem", true);
            return;
        }

        if (listOfDependentFields.length > 0) {
            component.set("v.disablePickProblem", false);
            helper.fetchDepValues(component, listOfDependentFields);
        }
    }
})

helper
({
    loadCase: function(cmp) {
        var action = cmp.get("c.getCaseById");
        action.setParams({ caseId : cmp.get("v.recordId") });
        action.setBackground();
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set('v.record', response.getReturnValue());
                this.checkIfAttributesFilled(cmp);
                this.fetchPicklistMap(cmp);
            }else{
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        toastEvent.setParams({
                            "title": "Error!",
                            "message": errors[0].message});
                        toastEvent.fire();
                    }
                } else {
                    toastEvent.setParams({
                        "title": "Error!",
                        "message": "Unknown error"});
                    toastEvent.fire();
                }
            }
        });
        $A.enqueueAction(action);
    },
    checkIfAttributesFilled : function(cmp){
        var recType = cmp.get("v.record.Record_Type__c");
        if(recType.includes('Holidays')){
            cmp.set("v.record.Reason", "Holly Holidays");
        }
        else if(recType.includes('Club')){
            cmp.set("v.record.Reason", "S Club");
        }
        else if(recType.includes('Shop')){
            cmp.set("v.record.Reason", "S Shop");
        }

        var reason = cmp.get("v.record.Reason");
        if(reason != undefined){
            var a = cmp.get('c.pickProblemOption');
            $A.enqueueAction(a);
        }
    },
    updateCase: function(cmp) {
        console.log('update');
        console.log(cmp.get("v.record"));
        var toastEvent = $A.get("e.force:showToast");
        var action = cmp.get("c.updateCaseInternal");
        action.setParams({ c : cmp.get("v.record") });
        action.setBackground();
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                toastEvent.setParams({
                    "title": "Success!",
                    "message": "The record has been updated successfully."});
                $A.get("e.force:closeQuickAction").fire();
                toastEvent.fire();
                $A.get("e.force:refreshView").fire();
            }else{
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        toastEvent.setParams({
                            "title": "Error!",
                            "message": errors[0].message});
                        toastEvent.fire();
                    }
                } else {
                    toastEvent.setParams({
                        "title": "Error!",
                        "message": "Unknown error"});
                    toastEvent.fire();
                }
            }
        });
        $A.enqueueAction(action);
    },
    validateForm : function(cmp) {
        var listToValidate = new Array();
        listToValidate.push(cmp.find("reasonPicklist"));
        var problem = cmp.get('v.problemOptions');
        if(problem.length > 0){
            listToValidate.push(cmp.find("problemPicklist"));
        }
        var valid = true;
        for(var j = 0; j < listToValidate.length; j++) {
            if(listToValidate[j].get('v.validity').valueMissing){
                listToValidate[j].showHelpMessageIfInvalid();
                if(valid){
                    listToValidate[j].focus();
                }
                valid = false;
            }
        }
        return valid;
    },
    fetchPicklistMap : function(component) {
        const toastEvent = $A.get("e.force:showToast");
        const recTypeId = component.get("v.record.RecordTypeId");
        const action = component.get("c.callSalesforceEndpoint");
        action.setParams({
            "url" : `/services/data/v50.0/ui-api/object-info/Case/picklist-values/${recTypeId}/ProblemType__c`
        });

        action.setCallback(this, (response) => {
            if (response.getState() == 'SUCCESS') {
                const correctResponse = response.getReturnValue();
                const valuesObject = JSON.parse(correctResponse);

                const controllerValuesMap = Object.keys(valuesObject.controllerValues).reduce((finalMap, key) => {
                    finalMap[valuesObject.controllerValues[key]] = key;
                    return finalMap;
                }, {});

                const valueMap = Object.keys(valuesObject.controllerValues).reduce((finalMap, key) => {
                    finalMap[key] = [];
                    return finalMap;
                }, {});
                valueMap['--None--'] = ['--None--'];

                valuesObject.values.forEach(item => {
                    item.validFor.forEach(key => {
                        valueMap[controllerValuesMap[key]].push(item.value);
                    });
                });
                component.set("v.dependentFieldMap", valueMap);

                const controllerValuesArray = Object.keys(valuesObject.controllerValues).map(key => key);
                component.set("v.reasonOptions", controllerValuesArray);

                // component.find("reasonPicklist").set("v.val", component.get("v.record.Reason"));

                // component.find("problemPicklist").set("v.objDetail.ProblemType__c", component.get("v.record.ProblemType__c"));

            } else {
                const errors = response.getError();

                if (errors) {
                    if (errors[0] && errors[0].message) {
                        toastEvent.setParams({
                            "title": "Error!",
                            "message": errors[0].message});
                        toastEvent.fire();
                    }
                } else {
                    toastEvent.setParams({
                        "title": "Error!",
                        "message": "Unknown error"});
                    toastEvent.fire();
                }
            }
        });
        $A.enqueueAction(action);
    },
    fetchDepValues: function(component, listOfDependentFields) {
        const dependentFields = [];
        listOfDependentFields.forEach((field) => {
            dependentFields.push(field);
        });

        component.set("v.problemOptions", dependentFields);
    }
})


text:
Q: SQL to get sales for same customer with diffente payment type I have a Oracle Database and a sales table, follow a small sample:
customer | type      |  value
----------------------------------------------
A        | CREDIT    |  20
A        | DEBIT     |  10
B        | CREDIT    |  50
B        | DEBIT     |  200
C        | CREDIT    |  40

I need to find all the sales where the same customer have type CREDIT AND DEBIT. For example, in this sample, the customer C would be ignored because he doesn't have type CREDIT AND DEBIT.
I'm trying with inner join between two queries using the customer as key:
select * from
(select customer, type, value from sales where type IN ('DEBIT')) A
INNER JOIN
(select customer, type, value from sales where type IN ('CREDIT')) B
ON (A.customer = B.customer)

The problem with this approach is that, as you can see, the user can choose multiple types (that's why it's an IN clause) and if the user choose more than one type, the join could give duplicated results.
Any idea of a SQL solution for this situation?

A: If you want entire rows, you can use exists:
select *
from sales s
where exists (
    select 1 from sales s1 where s1.customer = s.customer and s1.type <> s.type
)

If you just want the list of customer that have both type, then you can group by and filter with a having clause:
select customer
from sales
group by customer
having min(type) <> max(type)

Both answers implicitly assume that there are just two possible types (credit and debit), as shown in your sample data. If you need to handle more types per customer (say, 4 types per customers), then:
select customer
from sales
group by customer
having count(distinct type) = 4

Or if you want entire rows:
select *
from sales s
where (select count(distinct type) from sales s1 where s1.customer = s.customer) = 4

A: Another approach could be to group by the customer and check the distinct number of types they have:
SELECT   customer
FROM     sales
WHERE    type IN ('DEBIT', 'CREDIT')
GROUP BY customer
HAVING   COUNT(DISTINCT type) = 2

A: Yet another approach is to use analytical function count as follows:
Select * from
(select t.*,
        Count(distinct type) over (partition by customer) as cnt
  from sales t Where t.type IN ('DEBIT', 'CREDIT')
) where cnt = 2


text:
Q: Creating a standalone application in Java I want to create a software using Java. I have coded the application with Java Swing and using backend as MySQL server 5.05.
How can I create an application that can be installed on Windows, and run like other software?

A: Compile it as a JAR and run it in the Windows JRE.


text:
Q: Display wordpress content on .NET website I'm developping a .NET website on which i'll display news, catégories, tags... of a wordpress website.
My goal is to benefit from the wordpress backoffice (ready to use).
I have ideas on how to do it but i wonder if i could find a .NET library to easily query the wordpress website.
Thank you.

A: I would use the RSS feeds that wordpress has to offer. You can add '/feed' to any of the category or tag links to get specific info. I've used the following article to create a library to consume the feed:
http://blog.decayingcode.com/post/how-to-parse-an-rss-and-atom-feed-from-pure-net-without-plugins


text:
Q: Excel vba user to select workbook then copy data I have a macro that will copy data from a csv file to my excel file and works great if the file name is the same every time. That's where the problem lies: it's not the same name every time.
I need the script to allow a user to select the csv file. Then, the code to allow it to copy. This is what I have:
Sub importmix()

    Worksheets("mixdata").Range("A1:P300").Clear

    '## Open workbooks first:
    Set X = Workbooks.Open("C:\test\mix.csv")
    '## Set values between workbooks
    Workbooks("2.xlsm").Worksheets("mixdata").Range("A1:K300").Value = _
        Workbooks("mix.csv").Worksheets("mix").Range("C1:M300").Value

    '##Close x:
    X.Close False
End Sub

A: I think you are looking for something like this:
Sub test()
    Dim intResult As Integer
    Dim fD As FileDialog

    Set fD = Application.FileDialog(msoFileDialogFilePicker)

    With fD
        .Title = "Select a Path"
        .AllowMultiSelect = False
        .Show
    End With

    importmix fD.SelectedItems(1)

End Sub

Sub importmix(path As String)

    Worksheets("mixdata").Range("A1:P300").Clear

    '## Open workbooks first:
    Set X = Workbooks.Open(path)
    '## Set values between workbooks
    Workbooks("2.xlsm").Worksheets("mixdata").Range("A1:K300").Value = _
        Workbooks(Dir(path)).Worksheets(Dir(Replace(UCase(path), ".csv", ""))).Range("C1:M300").Value

    '##Close x:
    X.Close False

End Sub

Dir(path) gives you the file name. A csv automatically opens a sheet with the name of the file without the extension so removing the .csv takes care of that.

A: Should be able to use:
Dim intResult as integer
'Dialogue box name
Application.FileDialog(msoFileDialogFolderPicker).Title = "Select a Path"
'The dialog is displayed to the user
intResult = Application.FileDialog(msoFileDialogFolderPicker).Show


text:
Q: saving optimization steps to a file I try to use the Powell's method for the minimization a function. However, I encountered an issue firth saving optimization steps to a file.
This is the general concept what I did so far:
def printx(coeff):
    global fout
    fout.write(coeff)

func = 'TEST'
fout = open(func +'.txt','w')
opt_res = opt.fmin_powell(engine, coeff, args=(func,func), callback=printx,disp=1)
fout.close()

I am getting in return a TEST.txt file with wired symbols:
`¯q^Y^T´^L@`¯q^Y^T´^L@`¯q^Y^T´^L@`¯q^Y^T´^L@

What am I doing wrong?

A: The argument to write must be a string.
Cleaning up your code a little bit:
with open(filename, 'w') as f:
    callback = lambda x: f.write(str(x))
    opt_res = opt.fmin_powell(engine, coeff, args=(func,func), callback=callback, disp=1)


text:
Q: How to import from a pipe-delimited text file in Deno using BufReader? I'm trying to read a pipe-delimited file into Deno (before storing it in an SQLite db), and I've run into a problem of comprehension. I thought I'd try to get a simple parse working, before trying to get the pipe to work.
And here's the data/test.csv file:
name|age
Bob|53
Alice|47

Here's my initial code:
import { parse as parseCsv } from "https://deno.land/std@0.82.0/encoding/csv.ts";

const content = await parseCsv(await Deno.readTextFile("data/test.csv"), {
  skipFirstRow: true,
  separator: "|",
});

console.log(content);

I'm running it with deno run --allow-read db.js, which gives me back the expected:
[ { name: "Bob", age: "53" }, { name: "Alice", age: "47" } ]

However, I'm worried that the source data could get quite large, so I was hoping to use a BufReader:
import { parse as parseCsv } from "https://deno.land/std@0.82.0/encoding/csv.ts";
import { BufReader } from "https://deno.land/std@0.166.0/io/mod.ts";

const file = await Deno.open("data/test.csv");
const content = await parseCsv(new BufReader(file), {
  skipFirstRow: true,
  separator: "|",
});

console.log(content);

but the result I get is simply: [].
Is there something obvious I'm missing? Some sort of while loop?

A: Deno includes in its std library a class that extends the native TransformStream which can be used to parse and iterate a CSV-formatted ReadableStream. This provides the benefit of not only being able to parse file streams, but any other streams (such as a streaming response to a network request).
The class is called CsvStream and is exported from the module at https://deno.land/std@{STD_VERSION}/encoding/csv/stream.ts.
Here's link to the line number in the current version of the std library as I write this answer: https://deno.land/std@0.166.0/encoding/csv/stream.ts?source#L42
Below is a basic example of how to use it with the example file in your question.
./db.ts:
import {
  CsvStream,
  type CsvStreamOptions,
} from "https://deno.land/std@0.166.0/encoding/csv/stream.ts";

/**
 * A helper async generator function which yields the parsed CSV rows
 */
async function* iterateCsvRows(
  filePath: string,
  options?: CsvStreamOptions,
): AsyncGenerator<string[], void> {
  // Open the file to get a handle:
  const file = await Deno.open(filePath);

  // Pipe the file's ReadableStream (Uint8Array chunks)
  // through a TextDecoderStream, then pipe those string chunks
  // through the CsvStream:
  const readable = file.readable
    .pipeThrough(new TextDecoderStream())
    .pipeThrough(new CsvStream(options));

  // Yield the resulting parsed string arrays:
  for await (const stringArray of readable) yield stringArray;

  // The file auto-closes after the ReadableStream finishes and closes
}

async function main() {
  const csvPath = "data/test.csv";

  const csvStreamOptions: CsvStreamOptions = {
    separator: "|",
  };

  for await (const row of iterateCsvRows(csvPath, csvStreamOptions)) {
    console.log(row);
  }
}

if (import.meta.main) main();

 % deno --version
deno 1.28.2 (release, x86_64-apple-darwin)
v8 10.9.194.1
typescript 4.8.3

% cat data/test.csv
name|age
Bob|53
Alice|47

% deno run --allow-read db.ts
[ "name", "age" ]
[ "Bob", "53" ]
[ "Alice", "47" ]

You can — of course — adapt the example above to include an option to parse the first row separately if you expect headers — and then use the values from the parsed headers row as keys to yield an object for every subsequent row, with the values from the array assigned to the object at the corresponding keys. Here's an example of what that might look like using an overloaded function signature:
./db.ts:
import { assert } from "https://deno.land/std@0.166.0/testing/asserts.ts";
import {
  CsvStream,
  type CsvStreamOptions,
} from "https://deno.land/std@0.166.0/encoding/csv/stream.ts";

/**
 * A helper async generator function which yields parsed CSV rows
 */
function iterateCsvRows(
  filePath: string,
  options: CsvStreamOptions & { includesHeaders: true },
): AsyncGenerator<Record<string, string>, void>;
function iterateCsvRows(
  filePath: string,
  options: CsvStreamOptions & { includesHeaders: false },
): AsyncGenerator<string[], void>;
function iterateCsvRows(
  filePath: string,
  options: CsvStreamOptions & { includesHeaders: boolean },
): AsyncGenerator<string[] | Record<string, string>, void>;
function iterateCsvRows(
  filePath: string,
  options?: CsvStreamOptions,
): AsyncGenerator<string[], void>;
async function* iterateCsvRows(
  filePath: string,
  options?: CsvStreamOptions & { includesHeaders?: boolean },
) {
  const { includesHeaders, ...opts } = options ?? {};
  const file = await Deno.open(filePath);

  const readable = file.readable
    .pipeThrough(new TextDecoderStream())
    .pipeThrough(new CsvStream(opts));

  const headers: string[] = [];

  if (includesHeaders) {
    const reader = readable.getReader();
    const { done, value } = await reader.read();
    reader.releaseLock();
    assert(!done, "Stream data not found");
    headers.push(...value);
  }

  for await (const stringArray of readable) {
    if (!includesHeaders) {
      yield stringArray;
      continue;
    }

    assert(
      stringArray.length === headers.length,
      `Expected ${headers.length} values, but encountered ${stringArray.length}`,
    );

    const obj: Record<string, string> = {};

    for (let i = 0; i < headers.length; i += 1) {
      obj[headers[i]] = stringArray[i];
    }

    yield obj;
  }
}

async function main() {
  const csvPath = "data/test.csv";

  console.log("Headers option off:");
  const iter = iterateCsvRows(csvPath, { separator: "|" });
  for await (const row of iter) console.log(row);

  console.log("Headers option on:");
  const iterUsingHeaders = iterateCsvRows(csvPath, {
    separator: "|",
    includesHeaders: true,
  });

  for await (const obj of iterUsingHeaders) console.log(obj);
}

if (import.meta.main) main();

% deno --version
deno 1.28.2 (release, x86_64-apple-darwin)
v8 10.9.194.1
typescript 4.8.3

% cat data/test.csv
name|age
Bob|53
Alice|47

% deno run --allow-read db.ts
Headers option off:
[ "name", "age" ]
[ "Bob", "53" ]
[ "Alice", "47" ]
Headers option on:
{ name: "Bob", age: "53" }
{ name: "Alice", age: "47" }


text:
Q: A word for an instrumental melody which copies the vocal part? Sometimes in rock music you'll hear a guitar solo which reproduces the vocal melody: from the verse, for example.
Smells Like Teen Spirit by Nirvana springs to mind - here's a link to the relevant part, just before the solo starts.    https://youtu.be/hTWKbfoikeg?t=161
Can anyone think of a neat, ie terse but with a clear meaning, way to describe such an instrumental solo?
Something with a meaning similar to "vocal-melody-copying", but nicer.  If there's already an Italian word for this from the world of classical music, then that's fine.

A: I usually associate "an instrumental reprise" with an instrumental version of an entire song that was originally written with vocals, like the instrumental version of the Eagles' Wasted Time discussed in paragraph three of the "Song Facts" link.
However, this link seems to be using "instrumental reprise" (and the less ambiguous "instrumental response") to describe what you are seeking:

The first verse is sung to the accompaniment of the instrumentalists;
  this is followed by an instrumental reprise of the melody in
  slightly altered form known as the jawab "response."     The second
  [sung] verse is then … [also] followed by the slightly different
  instrumental response.

(from The Concise Garland Encyclopedia of World Music, Volume 2 edited by Ellen Koskof, via 'Google Books')
Of these two, "instrumental response" would be less likely to cause confusion with the "instrumental version" meaning of "instrumental reprise," but "response" would imply that the instrumental solo is somehow different from the vocalized melody, whereas "reprise" would capture better the notion of it being "copied" or "repeated" instrumentally.
("In music, a reprise ... is the repetition or reiteration of the opening material later in a composition ..." from Wikipedia.)

His solo was an instrumental reprise of the song's/the verse's
  [vocalized] melody.

A: While it's not a single word, sometimes this is referred to as "restating the melody." The section itself would still be called a solo, if one player is featured, or an instrumental break, if it's an ensemble.

...the sax player who steps forward to restate the melody in the middle of a song is also soloing.

Complete Idiot's Guide to Solos and Improvisation (Google Books)

A: The word you are looking for is a musical lead. Typically it is because that part will play at the same time as the vocals "lead"ing them. However, it qualifies regardless of the order they are in the song.
Incidentally, this is also why the main guitar is called the lead guitar. Not because it's the main one and thus the leader, but because it plays the lead part.

A: The closest musical term I can think of is eco: an effect in which a group of notes is repeated, usually more softly, and perhaps at a different octave, to create an echo effect.
What you describe also has some similarities with a call and response, but in that case the two musical phrases are usually different.

A: Informally, I might say to the lead "follow me after 3", meaning "start like I started, 3 bars later". The lead could then keep following me, duplicating me exactly, or diverge into a counterpoint.
To a technical audience, there are some precise words you can use. If the duplication is short-lived, that is the two voices start with the same melody (entering at different times) but diverge, imitation is appropriate:

The restatement in close succession of melodic figures in different voices in polyphonic textures

and:

A polyphonic musical texture in which a melodic idea is freely or strictly echoed by successive voices. A section of freer echoing in this manner if often referred to as a "point of imitation"; Strict imitation is called "canon."

If the imitation is more rigid, to the point of being an exact duplicate in a different voice, then canon is the better term. From Wikipedia:

One melody is strictly imitated by a second part after a delay in the entrance of the second part.  In order for the parts to end simultaneously, the canon may break down at the end of the composition.  The canonic parts may occur at the unison or some other interval.

A familiar a capella canon is "singing in the round", like Row Row Row Your Boat.
These terms have been around since at least the Renaissance, as both canon and imitation form an important part of the sacred liturgy (eg choral mass) and secular chants (eg English ayres).


text:
Q: how to show number one by one I have got this set of code here.
var qnum=[1,2,3,4,5,6,7,8,9,10];

$(":button").click(function () {
    if
    {
       ........
    }
    else
    {
        .......
    }
});

 jQuery.each(qnum , function(index, value){
            $("#question").html("Question " + index + "/10");
        });

My goal is to run a quiz. Each time the user answer a question, be it wrong or right, the question number increase by 1 till it reaches question 10.
How do I make it so that the show number show 1 by 1 after another.
Because for now, I put the code in, it run from 1 all the way to 10 without showing 2,3,4,5,6,7,8,9
How do I solve this problem?

A: You need to concatenate the current value with the $("#question").html() and then make it the html of #question.
        jQuery.each(qnum , function(index, value){
             $("#question").html($("#question").html() + " Question " + index + "/10");
        });

A: You need to do change the text in the click handler
var qnum = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    counter = 0;

$(":button").click(function () {
    if {........
    } else {.......
    }

    $("#question").html("Question " + qnum[counter++] + "/10");
});

Actually there is no need to have an array
var counter = 0;

$(":button").click(function () {
    if {........
    } else {.......
    }

    $("#question").html("Question " + (counter++) + "/10");
});


text:
Q: PHP variable inside of HTML string value - Why won't it work? Basically I'm a little confused to why this won't work, no errors or anything, it's just simply blank, it has worked before, but it's now deciding not to work it's just really strange.
This is what i'm trying to do: ($id does have a value and it's currently being echoed out on the page with no issue)
<input type="submit" name="submit" value="<?php $id ?>"/>

A: $id stores some value
echo $id outputs the value of $id.
<?= $id ?> is short for <?php echo $id ?>

A: because you are missing ECHO command between <?PHP  ?> tags
and in your HTML Code you are define <?PHP $id ?> but in your PHP code you don't have an ID you have
<input type="submit" name="submit" value="<?php echo $id; ?>"/>


text:
Q: vb.net error creating form I am currently creating a small piece of software for a little project. But when I am trying to open another form I get an error. I have attached all of the error and form code below. I literally only just started the project and I am getting these errors which I have never received before. I'll probably shoot myself in the foot for missing something really simple.
Error
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "WindowsApplication2.AddBookingForm.resources" was correctly embedded or linked into assembly "WindowsApplication2" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=WindowsApplication2
StackTrace:
   at WindowsApplication2.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
   at WindowsApplication2.My.MyProject.MyForms.get_AddBookingForm()
   at WindowsApplication2.MainForm.AddButton_Click(Object sender, EventArgs e) in C:\Users\Andrew\Documents\Visual Studio 2013\Projects\WindowsApplication2\WindowsApplication2\MainForm.vb:line 4
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at WindowsApplication2.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Resources.MissingManifestResourceException
   HResult=-2146233038
   Message=Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "WindowsApplication2.AddBookingForm.resources" was correctly embedded or linked into assembly "WindowsApplication2" at compile time, or that all the satellite assemblies required are loadable and fully signed.
   Source=mscorlib
   StackTrace:
        at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
        at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
        at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
        at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
        at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
        at System.Resources.ResourceManager.GetObject(String name)
        at WindowsApplication2.AddBookingForm.InitializeComponent() in C:\Users\Andrew\Documents\Visual Studio 2013\Projects\WindowsApplication2\WindowsApplication2\AddNewBooking.Designer.vb:line 234
        at WindowsApplication2.AddBookingForm..ctor()
   InnerException:

MainForm
Public Class MainForm

Private Sub AddButton_Click(sender As Object, e As EventArgs) Handles AddButton.Click
    AddBookingForm.Show()
End Sub

End Class

AddBookingForm
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class AddBookingForm
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
    Try
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
    Finally
        MyBase.Dispose(disposing)
    End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
    Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AddBookingForm))
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.Label3 = New System.Windows.Forms.Label()
    Me.Label4 = New System.Windows.Forms.Label()
    Me.Label5 = New System.Windows.Forms.Label()
    Me.Label6 = New System.Windows.Forms.Label()
    Me.Label7 = New System.Windows.Forms.Label()
    Me.Label8 = New System.Windows.Forms.Label()
    Me.SearchButton = New System.Windows.Forms.Button()
    Me.AddJobNoText = New System.Windows.Forms.TextBox()
    Me.AddNameText = New System.Windows.Forms.TextBox()
    Me.AddPhoneList = New System.Windows.Forms.ListBox()
    Me.AddAddressText = New System.Windows.Forms.TextBox()
    Me.AddTypeCombo = New System.Windows.Forms.ComboBox()
    Me.AddTimeCombo = New System.Windows.Forms.ComboBox()
    Me.AddDatePicker = New System.Windows.Forms.DateTimePicker()
    Me.AddOtherText = New System.Windows.Forms.TextBox()
    Me.AddAddButton = New System.Windows.Forms.Button()
    Me.AddExitButton = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    '
    'Label1
    '
    Me.Label1.AutoSize = True
    Me.Label1.Location = New System.Drawing.Point(24, 15)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(67, 13)
    Me.Label1.TabIndex = 0
    Me.Label1.Text = "Job Number:"
    '
    'Label2
    '
    Me.Label2.AutoSize = True
    Me.Label2.Location = New System.Drawing.Point(53, 51)
    Me.Label2.Name = "Label2"
    Me.Label2.Size = New System.Drawing.Size(38, 13)
    Me.Label2.TabIndex = 1
    Me.Label2.Text = "Name:"
    '
    'Label3
    '
    Me.Label3.AutoSize = True
    Me.Label3.Location = New System.Drawing.Point(5, 87)
    Me.Label3.Name = "Label3"
    Me.Label3.Size = New System.Drawing.Size(86, 13)
    Me.Label3.TabIndex = 2
    Me.Label3.Text = "Phone Numbers:"
    '
    'Label4
    '
    Me.Label4.AutoSize = True
    Me.Label4.Location = New System.Drawing.Point(43, 197)
    Me.Label4.Name = "Label4"
    Me.Label4.Size = New System.Drawing.Size(48, 13)
    Me.Label4.TabIndex = 3
    Me.Label4.Text = "Address:"
    '
    'Label5
    '
    Me.Label5.AutoSize = True
    Me.Label5.Location = New System.Drawing.Point(37, 285)
    Me.Label5.Name = "Label5"
    Me.Label5.Size = New System.Drawing.Size(54, 13)
    Me.Label5.TabIndex = 4
    Me.Label5.Text = "Job Type:"
    '
    'Label6
    '
    Me.Label6.AutoSize = True
    Me.Label6.Location = New System.Drawing.Point(58, 321)
    Me.Label6.Name = "Label6"
    Me.Label6.Size = New System.Drawing.Size(33, 13)
    Me.Label6.TabIndex = 5
    Me.Label6.Text = "Time:"
    '
    'Label7
    '
    Me.Label7.AutoSize = True
    Me.Label7.Location = New System.Drawing.Point(58, 357)
    Me.Label7.Name = "Label7"
    Me.Label7.Size = New System.Drawing.Size(33, 13)
    Me.Label7.TabIndex = 6
    Me.Label7.Text = "Date:"
    '
    'Label8
    '
    Me.Label8.AutoSize = True
    Me.Label8.Location = New System.Drawing.Point(0, 392)
    Me.Label8.Name = "Label8"
    Me.Label8.Size = New System.Drawing.Size(91, 13)
    Me.Label8.TabIndex = 7
    Me.Label8.Text = "Other Information:"
    '
    'SearchButton
    '
    Me.SearchButton.Location = New System.Drawing.Point(215, 12)
    Me.SearchButton.Name = "SearchButton"
    Me.SearchButton.Size = New System.Drawing.Size(59, 20)
    Me.SearchButton.TabIndex = 8
    Me.SearchButton.Text = "Search"
    Me.SearchButton.UseVisualStyleBackColor = True
    '
    'AddJobNoText
    '
    Me.AddJobNoText.Location = New System.Drawing.Point(93, 12)
    Me.AddJobNoText.Name = "AddJobNoText"
    Me.AddJobNoText.Size = New System.Drawing.Size(116, 20)
    Me.AddJobNoText.TabIndex = 9
    '
    'AddNameText
    '
    Me.AddNameText.Location = New System.Drawing.Point(93, 48)
    Me.AddNameText.Name = "AddNameText"
    Me.AddNameText.Size = New System.Drawing.Size(181, 20)
    Me.AddNameText.TabIndex = 10
    '
    'AddPhoneList
    '
    Me.AddPhoneList.FormattingEnabled = True
    Me.AddPhoneList.Location = New System.Drawing.Point(93, 84)
    Me.AddPhoneList.Name = "AddPhoneList"
    Me.AddPhoneList.Size = New System.Drawing.Size(181, 95)
    Me.AddPhoneList.TabIndex = 11
    '
    'AddAddressText
    '
    Me.AddAddressText.Location = New System.Drawing.Point(93, 194)
    Me.AddAddressText.Multiline = True
    Me.AddAddressText.Name = "AddAddressText"
    Me.AddAddressText.Size = New System.Drawing.Size(181, 73)
    Me.AddAddressText.TabIndex = 12
    '
    'AddTypeCombo
    '
    Me.AddTypeCombo.FormattingEnabled = True
    Me.AddTypeCombo.Items.AddRange(New Object() {"Pickup", "Delivery", "Tune-In", "Set-Up", "Antenna", "Other"})
    Me.AddTypeCombo.Location = New System.Drawing.Point(93, 282)
    Me.AddTypeCombo.Name = "AddTypeCombo"
    Me.AddTypeCombo.Size = New System.Drawing.Size(181, 21)
    Me.AddTypeCombo.TabIndex = 13
    '
    'AddTimeCombo
    '
    Me.AddTimeCombo.FormattingEnabled = True
    Me.AddTimeCombo.Items.AddRange(New Object() {"AM", "PM"})
    Me.AddTimeCombo.Location = New System.Drawing.Point(93, 318)
    Me.AddTimeCombo.Name = "AddTimeCombo"
    Me.AddTimeCombo.Size = New System.Drawing.Size(181, 21)
    Me.AddTimeCombo.TabIndex = 14
    '
    'AddDatePicker
    '
    Me.AddDatePicker.Location = New System.Drawing.Point(93, 354)
    Me.AddDatePicker.Name = "AddDatePicker"
    Me.AddDatePicker.Size = New System.Drawing.Size(181, 20)
    Me.AddDatePicker.TabIndex = 15
    '
    'AddOtherText
    '
    Me.AddOtherText.Location = New System.Drawing.Point(93, 389)
    Me.AddOtherText.Multiline = True
    Me.AddOtherText.Name = "AddOtherText"
    Me.AddOtherText.Size = New System.Drawing.Size(181, 61)
    Me.AddOtherText.TabIndex = 16
    '
    'AddAddButton
    '
    Me.AddAddButton.Location = New System.Drawing.Point(42, 459)
    Me.AddAddButton.Name = "AddAddButton"
    Me.AddAddButton.Size = New System.Drawing.Size(89, 23)
    Me.AddAddButton.TabIndex = 17
    Me.AddAddButton.Text = "Add Booking"
    Me.AddAddButton.UseVisualStyleBackColor = True
    '
    'AddExitButton
    '
    Me.AddExitButton.Location = New System.Drawing.Point(152, 459)
    Me.AddExitButton.Name = "AddExitButton"
    Me.AddExitButton.Size = New System.Drawing.Size(89, 23)
    Me.AddExitButton.TabIndex = 18
    Me.AddExitButton.Text = "Exit"
    Me.AddExitButton.UseVisualStyleBackColor = True
    '
    'AddBookingForm
    '
    Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
    Me.ClientSize = New System.Drawing.Size(283, 491)
    Me.Controls.Add(Me.AddExitButton)
    Me.Controls.Add(Me.AddAddButton)
    Me.Controls.Add(Me.AddOtherText)
    Me.Controls.Add(Me.AddDatePicker)
    Me.Controls.Add(Me.AddTimeCombo)
    Me.Controls.Add(Me.AddTypeCombo)
    Me.Controls.Add(Me.AddAddressText)
    Me.Controls.Add(Me.AddPhoneList)
    Me.Controls.Add(Me.AddNameText)
    Me.Controls.Add(Me.AddJobNoText)
    Me.Controls.Add(Me.SearchButton)
    Me.Controls.Add(Me.Label8)
    Me.Controls.Add(Me.Label7)
    Me.Controls.Add(Me.Label6)
    Me.Controls.Add(Me.Label5)
    Me.Controls.Add(Me.Label4)
    Me.Controls.Add(Me.Label3)
    Me.Controls.Add(Me.Label2)
    Me.Controls.Add(Me.Label1)
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
    Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
    Me.MaximizeBox = False
    Me.Name = "AddBookingForm"
    Me.Text = "Add New Booking"
    Me.ResumeLayout(False)
    Me.PerformLayout()

End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents SearchButton As System.Windows.Forms.Button
Friend WithEvents AddJobNoText As System.Windows.Forms.TextBox
Friend WithEvents AddNameText As System.Windows.Forms.TextBox
Friend WithEvents AddPhoneList As System.Windows.Forms.ListBox
Friend WithEvents AddAddressText As System.Windows.Forms.TextBox
Friend WithEvents AddTypeCombo As System.Windows.Forms.ComboBox
Friend WithEvents AddTimeCombo As System.Windows.Forms.ComboBox
Friend WithEvents AddDatePicker As System.Windows.Forms.DateTimePicker
Friend WithEvents AddOtherText As System.Windows.Forms.TextBox
Friend WithEvents AddAddButton As System.Windows.Forms.Button
Friend WithEvents AddExitButton As System.Windows.Forms.Button

Private Sub AddExitButton_Click(sender As Object, e As EventArgs) Handles AddExitButton.Click
    'AddJobNoText.Clear()
    'AddNameText.Clear()
    'AddOtherText.Clear()
    'AddAddressText.Clear()
    'AddPhoneList.Text = ""
    'AddTypeCombo.Text = ""
    'AddTimeCombo.Text = ""
    'Me.Close()
End Sub

End Class

A: Try below and Comment
Private Sub AddButton_Click(sender As Object, e As EventArgs) Handles AddButton.Click
  with AddBookingForm
     .Mdiparent = Me 'here me is the MDIParent form in your case `MainForm`
     .Show()
     .Focus()
  End With
End Sub


text:
Q: Can a probability distribution have infinite standard deviation? I believe $p[x]$ is a probability distribution, where
\begin{equation}
p[x] = \frac{1}{\pi (1+x^2)}
\end{equation}
since it's positive everywhere and integrates to 1 on $-\infty, \infty$.
The mean is 0 by symmetry, even though integrating $xp[x]$ on
$-\infty, \infty$ does not converge. This is "suspicious" since
$p[x]$ is supposed to be a probability distribution, but reasonable
because $xp[x]$ is $O(1/x)$ which is known to diverge.
The bigger problem is in computing the standard deviation. Since $x^2 p[x]$
also diverges, since $x^2 p[x]$ is $O(1)$.
If this isn't a probability distribution, why not? If it is, is its
standard deviation infinite?
The cumulative distribution function is $\arctan[x]/\pi$ if that helps.
Someone mentioned this might be a gamma distribution, but that isn't
clear to me.

A: The Cauchy distribution doesn't have a mean or variance, in that the integral doesn't converge to anything in $[-\infty,\infty]$. However, a distribution like $f(x)=\frac{2}{x^3}$ on $[1,\infty)$ has a mean, but the standard deviation is infinite.

A: To answer your question title: Yes, a probability distribution can have infinite standard deviation (see below).
Your example is a special case of the Cauchy distribution whose mean or variance does not exist. Set the location parameter to 0 and the scale to 1 for the Cauchy to get to your pdf.


text:
Q: SQL Server FILESTREAM performance SQL Server FILESTREAM has some known limitations.
1) Database mirroring does not support FILESTREAM.
2) For clustering, FILESTREAM filegroups must be put on a shared disk which defeats the purpose of creating the clusters.
Given these limitations in FILESTREAM is it advisable to build a FILESTREAM solution. Im looking to save and retrieve .5 million files in a FILESTREAM database (approx 1TB of disk size) which would be accessed simultaneously by approx 2000 users. Given the fact that the FILESTREAM cannot be clustered or mirrored how does one devise a scalable solution.
If I live with a non scalable solution what would be the performance of such a system. Can I serve up say 100 users with 100 1 MB files within a 5 second window?

A: Reality check: Issue 2 is a non-issue. In a cluster ALL data must be on shared discs, otherwise the cluster failover can not access the data. If that defeats the purpose fof a cluster you are invited to install a SQL Server cluster without shared discs. ALL data storage on clusters must be on shared discs. Has been like this since cluster service was first created for windows.
Which basically makes your conclusions already quite - hm - wrong.
You also need to make some mathmatics. 5th grade style.

Can I serve up say 100 users with 100
  1 MB files within a 5 second window?

Ignore SQL Server for a moment. Depending on how I read this thi is either 100mb or 10.000mb. Anyhow, 100mb in 5 seconds = 20mb per second, which runs around 200mbit. This is serious traffic. We taalkg of minimum 250 to 300mbit needed external bandwidth.


text:
Q: CSS HTML Split paragraph text to column in single tag I wanna make dynamic paragraph column text like this

but only display in html with :

    Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora

is that possible to do that in only using single tag p on html?
the text will be split when the content height exceeds 125px

A: add column-count: 2
p{ column-count: 2; }

check out this page

A:
Add column-count to paragraph.

p{
column-count: 2;
column-gap: 3rem;
}

    Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non numquam [do] eius modi tempora

A: An approach might be to use a row and two columns and display it as flex.
HTML:

paragraph one

paragraph two

CSS:
.row{
    display: flex;
}

.colmn{
    flex = 1;
}


text:
Q: Custom loop pagination links not working I'm bringing up an issue that could not be solved after googling for solutions over a few days. The goal I have to meet is to output a pagination for a custom post type named office-magazines with working links. I already managed to output the pagination but clicking any of the links within it takes me to the top page.
Here's the code I embedded into the page template:
   <?php
        global $wp_query, $paged;
        $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;

        $args = array(
          'post_type' => 'office-magazines',
          'posts_per_page' => 9,
          'paged'          => $paged,
          'has_archieve'  => true
        );

        $catquery = new WP_Query($args);
   ?>

   <p class="pagination">
    <?php echo custom_pagination_bar( $loop ); ?>
  </p>

Passing 'post_type' => 'office-magazines' is meant to filter out all posts apart from the ones belonging to the custom post type, 'office-magazines'.
Using the next code in functions.php, I intended to define the function of the pagination:
function custom_pagination_bar($custom_loop) {
  $big = 999999999;
 echo paginate_links( array(
    'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
    'format' => '?paged=%#%',
    'current' => max( 1, get_query_var('paged') ),
    'total' => $custom_loop->max_num_pages
) );
}

The same code works for the main post pagination which is output in a separate template page but fails for the custom post pagination.
Could someone please help me find a solution to getting the custom post pagination links to work?
Hoping for some advice,
Ead

A: Use the following:
$args = array(
  'post_type' => '[custom post type name]',
  'paged' => $paged,
  'has_archieve' => true
);
$catquery = new WP_Query($args);
echo pagination_bar($catquery);

A: The only solution that worked for me happens to add an action filter to functions.php in the following format:
add_action('pre_get_posts', function($q){
    if (is_category()){
        if(is_category('NEWS')):
            $q->set( 'posts_per_page', 2 );
        endif;
    }
});


text:
Q: Saber si se encuentra una palabra en una cadena en php Tengo el siguiente codigo:
$msg = 'Hola :1: quetal??, :2:';
$emoticones = array(':1:',':2:',':3:');
$cntidademoticon = explode(' ', $msg);
foreach ($cntidademoticon as $string) {
    echo '
'.$string.'
';
}

Lo que estoy buscando es contar las cantidades de palabras que coinciden con la variable $emoticones.

A: Esto se puede hacer fácilmente con la función de PHP strpos().
Los datos de entrada son primero el pajar (en tu caso, la variable $msg) y la aguja (el arreglo), te dejo el siguiente ejemplo:
<?php
    $msg = 'Hola :1: quetal??, :2:';
    $emoticones = array(':1:',':2:',':3:');
    $contador = 0;
    $lenght = count($emoticones);
        for ($i = 0; $i < $lenght; $i++){
            if(strpos($msg, $emoticones[$i]) !== false){
                $contador++;
            }
        }
echo "Número de coincidencias: ". $contador;
?>

Para el caso de que queramos saber el número de veces que se repite una misma cadena dentro de otra, usaremos la función de PHP substr_count(), es el mis procedimiento, solo que ahora crearemos un auxiliar que guarde el número de coincidencias y se sume con el acumulador (y en caso de que no existe, se suma 0, por eso es importante inicializarlo al inicio del ciclo en 0):
<?php
    $msg = 'Hola :2: quetal??, :2: :1:';
    $emoticones = array(':1:',':2:',':3:');
    $acumulador = 0;
    $aux = 0;
    $lenght = count($emoticones);
        for ($i = 0; $i < $lenght; $i++){
            $aux = 0;
            $aux = substr_count($msg, $emoticones[$i]);
            $acumulador = $acumulador + $aux;
        }
echo "Número de coincidencias: ". $acumulador;
?>

EDIT: Cabe aclarar que el acumulador es solamente si se usará un array de strings para buscar dentro de otro string


text:
Q: Split de una cadena..shell Hola que tal tengo la siguiente Cadena de numeros 638283125322
y necesito obtener lo siguiente
6.3.8.2.8.3.1.2.5.3.2.2
Como puedo hacer?

A: Resuelto Gracias
    #!/bin/sh
numero=638283125322
echo ${numero}
total=${#numero}

for (( c=0; c<=$total; c++ ))
do
   punto+=${numero:$c:1}.
done
salida="${punto:0:${#punto}-2}"
echo ${salida}

A: Utilice la función , str_split(numero), ésto le devolverá un array con el númeri dividido uno a uno, y ahí si hace el for para el nuevo array y concatena el punto normal.


text:
Q: Code for Android Screen Size doesn't work I have tried the codes below for finding out the screen size but none worked for me. The interface also goes out of proportion for different devices of the same screen sizes and same dimensions. I don't have actual devices, I am using the devices with screen sizes/dimensions provided by the AVD. The codes work for dimensions but it doesn't give the correct screen size. The screen size it calculates for a 4 inch screen is 3.9 inches (round figure) and the screen size for a 3.7 inch screen is also 3.9 inches. The interface code for the Nexus S (4", 480x800: hdpi) doesn't work for the 4" WVGA (480x800: hdpi) where both have the same screen size and same dimensions.
Could you please help me solve this problem.
DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    int widthInch=dm.widthPixels;
    int heightInch=dm.heightPixels;
    int dens=dm.densityDpi;
    double wi=(double)widthInch/(double)dens;
    double hi=(double)heightInch/(double)dens;
    double x = Math.pow(wi,2);
    double y = Math.pow(hi,2);
    double screenInches = Math.sqrt(x+y);
    screenInches = (double)Math.round(screenInches * 10) / 10;

    int widthPix = (int) Math.ceil(dm.widthPixels * (dm.densityDpi / 160.0));

    Toast.makeText(getApplicationContext(), width+"*"+height+" - "+widthPix+
            " - " +screenInches,
            Toast.LENGTH_LONG).show();

  //================================================================
    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    //get density per inch for example: 120 , 160 , 240
    float mXDpi = metrics.xdpi; // 160 The exact physical pixels per inch of the screen in the X dimension.
    float mYDpi = metrics.ydpi;

    //density
    int nDensity = metrics.densityDpi; // 160 screen density expressed as dots-per-inch

          float  mMetersToPixelsX = mXDpi / 0.0254f; // 1 inch == 0.0254 metre
          float  mMetersToPixelsY = mYDpi / 0.0254f;

    //Resolution
    //The total number of physical pixels on a screen.
    int wPix = metrics.widthPixels; // 320 The absolute width of the display in pixels.
    int hPix = metrics.heightPixels; // 480 The absolute height of the display in pixels.
    int nWidthDisplay = (wPix < hPix)? wPix : hPix;

    float nWidthScreenInInch = wPix / mXDpi; //320 / 160 == 2.0 in inch.
    float nHeightScreenInInch = hPix / mYDpi; //480 / 160 == 3.0 in inch.

    double screenInches = Math.sqrt( nHeightScreenInInch*nHeightScreenInInch +
            nWidthScreenInInch * nWidthScreenInInch);

    screenInches = (double)Math.round(screenInches * 10) / 10;

    Toast.makeText(getApplicationContext(),"Screen size: "+screenInches,
            Toast.LENGTH_LONG).show();

    //================================================================
    DisplayMetrics metrics=new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    float hgt=metrics.heightPixels/metrics.xdpi;
    float wdth=metrics.widthPixels/metrics.ydpi;
    double screenInches = FloatMath.sqrt(hgt*hgt+wdth*wdth);
    screenInches = (double)Math.round(screenInches * 10) / 10;

    Toast.makeText(getApplicationContext(),width+"*"+height+" - "+screenInches,
                Toast.LENGTH_LONG).show();
    //===============================================================

How to get android device screen size?
Calculating android screen size?
Detect 7 inch and 10 inch tablet programmatically

A: DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    final int height = metrics.heightPixels;
    int width = metrics.widthPixels;


text:
Q: regex to check if string doesn't contain non consecutive numbers on partial string I am trying to create regex for below case:

*

*Input string consisting of all numbers, max length is 30.

*Check if in first 10 digits, any number is not consecutively appearing equal or more than 3 in length
eg.
1234567 --> is good (no consecutive number)
1234456 --> is good (4 appears consecutive but length is less than 3)
1234445 --> is bad  (4 appears consecutive and length is equal or greater than 3)
12345678904444 --> is good (4 appears consecutive and length is greater than 3 however it is accepted since it is appearing after cut off of 10 digit)
The regex I came up with is below. pardon me for my mistake if any in regex, i am still in learning mode with regexes:
https://regex101.com/r/rv5e6a/1
currently it is getting applied all across the string but not sure how to limit so that regex can be applied only for first 10 digits only.

A: You can use
^(?!\d{0,7}(\d)\1{2})\d{1,30}$

See the regex demo. Note that \d{0,7} in the lookahead will allow checking for repeated digits only within the first ten. More details:

*

*^ - start of string

*(?!\d{0,7}(\d)\1{2}) - a negaitve lookahead that fails the match if there are three same digits after zero to seven digits immediately to the right of the current location

*\d{1,30} - one to thirty digits

*$ - end of string.

A: ^(?:(\d)(?!\1{2})){1,9}$|^(?:(\d)(?!\2{2})){10}\d*$

regex101 link
Explanation:
^              # beginning of the line
  (?:          # start of a non-capturing group
    (\d)       # a single digit in a group that we can refer to with \1 later on
    (?!\1{2})  # not followed by the digit in the \1 group repeated twice
  ){1,9}       # repeat the non-capturing group 1-9 times
$              # end of the line
|              # OR
^              # beginning of the line
  (?:          # start of a second non-capturing group
    (\d)       # a single digit in a group that we can refer to with \2 later on
    (?!\2{2})  # not followed by the digit in the \2 group repeated twice
  ){10}        # repeat the non-capturing group 10 times
\d*            # the rest of the string can be more digits
$              # end of the line

The important parts of the regex above makes sure that a given digit is not followed by the same digit two more times ^(?:(\d)(?!\1{2}). But, because we only care about the first 10 digits, we need to handle this in two cases.

*

*in the first case, we have a string of digits that is less than 10 characters, so we want our pattern to repeat 1-9 times and then hit the end of the line.

*in the second case, we have a string of digits that is 10 or more characters and then there might be even more characters after that that we don't care about.

We need to keep these two cases separate because we don't want to exclude the cases where there are fewer than 10 characters total in the string.


text:
Q: Hashing a password in java and trying to convert in string I actually have a problem with hashing a password and trying to convert in string to put it in a database.
Currently I have this code
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            byte[] hash = digest.digest(motsDePasse.getBytes(StandardCharsets.UTF_8));
            String fileString = Base64.getEncoder().encodeToString(hash);

The deal is that it does not give me the good hash. Let's say I try to hash "12345". It should give me 5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5.
But it actually return WZRHGrsBESr8wYFZ9sx0tPURuZgG2lmzyvWpwXPKz8U=

A: try using a hex encoder
    MessageDigest digest = MessageDigest.getInstance("SHA-256");
    byte[] hash = digest.digest("12345".getBytes(StandardCharsets.UTF_8));

    String hex = DatatypeConverter.printHexBinary(hash);
    System.out.println(hex);

output
5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5

A: You are Base64 encoding it.  If you Hex encode it, you will get the output you are looking for.

A: You're encoding your bytes in base 64. If you want to encode it in hexadecimal, try here: Java code To convert byte to Hexadecimal. If you're putting into a database as a string though, base64 should be fine for your needs.