text:
Q: Set same picklist value We are planning to set a new picklist field with the same values as the recordtype field. In order to keep the old values we need to (temporary) update the values of the new filed with the actual values of the recordtype field for historic values, and then update the values of the recordtype field and keep the old values in the new picklist field. Any ideas?

A: *

*Use Dataloader or run a script to update the new Picklist Field with the RecordType.DeveloperName - you can use a Report or a simple SOQL query to pull the Data out to Excel sheet (this way you will have Backup too..)  then you have your RecordType old Values in Place

*Now you can just update all records with the Master RecordType you want.  BTW this can be done in the same operation.


text:
Q: hover and float element last week I coding a menu bar for my blog at http://iHMahmoodi.blog.ir
but for social buttons it's going to wrong and I think it's about float element!
I try to fix it with adding some width or more property but it's not work!
you can do it yourself with inspect element on my blog.
look to below image of my blog to know about my problem
http://i.stack.imgur.com/ntjIH.png
another question is near the rss image it's broad a lot of space on the right hand and if move you mouse between phone number and social button, all about rss!!
thanks a lot!

A: This will make them equal size and it list-image fits right to text
Edit with paddings you get your icons like picture below.
li.fb,
li.fb li {
    box-sizing: border-box;
    width: 150px;
    padding-left: 0px !important;
    padding-right: 0px !important;
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: php create certificate signing request into file error/warning I need to create a certificate signing request to file but last line give error when run:
Warning: openssl_csr_export_to_file() expects parameter 1 to be resource, boolean given

Any idea? this is the code, it's php 7.04 - wamp.

    <?php
    $subject = array(
    "commonName" => "example.com",
    );
    $private_key = openssl_pkey_new(array(
    "config" => "C:/wamp/bin/php/php7.0.4/extras/ssl/openssl.cnf",
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA
    ));

    $csr = openssl_csr_new($subject, $private_key, array('digest_alg' =>
    'sha384') );
     openssl_pkey_export_to_file($private_key, 'example-priv.key');
     // Along with the subject, the CSR contains the public key corresponding to
     // the private key
    openssl_csr_export_to_file($csr, 'example-csr.pem');

A: Corrected:
$subject = array(
    "commonName" => "example.com",
);

// vars to make private key
$private_key = openssl_pkey_new(array(
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA
));

// in config you put path to openssl.cnf
$Configs = array(
    'config' => 'C:/wamp/bin/php/php7.0.4/extras/ssl/openssl.cnf',
    'digest_alg' => 'sha2',
    'x509_extensions' => 'v3_ca',
    'req_extensions' => 'v3_req',
    'encrypt_key' => true,
    'encrypt_key_cipher' => OPENSSL_CIPHER_3DES
);

$csr = openssl_csr_new($subject , $private_key,  $Configs );

openssl_pkey_export_to_file($private_key, 'priv.key');

// openssl_csr_export_to_file($csr, 'example-csr.pem');
// better to specify path
openssl_csr_export_to_file($csr, 'C:/wamp/example-csr.pem' );

/*
or view it:
openssl_csr_export($csr, $csrout);  //  and var_dump($csrout);
echo $csrout;
*/

A: Improved but not sure yet if all steps result in correct keys/files (someone can look at it?):
<?php
echo '<pre>'; error_reporting(E_ALL); ini_set('display_errors', '1');

$dn = array(
    "countryName" => "GB",
    "stateOrProvinceName" => "Greater London",
    "localityName" => "London",
    "organizationName" => "XY Ltd",
    "emailAddress" => "ab@xy.com"
);

$Configs = array(
    'config' => 'C:/wamp/bin/php/php7.0.4/extras/ssl/openssl.cnf',
    'digest_alg' => 'sha2',
    'x509_extensions' => 'v3_ca',
    'req_extensions' => 'v3_req',
    'encrypt_key' => true,
    'encrypt_key_cipher' => OPENSSL_CIPHER_3DES
);

$privateKey = openssl_pkey_new([
    "config" => "C:/wamp/bin/php/php7.0.4/extras/ssl/openssl.cnf",
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA,
]);

openssl_pkey_export($privateKey, $privKey, null, [
    "config" => "C:/wamp/bin/php/php7.0.4/extras/ssl/openssl.cnf",
]);

$a_key = openssl_pkey_get_details($privateKey);

// print_r($a_key);
// print_r($privKey); // Just to test output

file_put_contents('keys/public.key', $a_key['key']);
file_put_contents('keys/private.pem', $privKey);

$csr = openssl_csr_new($dn, $private_key, $Configs);
// var_dump($csr);

openssl_csr_export_to_file($csr, 'C:/wamp/www/php/keys/public.csr' );

openssl_free_key($privateKey);


text:
Q: How to access class fields of a class that I only know it by its string name? For instance, I have a class called "My_Class_X123.java" like this :
public class My_Class_X123    // This file was generated by a java program
{
  static String ABC[]={"1","2",...};
  int XYZ=0;
}

When I wrote my program I didn't know there would be a class by this name, but at run time I found out a class by the name of "My_Class_X123.java" exists and I want to use its fields such as ABC and XYZ above, how to get those values ?

OK, I got the answer, it's something like this :
  try
  {
    Class myClass=Class.forName("My_Class_X123");
    Field fields[]=myClass.getDeclaredFields();
    String New_ABC[]=String[].class.cast(fields[0].get(String[].class));
  }
  catch (Exception e) { e.printStackTrace(); }

Wouldn't it be nice to have some sample code like this in the java doc, to show user how to do it !
Frank

A: You need to use Reflection. A while back I wrote some JSTL tag utilities that does this sort of thing. One function checks to see if a class is an instance of a passed-in string (instanceof basically). The other checks to see whether a class has a specified property (hasProperty). The following code snippet should help:
//Checks to see if Object 'o' is an instance of the class in the string "className"
public static boolean instanceOf(Object o, String className) {
    boolean returnValue;

    try {
        returnValue = Class.forName(className).isInstance(o);
    }

    catch(ClassNotFoundException e) {
        returnValue = false;
    }

    return returnValue;
}

//Checks to see if Object 'o' has a property specified in "propertyName"
public static boolean hasProperty(Object o, String propertyName) {
    boolean methodFound = false;
    int i = 0;

    Class myClass = o.getClass();
    String methodName = "get" + propertyName.toUpperCase().charAt(0) + propertyName.substring(1);
    Method[] methods = myClass.getMethods();

    while(i < methods.length && !methodFound) {
        methodFound = methods[i].getName().compareTo(methodName) == 0;
        i++;
    }

    return methodFound;
}

Pay particular attention to the Class.forName method in the first method (which loads and initializes a class) and getMethods() method in the second function, which returns all methods defined for a class.
What you probably want is Class.forName which also initializes the class. After that you can use newInstance to get a new instance of that class (if you need one). To access the fields, you need to use the Method objects that you got from getMethod(). Use the invoke method on those objects. If those methods are getter methods, then you now have access to the field you want.
EDIT
After looking at the code in your question, I realized that you need getters and setters for those attributes. So assuming you have getABC and getXYZ defined, here is a somewhat contrived example:
public Object reflectionDemo(String className, String getter) throws ClassNotFoundException, NoSuchMethodException {

   Object fieldValue;
   Class myClass = Class.forName(className);
   Object myClassInstance = myClass.newInstance(); //to get an instance of the class

   if(myClassInstance instanceof My_Class_X123) {
      //null because we are not specifying the kind of arguments that class takes
      Method getterMethod = myClass.getMethod(getter, null);
      //null because the method takes no arguments
      //Also in the scenario that the method is static one, it is not necessary to pass in an instance, so in that case, the first parameter can be null.
      fieldValue = getterMethod.invoke(myClassInstance, null);
   }

   return fieldValue;
}

The above approach is more generic. If you only want the fields, then you can use the method James described:
myClass = null;
try {
  myClass = Class.forName(className);
  Field[] fields = myClass.getDeclaredFields();

  for(Field field : fields) {
    //do whatever with the field. Look at the API reference at http://java.sun.com/javase/6/docs/api/java/lang/reflect/Field.html
  }
}

catch(Exception e) {
  //handle exception
}

A: Use java.lang.reflect. First use ClassLoader to get a Class for the class, then you can call newInstance to get an object, then you can use the reflection interfaces to get the fields.
A comprehensive tutorial live here.

A: If you just need the class fields you don't even need to create an instance, just as long as you use reflection to get the Class you can use getDeclaredFields() method to get the name of the fields and their values, e.g.
Class myClass = null;

try {
    myClass = Class.forName("package.ClassName");
    Field[] fields = myClass.getDeclaredFields();

    for (Field field : fields) {
         System.out.println("Field type is: " + field.getType());
         System.out.println("Field name is: " + field.getName());
    }
} catch (Exception e) {
}


text:
Q: Copy and paste data to rearrange a spreadsheet Here's a screenshot that demonstrates the problem

Here's a copy of the spreadsheet.
https://www.dropbox.com/s/9qihuvbe5c80su4/Data_rearrange_trial.xlsm?dl=0
Each spreadsheet relates to a single university 'unit' and holds data on the performance of a sample of students within a set number of 'traits'. The traits are organised in columns that are adjacent to one another and for data processing purposes I need to copy them so they are all in a single column. I also need to replicate each student's row of 'label' data next to their copied 'trait' data. I also need to copy the trait names or labels as well and paste them in the appropriate position.
1- I've used user input to define the parameters of what needs to be copied (all the spreadsheets have a similar set up). Is there any way to detect the parameters of the copy ranges and paste ranges?
2- At some point in the macro I need to tell it the name of the worksheet I'm working in (Set TargetWorkSheet = Worksheets("Input Data")). Is there a way to eliminate the need for an explicit naming of "Input Data" for example something like (ActiveWorkBook) or something along those lines?
3- This is a sort of follow on from question 2. I'm going to be using the macro in multiple spreadsheets. What's the best way to make it universally available, so I don't have to copy and paste code repeatedly from spreadsheet to spreadsheet.
4- Are there better ways to implement this macro? I made sure to make the code efficient (e.g. I was looping from cell to cell and then changed that to work on ranges instead). Any other good practice that I've missed?
Sub Rearrange()

Dim CopyRowNr As Integer                'Variable determining the row coordinate where data is to copied from.
Dim CopyColNr As Integer                'Variable determining the column coordinate where data is to be copied from.
Dim RecordsNr As Integer                'Variable determining the number of students and thus sets the number of row copy operations (nested while loop)
Dim TraitsNr As Integer                 'Variable determining the number of traits to be copied and sets the number of copy repetitions (first while loop)
Dim PasteRowNr As Integer               'Variable determining the row coordinate where the data is to pasted to.
Dim PasteColNr As Integer               'Variable determining the column coordinate where the data is to be pasted to.
Dim CopyRowCounter As Integer           'Counter for the nested while loop that cycles through each data-set (comprised of 3 columns and multiple rows).
Dim CopyColCounter As Integer           'Counter for the first while loop that cycles from one trait data-set to the next
Dim CopyColCounterLim As Integer        'The iteration limit for the first while loop
Dim CopyRowCounterLim As Integer        'The iteration limit for the nested while loop
Dim CourseRowLabelCol As Integer        'Variable to determine row coordinates for copying the row labels
Dim CourseRowLabelRow As Integer
Dim UnitRowLabelCol As Integer
Dim UnitRowLabelRow As Integer

Dim TraitsCopyRange As Range            'Range to copy traits data from
Dim TraitsPasteRange As Range           'Range to paste traits data into
Dim CourseRowLabelsCopyRange As Range   'Range to copy course info from
Dim CourseRowLabelsPasteRange As Range  'Range to paste course info into
Dim UnitRowLabelsCopyRange As Range     'Range to copy unit info from
Dim UnitRowLabelsPasteRange As Range    'Range to copy unit info into

Dim TargetWorkSheet As Worksheet

Set TargetWorkSheet = Worksheets("Input Data")

RecordsNr = InputBox("Enter the number of students recorded")       'User input to define operational parameters x 3
CopyRowNr = InputBox("Enter the number of first row of data")
CopyColNr = InputBox("Enter number of first column of data")
TraitsNr = InputBox("Enter the number of AoL traits recorded") - 1  'User input, but '1' is deducted because the first trait column remains in place and doesn't need copying.

PasteRowNr = CopyRowNr + RecordsNr                                           'Operational parameters calculated from input values x 7
PasteColNr = CopyColNr - 3                                                   ' 3 column offset from the copy column. Consider pros and cons of defining the offset of 3 as a variable.
CopyColCounterLim = TraitsNr
CourseRowLabelCol = CopyColNr - 6                                            ' 6 column offset from the copy column
CourseRowLabelRow = CopyRowNr
UnitRowLabelCol = CopyColNr - 11                                             ' 11 Column offset from the copy column
UnitRowLabelRow = CopyRowNr

Cells(CopyRowNr - 2, CopyColNr - 3).Copy        ' One-time operation to copy the trait number of the first trait column to the row label area
Cells(CopyRowNr, PasteColNr - 4).Select
ActiveSheet.Paste

While CopyColCounter < CopyColCounterLim

       Cells(CopyRowNr - 2, CopyColNr).Copy            'Copy PLO Trait labels
       Cells(PasteRowNr, PasteColNr - 4).Select        'Select and paste PLO Trait with a column offset of -4 and on the same row as the paste row for this iteration.
       ActiveSheet.Paste

        With TargetWorkSheet

          Set TraitsCopyRange = Range(Cells(CopyRowNr, CopyColNr), Cells(CopyRowNr + RecordsNr, CopyColNr + 2))             'Defining the ranges to copy the traits from and paste them into as offsets of the main parameters input
          Set TraitsPasteRange = Range(Cells(PasteRowNr, PasteColNr), Cells(PasteRowNr + RecordsNr, PasteColNr + 2))

            TraitsCopyRange.Cut                 'Copy and paste trait data
            TraitsPasteRange.Select
            ActiveSheet.Paste

          Set CourseRowLabelsCopyRange = Range(Cells(CopyRowNr, CourseRowLabelCol), Cells(CopyRowNr + RecordsNr - 1, CourseRowLabelCol + 2))  'Defining the ranges to copy the course info row labels from and paste them into as offsets of the main parameters input
          Set CourseRowLabelsPasteRange = Range(Cells(PasteRowNr, CourseRowLabelCol), Cells(PasteRowNr + RecordsNr, CourseRowLabelCol + 2))

            CourseRowLabelsCopyRange.Copy
            CourseRowLabelsPasteRange.Select
            ActiveSheet.Paste

          Set UnitRowLabelsCopyRange = Range(Cells(CopyRowNr, UnitRowLabelCol), Cells(CopyRowNr + RecordsNr - 1, UnitRowLabelCol + 1)) 'Defining the ranges to copy the unit info row labels from and paste them into as offsets of the main parameters input
          Set UnitRowLabelsPasteRange = Range(Cells(PasteRowNr, UnitRowLabelCol), Cells(PasteRowNr + RecordsNr, UnitRowLabelCol + 1))

            UnitRowLabelsCopyRange.Copy
            UnitRowLabelsPasteRange.Select
            ActiveSheet.Paste

        PasteRowNr = PasteRowNr + RecordsNr 'Shifting the PasteRowNumber to the next position in the spreadsheet.

        End With

    CopyColNr = CopyColNr + 3 'Shifting the Copy Column Number to the next position in the spreadsheet

    'CopyRowCounter = 0
    CopyColCounter = CopyColCounter + 1

Wend

End Sub

A: For tasks like this Microsoft introduced GetAndTransform in Excel 2016. To use this functionality in earlier Versions (2010 and 2013) you have to install Power Query as Add-In.
Looks that you basically have to perform a pivot-operation on multiple columns here. Please find an example here: https://www.dropbox.com/s/8u0i7mo2kycia4q/SO_Data_rearrange_trial.xlsm?dl=0
The code is pretty basic:
let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    CreateStudentID = Table.AddColumn(Source, "StudID", each Text.Replace([MMU ID Number], "MMUID", "")),
    ChangeToNumber = Table.TransformColumnTypes(CreateStudentID,{{"StudID", type number}}),
    FillDownPLO = Table.FillDown(ChangeToNumber,{"PLO"}),
    UnpivotCat = Table.UnpivotOtherColumns(FillDownPLO, {"Unit Code", "Unit Description", "Department", "Cluster", "PLO", "Course Name", "Course Code", "MMU ID Number", "StudID"}, "Attribute", "Value"),
    MergePLOWithCat = Table.CombineColumns(UnpivotCat,{"PLO", "Attribute"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    ReorderCols = Table.ReorderColumns(MergePLOWithCat,{"StudID", "Unit Code", "Unit Description", "Department", "Cluster", "Course Name", "Course Code", "MMU ID Number", "Merged", "Value"}),
    Pivot = Table.Pivot(ReorderCols, List.Distinct(ReorderCols[Merged]), "Merged", "Value")
in
    Pivot

Actually you could do this all using the UI only.
Also if this is all made for further dataprocessing, you could collect your data from different workbooks all into one Excel-sheet.


text:
Q: Reading last five lines of a csv file I'm using the following code to read the first 1000 lines - only the first 6 columns - from csv and keep them in the array P2(,):
fName = "c:\temp\filexx.csv"
        If System.IO.File.Exists(fName) = True Then
            Dim tmpstream As StreamReader = File.OpenText(fName)
            TextLine = tmpstream.ReadToEnd().Split(Environment.NewLine)
            SplitLine = Split(TextLine(0), ",")
            For X = 0 To 999  'reading only the first 1000 lines
                strline = TextLine(X).Split(",")
                For Y = 0 To 5 '6 columns
                    P2(X, Y) = strline(Y)
                Next
            Next
            tmpstream.Close()
        Else
            MsgBox("file doesn't exist")
        End If

But I'm interested in the last 5 lines. So, I'm supposed to change the
TextLine = tmpstream.ReadToEnd().Split(Environment.NewLine)

to sth similar to
TextLine = tmpstream.ReadLine(fName.Length - 6)

but I have no idea how to do it.
Thank you very much for your hints, your links, your patience and your clearness

A: The only way to read the last 6 lines of a CSV is to read all lines, and keep track of the last 6 that you read.
Since the CSV format allows for each line to be of variable width, there is no way to compute the correct file offset to just load the last 6 lines.
You are currently reading in the entire file, creating an array TextLine containing all lines
TextLine = tmpstream.ReadToEnd().Split(Environment.NewLine)

Simply access the last 6 elements of TextLine to get your answer.

A: I have used the fllwing:
 If System.IO.File.Exists(fName) = True Then
            Dim tmpstream As StreamReader = File.OpenText(fName)
            Dim lineCount = File.ReadAllLines(fName).Length
            TextLine = tmpstream.ReadToEnd().Split(Environment.NewLine)
            SplitLine = Split(TextLine(0), ",")
            For X = 0 To 4
                strline = TextLine(lineCount - X - 1).Split(",") 'trying to read the last 5 lines
                For Y = 0 To 5 '6 columns
                    P1(X, Y) = strline(Y)
                Next
            Next
            tmpstream.Close() 'close reader
        Else
            MsgBox("File doesn't exist")
        End If

But there is no way to read the last line. If I use strline=TextLine(lineCount - X) it breaks at P1(X, Y) = strline(Y) with X=0 and Y=1 I suppose because of trying to read strlline=TextLine(lineCount).
Thank you for your help.
I'm not sure of having broken the rules of the forum but I haven't found another way for writing the code.


text:
Q: How to convert these mapping coordinates I have an older database at work and I've been asked to map the
recorded GPS coordinates for each record.  Unfortunately, I can't
figure out the map coordinates that were recorded.
As an example, 1301 Calle Oriente in Milpitas California shows as:
06158991  and 01987998
If I look at google maps, 1301 Calle Oriente is 37.446687, -121.886884
Is there a website that I convert 06158991 and 01987998 to a map like
google maps?  Is this a valid mapping coordinate format?  If so,
please let me know what format this is.

A: With EPSG:2227 NAD83 / California zone 3 (ft US) The result looks quiet good:

EPSG:2872 and 3494 have the same proj definition.
You can load the data as delimited text layer into QGIS, assign projection EPSG:2227 to it, and Rightclick -> Save As ... to WGS84 (EPSG:4326) under a different name. Just take care that usually x is positive East, and y is North.


text:
Q: How to call a DataFrame that is build in another module/method? probably a simple question but I can't find any solution.
I do have a file called irc_daten.py, where I built a class, called IrcData, that contains various methods. This methods collect several data in DataFrames that will be used in many files by importing the methods. But somehow I can't call this DataFrames.
This is irc_daten.py:
class IrcDaten():

    def __init__(self):
        pass

    def stammdaten():
        global stammdaten
        stammdaten = pd.read_excel(path_stammdaten)

But using this DataFrame in another file doesn't seem to work:
from irc_daten import IrcDaten
IrcDaten.stammdaten()

print(stammdaten)

NameError: name 'stammdaten' is not defined

Any ideas? Thanks in advance.

A: try this instead:
class IrcDaten():

    def __init__(self):
        pass

    def stammdaten():
        stammdaten = pd.read_excel(path_stammdaten)
        return stammdaten

from irc_daten import IrcDaten
df = IrcDaten.stammdaten()

A: Try importing in this way:
from irc_daten import IrcDaten as ID
y=ID.stammdaten()

print(y)


text:
Q: Overriding default profile for new customer portal users I am attempting to use my portal to check a contact's field to specify which profile I would like them to posses. Right now a User can only be created if you have entered a value that matches a particular field on the contact object. If the value passed in exists on a contact record in the system - you must supply the same e-mail address attached to that contact. If all these hold true a user is created using the aforementioned contact.
Here is the code attempting to assign profile Ids before creating the user. (I will clean up the code to not use hardcoded IDs after I know this will work).
User u = new User();
u.Username = username;
u.Email = email;
u.CommunityNickname = username;
u.ContactId = c.Id;
u.LastName = c.LastName;
u.FirstName = c.FirstName;

system.debug('Preparing to assign Profile');
if(c.Value_To_Check__c!= null){
    if(c.Value_To_Check__c== 'Value 1'){
           system.debug('Value 2 found. Assigning profile ID');
           u.ProfileId = '00ei00000017KeH';
    }
    else if(c.Value_To_Check__c== 'Value 2'){
           system.debug('Value 2 found. Assigning profile ID');
           u.ProfileId = '00ei00000014qTw';
    }
    else if(c.Value_To_Check__c== 'Value 3'){
           system.debug('Value 3 found. Assigning profile ID');
           u.ProfileId = '00ei00000017Jrq';
    }
    else if(c.Value_To_Check__c== 'Value 4'){
            system.debug('Value 4 found. Assigning profile ID');
            u.ProfileId = '00ei0000001DZOg';
    }
}
String accountId;
if(c.AccountId == null){
    accountId = PORTAL_ACCOUNT_ID;
    system.debug('Using default portal account ID');
}
else{
    accountId = c.AccountId;
    system.debug('Using contacts account Id: ' + c.AccountId);
}
String userId;
try{
    system.debug('Creating portal user');
    userId = Site.createPortalUser(u, accountId, password);
    system.debug('Portal user created: ' + userId);
}

Currently it keeps creating users with the default profile type instead of the ones specified by u.ProfileId. I am seeing that the debug log is printing out the "Value X found. Assigning profile Id."
Anyone come across something like this? Is it even possible to do what I am doing. I cannot take off the default profile setting or else self-registration is not possible.
Thanks in advance.

A: Looks like the Site.createPortalUser neglects the provided profile and always sets the default profile.
Why don't you add these lines (you'll probably have to put them in @future context):
User updateUser = new User(Id=userId,profile=u.profileId);
update updateUser;


text:
Q: Thumbnails Image Slider Here This is what I am trying. On Click of each thumbnail I have to display the Larger Image. I need some help so that I can know my issue why the click method is not working fine for me.
Thumbs Part HTML

Larger Images HTML

Jquery
$("#thumbs img").click(function(){
    $("#thumbs img.clicked").removeClass('clicked');
    $("#panel img").hide();
    $("#panel img:nth-child("+Number($(this).index()+1)+")").fadeIn();
    $(this).addClass('clicked');
});

Here is the demo:
http://jsfiddle.net/L7yKp/5/
On click of each thumbnail the corresponding image should be fadeIn. But here every larger image is fading In.

A: Here is a simple working demo matching your needs: http://jsfiddle.net/D6XHt/1/
Note: It's not the same html as yours but should you push to the right direction. The technique i'ma using has one disadvantage. Without JS enabled your users will see only on big image.
BUT a real advantage is you will save bandwidth and page loading time if you have many images. This is because every big image will load only if the user clicks a thumbnail.
Here is another working solution with all images in document.
http://jsfiddle.net/D6XHt/2/
If you want to show your Images in a fancy lightbox Popup try

*

*http://fancybox.net/home or

*http://www.jacklmoore.com/colorbox


text:
Q: PhantomJS2 disconnects after timeout - how to debug? How would you debug this?
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.37 server started at http://localhost:9126/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 2.0.0 (Mac OS X 0.0.0)]: Connected on socket inUICOZKKRvrMwaJulGW with id 93588533
WARN [PhantomJS 2.0.0 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

PhantomJS 2.0.0 (Mac OS X 0.0.0): Executed 0 of 0 DISCONNECTED (10.002 secs / 0 secs)

Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

I got amongst others this in my karma.conf.js
phantomjsLauncher: {
  exitOnResourceError: true
},

browserNoActivityTimeout: 5000,

Switching to Chrome helps and makes the error go away. Phantom JS 2 is globally installed.

A: You can modify the log level of Karma in karma.conf.js
 logLevel: config.LOG_DEBUG,

However, I have found this doesn't give any info around the error above. There is also a debug flag in customLaunchers, as shown here:
https://github.com/karma-runner/karma-phantomjs-launcher
But that didn't solve it for me either.
I resolved this after realizing I was running a very recent, unstable version of Node.js (6.4). Migrating back to Node 4.6 resolved the error.


text:
Q: css/html strange web page loading I don't understand why when I load my page:
http://judopassion.com/wordpress/
during the page loading, my header moves up and down, until it stops.
What css problem is?
Thanks.

A: This is because your facebook plugin is loaded asynchronously with the webpage. This means that the area taken up by your facebook/social plugin has a height of 0 initially and after it is loaded which is post-page-render by browser so therefore it moves the header down.
If you look at it carefully, the facebook plugin is not loaded initially. And your header moves down after it is loaded :D
There is an easy fix for it. Just set the height of the facebook part to a preset height of height: 30px;


text:
Q: How to check Image.Source doesn't contains URI or Stream? I have List of 3 Images of type Xamarin.Forms.Image. First image has URI as source, Second image has stream that as I have uploaded second image from Gallery and I don't have anything in 3rd image.
List<Image> Photos = new List<Image>();
Image URIImage=ImageSource.FromURI("https://xxx.amazonaws.com/profiles/ddddd-1658-4cf1-b62c-cccccccc_1.jpg");
Photos.Add(URIImage);
Photos.Add(await GetImageFromGallery());    //"/Users/text/Library/Developer/CoreSimulator/Devices/3C26B8DD-1E37-47A0-B164-810AE3EA4A4D/data/Containers/Data/Application/05BE5988-4F9F-4E17-BCC2-xxxxxxxx/Documents/IMG_0001.JPG"
Photos.Add(new Image() { Source = string.Empty });

Now I want to go through loop and want to get image from Photos that doesn't have source. Here it's 3rd image of Photos list.
Can anybody please help me?

A: After read the comment, I think the simple solution is checking the string converted from image.source.
You can use the two as condition
image.Source.ToString() is "File: "
or
image.Source.ToString().Contains("File: ")


text:
Q: Getting VLAN to work between Polycom VVX phones and Cisco SG300 Switch I followed instructions listed here --> https://community.polycom.com/t5/VoIP-SIP-Phones/FAQ-Utilizing-VLAN-s-with-Polycom-phones/td-p/38100. But came up short.
So I have computers (VLAN 1) and these patch into the bottom of Polycom VVX phones, which I wish to separate into VLAN 11.
I disabled CDP and LLDP on the Cisco SG300-28PP switch. And I defined VLAN 11, and added it as an allowed trunk to all interfaces on the Cisco SG300-28PP switch. I also disabled these two protocols on the Polycom VVX's. I enabled a fixed discovery for Option 128 on the Polycom VVX's. I added the Option 128 for VLAN-A=11; on the DHCP server (in this case a Windows 2012 R2 box). While the computers are networked fine via VLAN 1, the phones wouldn't grab a DHCP address as part of the VLAN 11 network.
The two networks come from the Cisco SG300-28PP into a Cisco ASA 5505, one interface for VLAN 1 and another interface for VLAN 11. I have DHCP Relay setup on the Cisco ASA 5505 so that requests coming in from VLAN 11 (10.4.4.0/24) are forwarded to 10.0.4.5 on VLAN 1 (10.0.4.0/24).
Below is the switch config. Along with a snippet from the ASA config, and a screen shot of the DHCP scope that's defined. Any ideas what I could be missing?
Switch:
config-file-header
switchae111f
v1.3.5.58 / R750_NIK_1_35_647_358
CLI v1.0
set system mode switch

file SSD indicator plaintext
@
no cdp run
vlan database
vlan 11
exit
voice vlan id 11
voice vlan state disabled
voice vlan oui-table add 0001e3 Siemens_AG_phone________
voice vlan oui-table add 00036b Cisco_phone_____________
voice vlan oui-table add 00096e Avaya___________________
voice vlan oui-table add 000fe2 H3C_Aolynk______________
voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
voice vlan oui-table add 00d01e Pingtel_phone___________
voice vlan oui-table add 00e075 Polycom/Veritel_phone___
voice vlan oui-table add 00e0bb 3Com_phone______________
no lldp run
hostname switchae111f
management access-list All
permit
exit
management access-list SSH
permit service ssh
exit
management access-class All
username cisco password encrypted ------ privilege 15
ip ssh server
ip ssh password-auth
ip ssh-client server authentication
clock timezone " " -5
clock summer-time web recurring usa
clock source sntp
clock source browser
sntp unicast client enable
sntp unicast client poll
sntp server 10.0.4.5
clock dhcp timezone
!
interface vlan 11
 name voip
!
interface gigabitethernet1
 switchport trunk allowed vlan add 11
!
interface gigabitethernet2
 switchport trunk allowed vlan add 11
!
interface gigabitethernet3
 switchport trunk allowed vlan add 11
!
interface gigabitethernet4
 switchport trunk allowed vlan add 11
!
interface gigabitethernet5
 switchport trunk allowed vlan add 11
!
interface gigabitethernet6
 switchport trunk allowed vlan add 11
!
interface gigabitethernet7
 switchport trunk allowed vlan add 11
!
interface gigabitethernet8
 switchport trunk allowed vlan add 11
!
interface gigabitethernet9
 switchport trunk allowed vlan add 11
!
interface gigabitethernet10
 switchport trunk allowed vlan add 11
!
interface gigabitethernet11
 switchport trunk allowed vlan add 11
!
interface gigabitethernet12
 switchport trunk allowed vlan add 11
!
interface gigabitethernet13
 switchport trunk allowed vlan add 11
!
interface gigabitethernet14
 switchport trunk allowed vlan add 11
!
interface gigabitethernet15
 switchport trunk allowed vlan add 11
!
interface gigabitethernet16
 switchport trunk allowed vlan add 11
!
interface gigabitethernet17
 switchport trunk allowed vlan add 11
!
interface gigabitethernet18
 switchport trunk allowed vlan add 11
!
interface gigabitethernet19
 switchport trunk allowed vlan add 11
!
interface gigabitethernet20
 switchport trunk allowed vlan add 11
!
interface gigabitethernet21
 switchport trunk allowed vlan add 11
!
interface gigabitethernet22
 switchport trunk allowed vlan add 11
!
interface gigabitethernet23
 switchport trunk allowed vlan add 11
!
interface gigabitethernet24
 switchport trunk allowed vlan add 11
!
interface gigabitethernet25
 switchport trunk allowed vlan add 11
!
interface gigabitethernet26
 switchport trunk allowed vlan add 11
!
interface gigabitethernet27
 switchport trunk allowed vlan add 11
!
interface gigabitethernet28
 switchport trunk allowed vlan add 11
!
exit
no macro auto processing cdp
no macro auto processing lldp
ip ssh-client key rsa key-pair

ASA:
names
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
 switchport access vlan 12
!
interface Ethernet0/3
 switchport access vlan 11
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 10.0.4.1 255.255.255.0
!
interface Vlan2
 description time-warner-bc-static
 nameif outside
 security-level 0
 ip address 74.143.200.234 255.255.255.248
!
interface Vlan11
 nameif voip
 security-level 100
 ip address 10.4.4.1 255.255.255.0
!
interface Vlan12
 description Cisco RV110W VPN Firewall
 nameif wireless
 security-level 99
 ip address 192.168.100.1 255.255.255.0
!

same-security-traffic permit inter-interface

!
dhcprelay server 10.0.4.5 inside
dhcprelay enable wireless
dhcprelay enable voip
dhcprelay timeout 60

VoIP DHCP Scope

A: The phones look for a custom option (128) in the DHCP offer message to learn which VLAN they should use.  This option must be configured on the DHCP scope for the native (untagged) VLAN.
The phone boot process is:

*

*Boot up and generate a DHCP discover message on the native VLAN (Vlan 1 in this case).

*The DHCP server responds with a DHCP offer message.  This message includes the custom option 128.  The option string includes which VLAN the phones should use. ("VLAN-A=11;").

*The phone reboots and generates a DHCP discover message on VLAN 11 (tagged with a VID=11).

*The DHCP server responds with an offer from the configued VLAN 11 scope.

*The phone uses the address on VLAN 11, and continues its boot process.


text:
Q: Vuejs directive expression value always undefined I have built a pretty small jsfiddle demonstrating access directive value within bind function. Unfortunately, it always return undefined.
https://jsfiddle.net/matiascx/vz07t9wy/1/
bind: function(){
   console.log(this.value);
    this.el.innerText = this.value;
  }

A: You are using the wrong hook in your directive. As the docs say, the bind directive is called only once and doesn't get the value passed to the directive. You have to use the update directive.
update: function (value) {
    console.log(value);
    this.el.innerText = value;
}

Here is the fiddle as an example

A: I'm a bit late to the party but have a hint for all who might stumble upon binding.value being undefined for some expressions in directives.
v-directive="someTrueValue || someObject.notExistentKey"
You'll expect it to be:
true || undefined === true
But it's not true for directives. The result will be:
undefined
What works though is this:
v-directive="someTrueValue || !!someObject.notExistentKey"


text:
Q: Get feed level category (RSS) I'm using SimplePie.
Is there a way to get the category of the feed? Right now I can only get the category at the item level of the feed. I know the feed normally has a category so is there anyway of retrieving this instead of the item level category?

A: Try to use magpie rss. It is one of the best feed parser. Its easy to use. You can actually configure everything in "5 mins".


text:
Q: How to fill datagridview cells with database content when column combobox is selected I know how to fill textboxes with its values from the SQL database when combobox selectedindexchnged is fired. I tried to do so with datagridview but the column "Position" is not showing any value from the SQL database. Below are screenshot and codes l have tried. Kindly assist.
private void columncomboselectedindex_Load(object sender, EventArgs e)
{
    // TODO: This line of code loads data into the 'northwindDataSet5.employeeSCL2' table. You can move, or remove it, as needed.
    this.employeeTableAdapter.Fill(this.northwindDataSet5.employee);

    DataGridViewComboBoxColumn comboCol = new DataGridViewComboBoxColumn();
    comboCol.Name = "FullName";
    comboCol.DataSource = employeeBindingSource;
    comboCol.ValueMember = "EmployeeID";
    comboCol.Width = 200;
    comboCol.DisplayMember = "FullName";
    dataGridView1.Columns.Add(comboCol);

    DataGridViewTextBoxColumn priceCol = new DataGridViewTextBoxColumn();
    priceCol.Name = "Position";

    dataGridView1.Columns.Add(priceCol);
}

private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
    cmd = new SqlCommand("SELECT Position FROM employee WHERE FullName = '" + dataGridView1.Rows[0].Cells["FullName"].Value + "'", con);
    con.Open();
    cmd.ExecuteNonQuery();
    SqlDataReader DR;
    DR = cmd.ExecuteReader();
    while (DR.Read())
    {
        string Position = (string)DR["Position"].ToString();
        dataGridView1.Rows[0].Cells["Position"].Value = Position;
    }
    con.Close();
}


text:
Q: What's the difference between 'non-expansive', and 'sublinear'? What's the difference between 'non-expansive', and 'sublinear'?
How the properties become important?
I saw 'non-expansive' is described as an enjoyable property studying proximal method in convex optimization. Why?

A: These notions are not related to each over. They are completely disjoint.
Imagine you have a metric space $(X,d)$. Then a map $f:X\to X$ is called non-expansive, if $d\bigl(f(x),f(y)\bigr)\le d(x,y)$ for any $x,y\in X$. This means that the distances between images are not greater than the distances between arguments, so after applying the map $f$ to $x,y$ the distance does not grow. In the other words, non-expansive map is a lipschitzian map with Lipschitz constant $1$.
Now let's have two vector spaces $X,Y$ over $\Bbb R$. The map $f:X\to Y$ is sublinear if $f(x+y)\le f(x)+f(y)$ for any $x,y\in X$ (the subadditivity contidition) and $f(tx)=tf(x)$ for any $x\in X, t\ge 0$ (nonnegative homogeneity condition).
Of course, if $X$ is a metric-vector space (e.g. the normed space) then there is a sense to speak about non-expansive sublinear maps. For instance, $f:\Bbb R\to\Bbb R$ given by $f(x)=|x|$ is nonexpansive and sublinear. Another map, $g(x)=2x$ is linear (so sublinear) and it is not nonexpansive. A sine function is nonexpansive and not sublinear.


text:
Q: "Backspace" a character in STDOUT in Java? I'm building a simple application that basically does the following:
logger.debug("Server start.");
server.start();
System.in.read();
logger.debug("Server stop.");
server.stop();

What I'd really like to do is to completely obliterate whatever character the user types in, whether it's a line break or a letter. I simply want the log output to look like this:
Server start
Server stop

...rather than like this:
Server start

Server stop

if the user hit "ENTER" at the prompt. How can I make this happen? How can I eat all typed characters, then shut down my server as per the example above?

A: I don't think this is possible in pure Java because manipulating characters in a terminal window must be done by a terminal controlling library (such as curses).  The core Java APIs don't provide this sort of functionality but there might be JNI wrappers (such as Java Curses).

A: If you change the input stream for system.in to something else, the input will redirect to something else other than the console.  That should "obliterate" that line.
Link: download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#setIn(java.io.InputStream)
It says 5.0 but method should still exist in 6.
In hindsight, I'm not sure this will work.  Don't have Java open in front of me, so not sure if this will work.
Edit if you have control of the logger, can you prevent it from printing a new line character?  That would be easiest.


text:
Q: Return query results based on 2 parameters I have a stored procedure that accepts 2 parameters of type varchar.  The default value is just an empty string, but if not, then it's a list/array of numbers as defined below.
I'm trying to come  up with a query that will account for either parameter being empty or actually containing something.
What I have below, isn't returning everything if the parameters are empty.
If they are both empty, then I want the query to run as if I just did this:
SELECT TOP(200) * FROM @ResultsTable

If either one is not empty then it needs to run against the list like:
SELECT TOP(200) * FROM @ResultsTable
WHERE engineGroup IN(5, 4, 9, 11)

--AND if the other one is not empty too:

AND modelYear IN(2007, 2009, 2015)

Here is the query:
    --PARAMETERS
  @engineGroup AS VARCHAR(8000) = '',          --default to '' if null
  @modelYear AS VARCHAR(8000) = ''     --default to '' if null

 --@engineGroup is either '' or a grouping like (5, 4, 9, 11)
 --@modelYear is either '' or a group like (2005, 2012, 2015)

SELECT  TOP(200) *
FROM    @ResultsTable
    WHERE
        @engineGroup = ''
    OR
        engineGroup IN(@engineGroup)
    AND
        @modelYear = ''
    OR
        modelYear IN(@modelYear )

I do get results, but it seems as if I don't have the AND/OR logic correct.
It seems to be returning data like I did an OR statement between the two parameters instead of an AND statement.
Is there a better way to structure this?
Thanks

A: Using this should work - however using multiple IF statements should result in better performance (at least from my experience).
One query:
SELECT *
FROM @ResultTable
WHERE (engineGroup IN (@engineGroup) OR NULLIF(@engineGroup, '') IS NULL)
    AND (modelYear = @modelYear OR NULLIF(@modelYear, '') IS NULL)

Multiple IFs:
IF @engineGroup IS NOT NULL AND @modelYear IS NOT NULL
BEGIN
    SELECT TOP (200) *
    FROM @ResultsTable
    WHERE engineGroup = @engineGroup
        AND modelYear = @modelYear
END
ELSE IF @engineGroup IS NOT NULL AND @modelYear IS NULL
BEGIN
    SELECT TOP (200) *
    FROM @ResultsTable
    WHERE engineGroup = @engineGroup
END
ELSE IF @engineGroup IS NULL AND @modelYear IS NOT NULL
BEGIN
    SELECT TOP (200) *
    FROM @ResultsTable
    WHERE modelYear = @modelYear
END
ELSE
BEGIN
    SELECT TOP (200) *
    FROM @ResultsTable
END


text:
Q: Running Windows Server 2008 Web Edition in a VM We are planning to run an Intranet site on Windows Server 2008 Web Edition. The site will also use SQL Server 2008 Express, installed on the same virtual machine. We are using VMWare Server to host the VM. The web server will be running EPiServer CMS, with say 10 concurrent users.
As you may have guessed, the budget is tight and we cannot buy new hardware.
I guess I have 2 concerns:

*

*Is this going to perform poorly, or is it possible that with enough CPU and RAM thrown at it, that this configuration would perform ok?

*Are there any hidden Windows or SQL Server licensing gotchas in this configuration?

A: I would probably go with Hyper-v if I had performance concerns.  If it's an intranet site there are licensing concerns.  Web edition is the sole version of windows without CAL requirements.  Along with that is the restriction that it cannot be used in an intranet environment.  See  Licensing Windows Web Server 2008 R2

A: CPU and Ram are definitely a concern, but what is the datastore?, will SQL be sharing that as well?
Performing "poorly" is relative to what the "expectations" are.  Also, why not use ESXi?, it's free and would be a better platform to build from.

A: Despite it's name, VMWare Server isn't a suitable virtualisation platform for a production system (IMO). For this, I recommend you look at a Hypervisor-based solution such as VMWare ESXi or Microsoft Hyper-V Server.
Many people base their virtualization performance beliefs on the consomer/developer products that are available. For example many people experience poor performance for VMs running on Microsoft Virtual PC or VMWare Server, and assume the same will be true for other virtualisation platforms (e.g. ESX).
Regarding gotchas: No issues with SQl Express. Beyond that though, SQL per-socket licensing can be tricky if you're virtualising. Essentially, any CPU you could execute on must have a socket license. So if you have a dual socket host machine, but only 1 vCPU assigned to your SQL server, you still need 2 x socket licenses to be compliant. Windows licensing is the same boat, but I don't think you need to worry about per-socket Windows licensing unless you're on datacenter edition. See Jim B's response about web edition restrictions, though.


text:
Q: Elasticsearch data schema for nested objects I'm building an Elasticsearch index that spans across multiple types of associated objects.
I've tried several approaches, but I can't seem to find the right balance between performance, scalability, and matching product requirements.
Here's the stripped down data model:
user
* id
* email
* created_at
...

has many:

  associated_1
  * type
  * created_at
  ...

  associated_2
  * type
  * created_at
  ...

The goal is to run a query that will:

*

*return users,

*filtered by email,

*filtered by associated_1 type,

*sorted by associated_2 created_at.

I've tried several approaches.

*

*Nested documents. This won't really work since user has a certain level of churn (updates), some nested objects as well. That would mean a lot of reindexing of quite complex objects.

*Parent / child. This works, but also makes data retention problematic, see below.

*Separate indexes. By far the best way to store data - multiple indexes, an index per object. For this approach I haven't really found a way to run the query with multi-level filtering and sorting, except for shooting multiple queries at ES and then somehow merging and sorting results. But this doesn't seem to be scalable.

To add another level of complexity - I also need to retire data after a certain period of time. Main user object should sit in the index all the time, while associated objects have a TTL (I'm doing TTL with daily indexes).
My preferred solution would be 3, but I don't know how to query that.
Alternative solution would be 2, but that adds a lot of data duplication, since I would need to copy user object to every daily index to maintain parent / child association.
I'm also open to another search / analytics engines, besides Elasticsearch.
Any help / comments / recommendations are appreciated!


text:
Q: Python Flask should execute only once I am relatively new to the complete Flask package and I am facing a complex situation.
I want the below code only to run once, but it asks me to PRESS Ctrl+C to quit. It's fairly understandable. But as I wish to use the value from a REST API for some other purpose, I want the script to automatically exit the app.run command.
The script works perfectly fine once I press the Ctrl+C.
I have also given the app.before_first_request, but that results in a str object not callable error.
Could someone please come to my rescue.
Thanks :)
Below is my code:
from flask import Flask
from flask import jsonify
import sys

app=Flask(__name__)

@app.route('/')
def hello_world():
    return jsonify(result='Hello World')

@app.route('/leds/<pin>/<lednr>/<status>')
def lednr_regal_leds(pin,lednr,status):
    global a
    a=(pin,lednr,status)
    print(a)
    return jsonify(pin,lednr,status)

app.run(host='0.0.0.0',port='5000')
print(a)
# Use the value a further.

A: Flask is a web server. It's meant to be long running.
You cannot just start the script and then it ends, meanwhile the API is still available
If you want to stop the server within a route, then find out what method off the app variable can do that


text:
Q: How to create in C# a method taking a method as parameter having an undeterminded numbers of parameters? I am new to C# and have a question. I am not sure if this question or similar to it was asked before however, I couldn't find a clear solution. I have created a method in C# and its parameter is a generic method:
public void MyMethod (some_generic_method)

That "some_generic_method" may have different numbers of parameters with homogeneous datatypes. How should I create the signature of "MyMethod"?
Edit: I will try to explain as clearly as possible why the asked solution is needed. I am making a testing library in C# and the library includes a method similar to "MyMethod".
Imagine:

*

*a user has created a class which has several different methods,

*the user is "using" my library in his/her C# script,

*the user knows in advance that to be able to exploit the library, his/her methods names must contain a specific string (let's assume "test") ,

*my library "MyMethod" is supposed to find those user defined methods that contain "test" as a part of their names (In the corresponding part of my code I am using Reflection, assembly, type, ... and "if(method.name contains "test")" so the library can detect those specific methods and pass them to its "MyMethod" individually),

*Now, since we don't know what are those user defined methods signatures look like, the parameter of "MyMethod" should be in a way that it can handle any user defined method. That's why in my question in the first place I mentioned that "some_generic_method" (which is "MyMethod" parameter) may have different numbers of parameters with homogeneous/heterogeneous datatypes.

I hope this explanation makes the question clearer.
Thanks.

A: Consideration
There is no possibility to call a method without knowing its signature, as I know.
And in C# that is not like Javascript or Python or Ruby for example, a signature is static, definitively defined after compiled, so immutable.
Even using reflexion on an object as parameter, you will have the same problem to manage parameters of this unknown method having unknow parameters of unknown types.
C# is a strongly-typed language, a compiled language, even using dynamics.
C# Generics don't mean to not known types and signature, on the contrary, and they are not C++ Templates even these are ancestors.
Using params for parameters
https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/params
public delegate void ParameterizedActionWithParams(params object[] parameters);

public void MyAction(ParameterizedActionWithParams action, params object[] parameters)
{
  if ( action != null )
    action(parameters);
  else
    ManageArgumentNullException();
}

Using a list of objects
public delegate void ParameterizedActionWithList(List<object> parameters);

public void MyAction(ParameterizedActionWithList action, List<object> parameters)
{
  if ( action != null )
    action(parameters);
  else
    ManageArgumentNullException();
}

Limitations
You can't have strong typed arguments.
And if you need functions too there is a problem if the returned parameter can vary and you only can do:
public delegate object ParameterizedFuncWithParams(params object[] parameters);

public delegate object ParameterizedFuncWithList(List<object> parameters);

So you need to create these variants:
public object MyFunc(ParameterizedFuncWithParams func, params object[] parameters)
{
  if ( func != null )
    return func(parameters);
  else
    ManageArgumentNullException();
}

public object MyFunc(ParameterizedFuncWithList func, List<object> parameters)
{
  if ( func != null )
    return func(parameters);
  else
    ManageArgumentNullException();
}

A:
That "some_generic_method" may have different numbers of parameters with homogeneous datatypes.

The "homogenous datatypes" limitation helps a lot. We can define our new method with a single type argument:
public void MyMethod<T>(...)

Unfortunately, we can't quite get all the way there with a single method. We'll need an overload for each number of supported type arguments:
public void MyMethod<T>(Func<T> arg) { ... }
public void MyMethod<T>(Func<T,T> arg) { ... }
public void MyMethod<T>(Func<T,T,T> arg) { ... }
// etc

If you look at the framework source, this is what the platform designers themselves had to do for things like delegates, Tuples, and params arguments.
But I wonder if you could adjust to do something like one of these:
public void MyMethod<T>(Func<IEnumerable<T>,T> arg) { ... }
public void MyMethod<T>(Func<T[],T> arg) { ... }


text:
Q: Get records not in table (MySQL) I have three tables: Member, Meeting and Member_Meeting. The names alone should give away what they contain. Member is for registered members, Meeting is for past and future meetings and Member_Meeting is for members who have or will be attending meetings. I can use inner joins to get data in both tables, left joins to get data in both but also on the left, right joins to get data in both but also on the right and (full) outer joins to get data from both and right and left. What I need however is data that only exists in Member but not in Member_Meeting. In other words, I need to get all the members that exist but have not ever attended a meeting and therefore do not have a record in the Member_Meeting. What I need is sort of like a left join or a right join but without what the tables have in common.

A: There's two ways of doing this. The first is to do a subquery using NOT IN():
SELECT * FROM Member WHERE ID NOT IN(SELECT DISTINCT MemebrID FROM Member_Meeting)

The other option is to do a LEFT JOIN and then filter on the null values
SELECT Member.* FROM Member
LEFT JOIN Member_Meeting ON Member.ID = Member_Meeting.MemberID
WHERE Member_Meeting.MemberID IS NULL


text:
Q: Dynamically loaded Jquery dialog causes site to redirect user to login after upgrading to latest version of Jquery We have a MVC application we recently upgraded jquery to version 3.6.  Since we did that, all of our dynamically loaded dialog modals, no longer function correctly.
What we have as a dyanmically built table, each row has a link.  Click on that link is supposed to open a jquery dialog which displays details about the row they clicked.
When a user clicks on a link that should load and open the dialog, instead the dialog starts to open and populate with data and then "suddenly" the user is redirected to the root URL of the site instead of staying on the page with the dialog open.
It's behaving as if something is hijacking the request pipeline or aborting the running java-script on the page.
Here are the elements in the html where link (in a dynamically built table) is created:

        @item.CreateDate.ToShortDateString()

Here is the html for the jquery dialog modal:

                <button id="closeRefundDlg" class="button standard-primary" data-dismiss="modal">Close</button>

Here is the script that loads the content into the body:
        $("#refunds tr[id]").each(function (index) {
            var id = this.id;

            $(this).children("td").children("a").click(function () {
                $("#refundMethod").val(id);
                var url = '@Url.Action("DetailsRefund", new { id = "-1" })';
                url = url.replace("-1", id);

                $("#RefundBody").load(url, null, function () {
                    $("#RefundDlgHeader").focus();
                    $("#RefundDlg").modal('show');
                });
            });
        });

I should note that the load command in the code above does return the correct data for the dialog and if I take that link and put it in a separate window, it does return the correct data on the page, just not in the modal, obviously.
basically our issue happens on this line:
$("#RefundBody").load(url, null, function ()
Running DEV tools in Chrome, you can see the requested data is returned, for a brief moment when running this I see the dialog with data, then I am suddenly redirected to index.

All this code above worked until we upgraded to the latest jquery.  Any assistance or guidance someone can provide is much appreciated!

A: Figured out a fix by way of a colleague who helped me out tremendously.
The problem is actually here:
@item.CreateDate.ToShortDateString()

For some reason the #@item.ID in the id of the anchor tag is causing jquery to redirect to index.  Not really sure why this is the case or if there is a better way to solve the issue, but what we did is create a js file with the following script and then referenced it in our layout page:
$(document).ready(function () {
$("a").each((a, b) => {
    $(b).click(e => {
        if ($(b).attr("href")[0] == "#") {
            e.preventDefault();
        }
    })
});

});
Basically its preventing the default behavior on that anchor tag which apparently was to redirect, which is not what we wanted in this case.  So we have it NOT do that if the anchor tag id has a # in it.


text:
Q: Why is it saying 'RecyclerView has no LayoutManager' when there is one. Please see details I have made a recyclerview in my app.
The problem is that I'm getting the following error: java.lang.IllegalStateException: RecyclerView has no LayoutManager even when I've defined it.
Here's ListContentAAR.java file's code:
class ListContentAAR {
    String picTag;

    ListContentAAR( String picTag) {
        this.picTag = picTag;
    }

}

Here's RVAdapterAAR.java file's code:
public class RVAdapterAAR extends RecyclerView.Adapter<RVAdapterAAR.PersonViewHolder> {

    public static class PersonViewHolder extends RecyclerView.ViewHolder {

        CardView cardView;
        TextView pic;

        PersonViewHolder(View itemView) {
            super(itemView);
            cardView = (CardView) itemView.findViewById(R.id.card_accept_request);
            homelessPic = (TextView) itemView.findViewById(R.id.pic_tag);
        }

    }

    List<ListContentAAR> listContentAARs;

    RVAdapterAAR(List<ListContentAAR> listContentAARs) {
        this.listContentAARs = listContentAARs;
    }

    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        super.onAttachedToRecyclerView(recyclerView);
    }

    public PersonViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.fragment_accept_a_request, viewGroup, false);
        PersonViewHolder personViewHolder = new PersonViewHolder(view);
        return personViewHolder;
    }

    public void onBindViewHolder (PersonViewHolder personViewHolder, int i) {
        personViewHolder.pic.setText(listContentAARs.get(i).homelessPicTag);
    }

    public int getItemCount() {
        return listContentAARs.size();
    }

}

Here's AcceptARequest.java file's code:
public class AcceptARequest extends Fragment {
    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;

    private OnFragmentInteractionListener mListener;

    private List<ListContentAAR> listContentAARs;
    private RecyclerView recyclerView;

    public AcceptARequest() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @param param1 Parameter 1.
     * @param param2 Parameter 2.
     * @return A new instance of fragment AcceptARequest.
     */
    // TODO: Rename and change types and number of parameters
    public static AcceptARequest newInstance(String param1, String param2) {
        AcceptARequest fragment = new AcceptARequest();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        View rootView = inflater.inflate(R.layout.fragment_accept_a_request, container, false);

        RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.accept_request_list);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setHasFixedSize(true);

        initializeData();
        initializeAdapter();

        return rootView;
    }

    private void initializeData(){
        listContentAARs = new ArrayList<>();
        listContentAARs.add(new ListContentAAR("Emma Wilson"));
    }

    private void initializeAdapter(){
        RVAdapterAAR adapter = new RVAdapterAAR(listContentAARs);
        recyclerView.setAdapter(adapter);
    }

    // TODO: Rename method, update argument and hook method into UI event
    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

    /**
     * This interface must be implemented by activities that contain this
     * fragment to allow an interaction in this fragment to be communicated
     * to the activity and potentially other fragments contained in that
     * activity.
     *

     * See the Android Training lesson Communicating with Other Fragments for more information.
     */
    public interface OnFragmentInteractionListener {
        // TODO: Update argument type and name
        void onFragmentInteraction(Uri uri);
    }
}

Here's fragment_accept_a_request.xml file's code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                tools:context="com.abc.xyz.AcceptARequest">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/accept_request_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.v7.widget.CardView
            android:id="@+id/card_accept_request"
            android:layout_width="match_parent"
            android:layout_height="@dimen/card_accept_request"
            app:cardElevation="2dp"
            app:cardUseCompatPadding="true"
            app:contentPadding="10dp">

            <TextView
                android:id="@+id/pic_tag"
                android:layout_width="match_parent"
                android:layout_height="@dimen/pic_dimen_accept"
                android:text="@string/image_view_tag_accept"
                android:gravity="center_horizontal|center_vertical"/>

        </android.support.v7.widget.CardView>

    </android.support.v7.widget.RecyclerView>

</RelativeLayout>

Here's MainActivity.java file's code:
public class MainActivity extends AppCompatActivity {

    /**
     * The {@link android.support.v4.view.PagerAdapter} that will provide
     * fragments for each of the sections. We use a
     * {@link FragmentPagerAdapter} derivative, which will keep every
     * loaded fragment in memory. If this becomes too memory intensive, it
     * may be best to switch to a
     * {@link android.support.v4.app.FragmentStatePagerAdapter}.
     */
    public SectionsPagerAdapter mSectionsPagerAdapter;

    /**
     * The {@link ViewPager} that will host the section contents.
     */
    private ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Typeface typeFace = Typeface.createFromAsset(getAssets(),"fonts/Pacifico.ttf");

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
        mTitle.setTypeface(typeFace);
        toolbar.setTitle(mTitle.getText().toString());
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);

        // Create the adapter that will return a fragment for each of the three
        // primary sections of the activity.
        mSectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());

        // Set up the ViewPager with the sections adapter.
        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(mSectionsPagerAdapter);

        TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
        tabLayout.setupWithViewPager(mViewPager);

        /*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });*/

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            Intent settingsIntent = new Intent(MainActivity.this, SettingsActivity.class);
            startActivity(settingsIntent);
        } else if (id == R.id.action_profile) {
            Intent profileIntent = new Intent(MainActivity.this, ProfileActivity.class);
            startActivity(profileIntent);
        } else if (id == R.id.action_send_feedback) {
            Intent sendFeedbackIntent = new Intent(MainActivity.this, SendFeedback.class);
            startActivity(sendFeedbackIntent);
        } else if (id == R.id.action_help) {
            Intent helpIntent = new Intent(MainActivity.this, HelpActivity.class);
            startActivity(helpIntent);
        }

        return super.onOptionsItemSelected(item);
    }

    public class SectionsPagerAdapter extends FragmentPagerAdapter {

        protected Context mContext;

        public SectionsPagerAdapter(Context context, FragmentManager fm) {
            super(fm);
            mContext = context;
        }

        @Override
        public Fragment getItem(int position) {
            // getItem is called to instantiate the fragment for the given page.
            // Return a PlaceholderFragment (defined as a static inner class below).
            // return MainActivity.PlaceholderFragment.newInstance(position + 1);

            switch (position) {
                case 0:
                    return new AcceptARequest();
                case 1:
                    return new PostARequest();
                default:
                    return new AcceptARequest(); // return AcceptARequest() actually
            }
        }

        @Override
        public int getCount() {
            // Show 2 total pages.
            return 2;
        }

        @Override
        public CharSequence getPageTitle(int position) {
            Locale l = Locale.getDefault();
            switch (position) {
                case 0:
                    return "Accept A Request";
                case 1:
                    return "Post A Request";
            }
            return null;
        }
    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {
        /**
         * The fragment argument representing the section number for this
         * fragment.
         */
        private static final String ARG_SECTION_NUMBER = "section_number";

        /**
         * Returns a new instance of this fragment for the given section
         * number.
         */
        public static PlaceholderFragment newInstance(int sectionNumber) {
            PlaceholderFragment fragment = new PlaceholderFragment();
            Bundle args = new Bundle();
            args.putInt(ARG_SECTION_NUMBER, sectionNumber);
            fragment.setArguments(args);
            return fragment;
        }

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_main, container, false);
            TextView textView = (TextView) rootView.findViewById(R.id.section_label);
            textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
            return rootView;
        }
    }
}

Here's the stacktrace:
FATAL EXCEPTION: main
                                                                               java.lang.IllegalStateException: RecyclerView has no LayoutManager
                                                                                at android.support.v7.widget.RecyclerView.generateLayoutParams(RecyclerView.java:3182)
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:748)
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
                                                                                at com.humanehelper.humanehelper.AcceptARequest.onCreateView(AcceptARequest.java:75)
                                                                                at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
                                                                                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
                                                                                at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
                                                                                at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
                                                                                at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
                                                                                at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
                                                                                at android.support.v4.view.ViewPager.populate(ViewPager.java:1106)
                                                                                at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
                                                                                at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1474)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:610)
                                                                                at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:677)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
                                                                                at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390)
                                                                                at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
                                                                                at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390)
                                                                                at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
                                                                                at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
                                                                                at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
                                                                                at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2148)
                                                                                at android.view.View.measure(View.java:15172)
                                                                                at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1848)
                                                                                at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1100)
                                                                                at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1273)
                                                                                at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
                                                                                at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
                                                                                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
                                                                                at android.view.Choreographer.doCallbacks(Choreographer.java:555)
                                                                                at android.view.Choreographer.doFrame(Choreographer.java:525)
                                                                                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
                                                                                at android.os.Handler.handleCallback(Handler.java:615)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:92)
                                                                                at android.os.Looper.loop(Looper.java:137)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:4745)
                                                                                at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:511)
                                                                                at com

As I'm a beginner, I'm unable to figure out why am I getting the following error.
Please let me know.
Thanks in advance.

A: Remove the child elements from your RecyclerView in your fragment_accept_a_request layout.
You add children to your recycler views with the adapter, not via nested XML elements.
The problem is that when the layout inflation tries to add those children you've declared in your XML the parent RecyclerView is not yet fully configured to have children.

A: I got it!
The problem was in two files.
First problem as stated by laalto was in fragment_accept_a_request.xml. Removing the XML elements from recyclerView & placing it below it but in the same parent layout did the job.
Second problem was in AcceptARequest.java. Here I was declaring two RecyclerView one for initialiseData() method & another for declaring the recyclerView.
The changes I made in fragment_accept_a_request.xml is:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                tools:context="com.abc.xyz.AcceptARequest">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/accept_request_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

    </android.support.v7.widget.RecyclerView>

    <android.support.v7.widget.CardView
        android:id="@+id/card_accept_request"
        android:layout_width="match_parent"
        android:layout_height="@dimen/card_accept_request"
        app:cardElevation="2dp"
        app:cardUseCompatPadding="true"
        app:contentPadding="10dp">

        <TextView
            android:id="@+id/pic_tag"
            android:layout_width="match_parent"
            android:layout_height="@dimen/pic_dimen_accept"
            android:text="@string/image_view_tag_accept"
            android:gravity="center_horizontal|center_vertical"/>

    </android.support.v7.widget.CardView>

</RelativeLayout>


text:
Q: PyQt NameError when calling my scripts i keep getting this error but according to my textbook and previous script there should not be a problem
    import sys
    from PyQt4 import QtCore, QtGui
    from welcome import *
    class MyForm(QtGui.QDialog):
        def __init__(self, parent=None):
            QtGui.QWidget.__init__(self, parent)
            self.ui = Ui_Dialog()
            self.ui.setupUi(self)
            QtCore.QObject.connect(self.ui.ClickMeButton, QtCore.SIGNAL('clicked()'),self.dispmessage)

        def dispmessage(self):
            self.ui.labelMessage.setText("Hello " + self.ui.lineUserName.text())

        if __name__=="__main__":
            app = QtGui.QApplication(sys.argv)
            myapp = MyForm()
            myapp.show()
            sys.exit(app.exec_())
**ERROR**

Traceback (most recent call last):
  File "C:/Python33/Lib/site-packages/PyQt4/callwelc.py", line 4, in <module>
    class MyForm(QtGui.QDialog):
  File "C:/Python33/Lib/site-packages/PyQt4/callwelc.py", line 16, in myform
    myapp = MyForm()
NameError: name 'MyForm' is not defined

A: You have the if __name__ block inside your class definition. That means that the interpreter tries to execute it before the MyForm class has finished being defined.
Fix the indentation so the if __name__ block lies outside the class definition.
class MyForm(QtGui.QDialog):
    ... insides of class here

if __name__=="__main__":
    ...


text:
Q: breaking a row of datatable into multiple row with serverside method I have a mysql table that store all info about customer supports like smsPanel,website,vmodule,.....
customerName|smspanel|SMSstartDay|SMSexpDay |websit|WebStartDay|webExpDay|
------------------------------------------------------------
john        |yes     |2019/01/15 |2020/01/15|yes   |2019/02/12 |2020/02/12

I am using datatable serverside method to show informations. Its ok when I show every single row of database in single row of data table. but i want to show every support package in different row lik this
customerName  |  package | StartDay  | EndDate
----------------------------------------------
jhon          | SMS      |2019/01/15 |2020/01/15
jhon          | website  |2019/02/12 |2020/02/12

this is my sql query for datatable serverSide
if($ssaction == "customerSupportlist"){
$table = <<<EOT
 (
    SELECT
    *
    FROM pdsupport
    where customer_smsPack >0
 ) temp
EOT;
}

and i use this cod to format datatable but its useful for one row display
if($ssaction == "customerSupportlist"){
    $primaryKey='id';

$columns = array(
    array( 'db' => 'customer_fname','dt' => 0),
    array( 'db' => 'customer_lname',  'dt' => 1 ),

    array('db' => 'customer_ncode','dt' => 2),
    array('db' => 'customer_mobile','dt' => 3),
     array( 'db' => 'id',
          'dt' => 4,
            'formatter' =>function( $d, $row ) {
            $customerPacks=getCustomerPacks($d);
           return   $customerPacks;
        }

           ),
         array( 'db' => 'id',
          'dt' => 5,
            'formatter' =>function( $d, $row ) {
            $startDate=getCustomerPackStartDate($d);
           return   $startDate;
        }

           ),
     array( 'db' => 'id',
          'dt' => 6,
            'formatter' =>function( $d, $row ) {
            $endDate=getCustomerPackEndDate($d);
           return   $endDate;
        }

           ),
      array( 'db' => 'id','dt' => 7 ),

);
}

I dont know how to modify this part to split the rows. OR by changing mysql query make a table that has my favorite structure


text:
Q: I am trying to create slide like TikTok using React Ntaive FlatList & pagingEnabled but autometic top margin is added, can anyone help me This is what I see when app loaded
This is what happens when I reached to the endstrong text
I am trying to create app using React Native and pagingEnabled, and I want to add swipe up down like TikTok but every time I swipe up some margin constantly added to the top of my container. I don't know why ? Can any one know the reason.

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
const Home = () => (
  <View style={{ flex: 1, height: height }}>
    <FlatList
      keyExtractor={(item, index) => 'key' + index}
      data={DummyData}
      renderItem={({ item, index }) => {
        return (
          <ViewComponent
            index={index}
            item={item}
            style={{
              backgroundColor: index % 2 === 1 ? 'dodgerblue' : 'red',
            }}
          />
        );
      }}
      pagingEnabled={true}
      showsVerticalScrollIndicator={false}
      showsHorizontalScrollIndicator={false}
    />
  </View>
);

const styles = StyleSheet.create({
  container: {
    height: height,
    width: width,
    alignItems: 'center',
    justifyContent: 'center',
    paddingHorizontal: 20,
  },
  title: {
    fontSize: 22,
    color: '#fff',
    textAlign: 'left',
    marginBottom: 10,
  }
  })


text:
Q: How to find chapter number outside of XML I am writing an XML and XSL to create a HTML document based on a book. All files are called chapter-1.xml, chapter-2.xml etc. And the title in each chapter will begin with the chapter # followed by chapter title. The chapters will be written by different people, so each chapter must be in each xml-file.
XML:
<chapter title="This is the first chapter">
<paragraph title="Start">Blablabla</paragraph>
</chapter>

XSL:
<xsl:for-each select="chapter">

<xsl:value-of select="current()/@title"/>

    <xsl:for-each select="chapter">

<xsl:value-of select="current()/@title"/>

        <xsl:value-of select="current()" />
    </xsl:for-each>
</xsl:for-each>

I have a PHP to create the HTML:
<?php
# LOAD XML FILE
$XML = new DOMDocument();
$XML->load('chapter-1.xml');

$xslt = new XSLTProcessor();
$XSL = new DOMDocument();
$XSL->load('chapter.xsl');
$xslt->importStylesheet( $XSL );
print $xslt->transformToXML( $XML );
?>

And I want this to show as "1. This is the first chapter" in the HTML. Is there anyway to solves this without using another attribute in the tag? Each document only have 1 chapter-tag. Is there a way to solve this with CSS, or by getting the chapter number from the filename or so?
I also need to create a table-of-contents for all the chapters with numbering.

A: As your code does not make any sense really, I'm afraid, this is the general idea how to adress a problem like yours.
Controlling your input
It is inconvenient to have separate XML files for the chapter nodes. So if you are producing these files yourself, make sure to generate all the chapter elements in the same XML file, e.g. like this:
<chapters>
 <chapter title="This is the first chapter">
    <paragraph title="Start">Blablabla</paragraph>
 </chapter>
 <chapter title="xy">
    <paragraph title="Start">Blablabla</paragraph>
 </chapter>
</chapters>

The smartest way to do this is to introduce a numbering attribute at this stage already. If you are unable to alter the input structures, use the document() function of XSLT to include several XML files in your transformation.
Use xsl:for-each and position() to generate a numbering
If you manage to group your elements together in one single file, number them with an attribute. For instance,
<xsl:variable name="chaps" select="//chapter"/>

<xsl:template match="chapters">
   <xsl:for-each select="$chaps">
      <xsl:copy>
         <xsl:attribute name="nr">
           <xsl:value-of select="position()"/>
         </xsl:attribute>
      </xsl:copy>
   </xsl:for-each>
</xsl:template>

Alternatively, you could also make use of xsl:number for this.
Q & A

Is there anyway to solves this without using another attribute in the
  tag?

Yes, produce the numbering directly in the HTML output with either of the two methods.

Is there a way to solve this with CSS, or by getting the chapter
  number from the filename or so?

Trying to solve this in CSS is a bad idea. CSS is about styling a document, not about changing the content. I would also advise against relying on file names when transforming documents.

A: Suppose you have a document named 'toc.xml', located in the same directory as your stylesheet, that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<toc>
<chapter num="1" title="First Chapter"/>
<chapter num="2" title="Second Chapter"/>
<chapter num="3" title="Inserted Chapter"/>
<chapter num="4" title="Third Chapter"/>
<chapter num="5" title="Last Chapter"/>
<chapter num="6" title="Last Minute Chapter"/>
</toc>

And suppose your 'chapter-3.xml' document looks something like this:
<?xml version="1.0" encoding="utf-8" ?>
<chapter title="Third Chapter">
    <paragraph title="Start">Lorem ipsum ... </paragraph>
    <paragraph title="End">...nota bene.</paragraph>
</chapter>

Now, applying the following XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="utf-8"/>

<xsl:variable name="toc" select="document('toc.xml')/toc" />

<xsl:template match="/">

<xsl:variable name="chapTitle" select="chapter/@title" />
<xsl:variable name="chapNum" select="$toc/chapter[@title=$chapTitle]/@num"/>

<xsl:value-of select="concat($chapNum, '. ', $chapTitle)"/>

<xsl:for-each select="chapter/paragraph">

<xsl:value-of select="@title"/>

<xsl:value-of select="."/>

</xsl:for-each>

<xsl:value-of select="concat('Next chapter: ', $toc/chapter[$chapNum+1]/@title)"/>

</xsl:template>
</xsl:stylesheet>

will produce this result:

4. Third Chapter

Start

Lorem ipsum ...

End

...nota bene.

Next chapter: Last Chapter


text:
Q: Injecting dependencies into MVC3 WCF services using Ninject extensions I have an MVC3 application which should expose some functions via WCF. Some of these functions have dependencies and I'd like to inject them using Ninject, but I must be missing something obvious here as this does not work. Could anyone give a hint? Here's what I did:
1) in my MVC3 app, I add Ninject Wcf extensions via nuget.
2) I add a .svc file like:
<%@ ServiceHost Service="MyWeb.LookupService"
  Factory="Ninject.Extensions.Wcf.NinjectServiceHostFactory"%>

3) I add the corresponding code like (that's just a test so I'm using a dummy interface right here):
[ServiceContract]
public interface ILookupService
{
    [OperationContract]
    int GetProjectIdByCode(string sCode);
}

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class LookupService : ILookupService
{
  private readonly ISomeRepository _repository;
  public LookupService(ISomeRepository repository)
  {
    _repository = repository;
  }

  public int GetProjectIdByCode(string sCode)
  {
    //... use _repository
  }
}

4) in App_Start/NinjectMVC3.cs:
private static void RegisterServices(IKernel kernel)
{
    string sConnection = ConfigurationManager.ConnectionStrings["SomeEntities"].ConnectionString;
    // WCF
    kernel.Bind<ServiceHost>().To<NinjectServiceHost>();

    kernel.Bind<ISomeRepository>()
        .To<AConcreteRepository>()
        .WithConstructorArgument("sConnection", sConnection);
}

Now, when I access the svc I get the following exception from Ninject:

System.ArgumentNullException was unhandled by user code
  Message=Cannot be null Parameter name: root   Source=Ninject
  ParamName=root   StackTrace:
         at Ninject.Infrastructure.Ensure.ArgumentNotNull(Object argument, String name) in
  c:\Projects\Ninject\Maintenance2.2\ninject\src\Ninject\Infrastructure\Ensure.cs:line
  20
         at Ninject.ResolutionExtensions.GetResolutionIterator(IResolutionRoot
  root, Type service, Func2 constraint, IEnumerable1 parameters,
  Boolean isOptional, Boolean isUnique) in
  c:\Projects\Ninject\Maintenance2.2\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line
  258
         at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters) in
  c:\Projects\Ninject\Maintenance2.2\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line
  37
         at Ninject.Extensions.Wcf.NinjectServiceHostFactory.CreateServiceHost(Type
  serviceType, Uri[] baseAddresses) in
  c:\Projects\Ninject\Maintenance2.2\ninject.extensions.wcf\src\Ninject.Extensions.Wcf\NinjectServiceHostFactory.cs:line
  48
         at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
  constructorString, Uri[] baseAddresses)
         at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String
  normalizedVirtualPath)
         at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String
  normalizedVirtualPath)
         at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
  normalizedVirtualPath)

A: Can you try to add a protected parameterless constructor to your implementation class.
Guess the servicehost needs a parameterless constructor as well.
I had a look at the Ninject service host factory and from the stack trace provided by you. It looks its failing whne making the following checks:
      Ensure.ArgumentNotNull((object) root, "root");
      Ensure.ArgumentNotNull((object) service, "service");
      Ensure.ArgumentNotNull((object) parameters, "parameters");

Make sure that you are passing all the required parameters when using the NinjectServiceHostFactory. Worth trying to change the order of registration.
Also go through the following link here that explains how to use Ninject to host a wcf service.


text:
Q: use Ionic with intel XDK I created a (HTML5 + Cordova) App using intel XDK. While creating project, I did not opt for "Use App designer".
I want to add ionic framework with it's all dependencies (angular etc.)
I didn't find any option to add ionic.

A: I got the answer. go to project page, you will find the following option:

Click on the "Add Bower Packages", you will the following screen:

Now search for ionic and add it. Now you are happy to go.