text:
Q: Edit document attached to list item We have SharePoint 2010. The requirement is user should be able to edit and save document without having to save it on hard disk (typical Doc lib with check-in/check out and versioning) ... the next req is user should be able to attach/upload multiple documents which he/she can edit.
Now the question is is there any way to edit the attached document when its attached to list item and store the versions of it?
Is it possible to upload multiple documents to single doc lib list item which then can be edited?
Is there any alternative approch to go about ?
Any leads, links or lookups are helpful.
Thanks,
-ItsPrash

A: "without having to save it on hard disk"
-- This is only possible by using Office Web Apps so you can edit documents directly on the server.
"user should be able to attach/upload multiple documents which he/she can edit"
-- You can attach multiple documents to list items. In document libraries you only have single files and you could group them by using folders or document sets (I'll get to that later.
"edit the attached document when its attached to list item and store the versions of it"
-- No. List item attachments are like E-Mail attachments, you cannot edit them or have versions. Just download them, delete them or attach others.
You should be looking at Document Sets which are a new feature of SharePoint 2010. Basically they are folders with metadata attached. So you could basically emulate your list item (with all its metadata) and put documents within that document set. You only have to activate the document set feature and you will have this new content type to be added to your document library.
With document sets you can upload multiple documents which belong together and even share their metadata. With that approach you can do everything which is possible in a document library (checkin/checkout, versions, office web apps).

A: With Sparqube Document Column you can do all the things that were mentioned above.
This custom filed type can be added to any type of list and allows linking documents stored in any Document Library. You will be able upload multiple documents and manage their directly from list item.
http://www.sparqube.com/SharePoint-Document-Column/
NOTE: It is commercial add-on.

A: In previous versions of SharePoint you could attach a word document to a list item and continue to update it. For example a Project Log. You could update it with new text and just save the word doc. This would save it in the list item.


text:
Q: Importing sequence into HTML formatting with python I'm trying to import an sequence between 1 and 999 letters from a text file, using :
input_file.open(textfile.txt)
sequence = input_file.read()
inputfile_close()

I then open a new HTML file to write in with :
output_file.open(new.html, 'w')

I then have the HTML formatting written into the new file using:
output_file.write(-formatting-)

I'm currently using :
    if character == 'A' or character == 'G' or character == 'I' or character == 'L' or character == 'P' or character == 'V' :
        output_file.write ('' + character + '')
    if character == 'F' or character == 'Y' or character == 'W' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in
    if character == 'D' or character == 'E' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in
    if character == 'H' or character == 'K' or character == 'R' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in
    if character == 'S' or character == 'T' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in
    if character == 'C' or character== 'M' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in
    if character == 'N' or character == 'Q' :
        output_file.write ('' + character + '') # now we put the text we've read from the text file in

to color code each individual letter.
My problem is that I need the sequence to have a space after every 10th letter, and a new line after every 60th letter.
Both the sequence and the numbering need to be monospaced.
Any suggestions would be greatly appreciated.
If any further information is needed, please ask.
I've made a picture with the coding here.
The attached coding is what I'm currently using.
Thank you

A: I guess you read the sequence and write the html in a for loop? Write the formatted sequence to a string first and subsequently write the whole string to the html.
With the modulo operator % you can add the space/linebreak.
formatted_seq = ""
count = 0
for character in sequence:
    if character in 'AGILPV':
        bg = "white"
    elif character in 'FYW':
        bg = "green"
    elif character in 'DE':
        bg = "orange"
    elif character in 'HKB':
        bg = "red"
    elif character in 'ST':
        bg = "purple"
    elif character in 'CM':
        bg = "yellow"
    elif character in 'NQ':
        bg = "blue"

    formatted_seq += '' + character + ''

    count += 1
    if count%60 == 0:
        formatted_seq += '
'
    elif count%10 == 0:
        formatted_seq += ' '

redpajama_set_name: RedPajamaStackExchange


text:
Q: Notification not showing on given time and how to set multiple alarm I am trying to make an application that shows a notification on the selected time and date entered by the user from date picker and time picker, but after selecting the time and date it is not showing on that exact time. Instead it fires after a few seconds when I press ok button.
Code is given below for main activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add_reminder);

    Reminder_Title=(EditText)findViewById(R.id.Reminder_Title);

    tDate=(TextView) findViewById(R.id.Date_text);

    tTime=(TextView)findViewById(R.id.Time_text);

    tRepeat=(TextView)findViewById(R.id.Repeat_text);

    doneFab=(FloatingActionButton)findViewById(R.id.donefab);

    calendar=Calendar.getInstance();
    int Hour = calendar.get(Calendar.HOUR_OF_DAY);
    int Mint = calendar.get(Calendar.MINUTE);
    final int Year = calendar.get(Calendar.YEAR);
    final int Month = calendar.get(Calendar.MONTH) + 1;
    final int Day = calendar.get(Calendar.DAY_OF_MONTH);

    mDate = Day + "/" + Month + "/" + Year;

    tDate.setText(mDate);

    if(Mint<10) {
        mTime=Hour + ":"+0+ Mint;
    }
    else
    {
        mTime=Hour + ":" + Mint;
    }
    tTime.setText(mTime);

    doneFab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (Reminder_Title.getText().toString().length() != 0) {

                AlertDialog.Builder Message = new AlertDialog.Builder(Add_Reminder.this);
                Message.setTitle("Message");
                Message.setMessage("Reminder Added!!");
                Message.setNegativeButton("Ok", new DialogInterface.OnClickListener() {
                    @RequiresApi(api = Build.VERSION_CODES.M)
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                     // Set calender for notifcation

                        calendar.set(Calendar.MONTH, --nMonth);
                        calendar.set(Calendar.YEAR, nYear);
                        calendar.set(Calendar.DAY_OF_MONTH, nDay);
                        calendar.set(Calendar.HOUR_OF_DAY, nHour);
                        calendar.set(Calendar.MINUTE, nMinute);
                        calendar.set(Calendar.SECOND, 0);
                        calendar.set(Calendar.MILLISECOND, 0);

                        long selectedTimestamp = calendar.getTimeInMillis();

                        Intent intent=new Intent(Add_Reminder.this,AlarmSetter.class);
                        PendingIntent p1=PendingIntent.getBroadcast(getApplicationContext(),0, intent,0);
                        AlarmManager a=(AlarmManager)getSystemService(ALARM_SERVICE);
                        a.setExactAndAllowWhileIdle(AlarmManager.RTC,selectedTimestamp,p1);

                    }
                });
                AlertDialog alert = Message.create();
                alert.show();

            }
        }
    });

}

public void setDate(View view) {

    Calendar c=Calendar.getInstance();
    int mYear = c.get(Calendar.YEAR);
   int mMonth = c.get(Calendar.MONTH);
    int mDay = c.get(Calendar.DAY_OF_MONTH);

    DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener()
    {
        @Override
                public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)
        {
            //getting reminder set dates and day
            nYear=year;
            nMonth=monthOfYear;
            nDay=dayOfMonth;

            mDate=dayOfMonth + "-" + (monthOfYear + 1) + "-" + year;
            tDate.setText(mDate);

                }
                }, mYear, mMonth, mDay);
    datePickerDialog.show();
}

public void setTime(View view) {
     Calendar c = Calendar.getInstance();
     int mHour = c.get(Calendar.HOUR);
     int mMinute = c.get(Calendar.MINUTE);

    // Launch Time Picker Dialog
    TimePickerDialog timePickerDialog = new TimePickerDialog(this,
            new TimePickerDialog.OnTimeSetListener() {

                @Override
                public void onTimeSet(TimePicker view, int HOUR_OF_DAY,
                                      int minute) {
                    nHour=HOUR_OF_DAY;
                    nMinute=minute;

                      if(minute<10) {
                          mTime=HOUR_OF_DAY + ":"+0+ minute;
                      }
                      else
                      {
                          mTime=HOUR_OF_DAY + ":" + minute;
                      }
                      tTime.setText(mTime);
                }
            }, mHour, mMinute, false);
    timePickerDialog.show();

}

public void setRepeating(View view)
{
    final String[] items = new String[6];

    items[0] = "No Repeating";
    items[1] = "Every Hour";
    items[2] = "Every Day";
    items[3] = "Every Week";
    items[4] = "Every Month";
    items[5] = "Every Year";

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("Select Type");

    builder.setItems(items, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int item) {

           String mRepeatType = items[item];
           tRepeat.setText(mRepeatType);

        }
    });
    AlertDialog alert = builder.create();
    alert.show();
}

Code for Alarm.java
public class AlarmSetter extends BroadcastReceiver{

    @Override public void onReceive(Context context, Intent intent) {

        String id="main_channel";
        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) {
            Toast.makeText(context, "Wake up", Toast.LENGTH_LONG).show();

            NotificationManager notificationManager=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            CharSequence name="Channel Name";
            String description="Channel Description";
            int importance=NotificationManager.IMPORTANCE_HIGH;
            NotificationChannel notificationChannel=new NotificationChannel(id,name,importance);
            notificationChannel.setDescription(description);
            notificationChannel.enableLights(true);
            notificationChannel.setLightColor(Color.WHITE);
            notificationChannel.enableVibration(false);
            if(notificationManager!=null)
            {
                notificationManager.createNotificationChannel(notificationChannel);
            }
            NotificationCompat.Builder notificationBuilder =new NotificationCompat.Builder(context,id);
            notificationBuilder.setSmallIcon(R.drawable.timesmall);
            notificationBuilder.setContentTitle("Notification Title");
            notificationBuilder.setLights(Color.WHITE,500,5000);
            notificationBuilder.setColor(Color.RED);
            notificationBuilder.setDefaults(Notification.DEFAULT_SOUND);
            NotificationManagerCompat notificationManagerCompat=NotificationManagerCompat.from(context);
            notificationManagerCompat.notify(1000,notificationBuilder.build());

        }
    }
}

A: This is a bit of a long shot, but I assume your error is calendar.set(Calendar.MONTH, --nMonth);
Remove the pre-decrement statement -- and it should work.
--nMonth means execute nMonth = nMonth - 1 and then use the new nMonth in the statement calendar.set(Calendar.MONTH, nMonth); <-- here nMonth is one less than before. This means every time you set an Alarm it will be set a month earlier.
Also please have a look at the google-java style-guide http://google.github.io/styleguide/javaguide.html#s5.2.7-local-variable-names it tells you how to write more readable code. Especially Month,Hour, Mint... should be all lowercase.


text:
Q: PayPal Rest first call won't appear in sandbox transactions I want to have a transaction that is completed and see it listed in my developer sand box.  I think this transaction, below is completed but it is not in my sandbox transactions list.  I followed the instructions on the paypal website for making a first call with the rest API.
Here are my two curl commands using my credentials and the returned access token.  I received my state:created for the payment.  But the transaction was not in my Sandbox Transactions.  How long does it take to show up?
What am I doing wrong?
Thanks,
Harry
curl -v https://api.sandbox.paypal.com/v1/oauth2/token \
>   -H "Accept: application/json" \
>   -H "Accept-Language: en_US" \
>   -u ".....:....." \
>   -d "grant_type=client_credentials"
* About to connect() to api.sandbox.paypal.com port 443 (#0)
*   Trying 173.0.82.78... connected
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Request CERT (13):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
*    subject: C=US; ST=California; L=San Jose; O=PayPal, Inc.; OU=PayPal Production; CN=api.sandbox.paypal.com
*    start date: 2012-12-06 00:00:00 GMT
*    expire date: 2016-12-06 23:59:59 GMT
*    subjectAltName: api.sandbox.paypal.com matched
*    issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)10; CN=VeriSign Class 3 Secure Server CA - G3
*    SSL certificate verify ok.
* Server auth using Basic with user '......'
> POST /v1/oauth2/token HTTP/1.1
> Authorization: Basic .......... =
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: api.sandbox.paypal.com
> Accept: application/json
> Accept-Language: en_US
> Content-Length: 29
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 29out of 29 bytes
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=384
< Paypal-Debug-Id: de62039a5a244
< SERVER_INFO: identitysecuretokenserv:v1.oauth2.token&CalThreadId=47502&TopLevelTxnStartTime=14b83d4e3f0&Host=slcsbidensectoken502.slc.paypal.com&pid=6295
< Date: Fri, 13 Feb 2015 16:45:42 GMT
< Content-Type: application/json
< Content-Length: 461
<
* Connection #0 to host api.sandbox.paypal.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
{"scope":"https://uri.paypal.com/services/subscriptions https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card https://uri.paypal.com/services/applications/webhooks https://uri.paypal.com/services/invoicing https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.*","access_token":"A0151dMXKPrBCWFFucj132Nvw87sS5NFntFDhhfF8la3Wsg","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}

$
$ curl -v https://api.sandbox.paypal.com/v1/payments/payment \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer A0151dMXKPrBCWFFucj132Nvw87sS5NFntFDhhfF8la3Wsg' \
> -d '{
>   "intent":"sale",
>   "redirect_urls":{
>     "return_url":"http://example.com/your_redirect_url.html",
>     "cancel_url":"http://example.com/your_cancel_url.html"
>   },
>   "payer":{
>     "payment_method":"paypal"
>   },
>   "transactions":[
>     {
>       "amount":{
>         "total":"7.47",
>         "currency":"USD"
>       }
>     }
>   ]
> }'
* About to connect() to api.sandbox.paypal.com port 443 (#0)
*   Trying 173.0.82.78... connected
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Request CERT (13):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
*    subject: C=US; ST=California; L=San Jose; O=PayPal, Inc.; OU=PayPal Production; CN=api.sandbox.paypal.com
*    start date: 2012-12-06 00:00:00 GMT
*    expire date: 2016-12-06 23:59:59 GMT
*    subjectAltName: api.sandbox.paypal.com matched
*    issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)10; CN=VeriSign Class 3 Secure Server CA - G3
*    SSL certificate verify ok.
> POST /v1/payments/payment HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: api.sandbox.paypal.com
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer A0151dMXKPrBCWFFucj132Nvw87sS5NFntFDhhfF8la3Wsg
> Content-Length: 324
>
* upload completely sent off: 324out of 324 bytes
< HTTP/1.1 201 Created
< Server: Apache-Coyote/1.1
< PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=19925
< Paypal-Debug-Id: d2b2c56f78e41
< SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=196&TopLevelTxnStartTime=14b83d6cc6a&Host=slcsbpaymentsplatformserv3002.slc.paypal.com&pid=13409
< Content-Language: *
< Date: Fri, 13 Feb 2015 16:47:47 GMT
< Content-Type: application/json
< Content-Length: 740
<
* Connection #0 to host api.sandbox.paypal.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
{"id":"PAY-3XB52861RA479681CKTPCVMY","
create_time":"2015-02-13T16:47:47Z",
"update_time":"2015-02-13T16:47:47Z",
"state":"created",
"intent":"sale",
"payer":{"payment_method":"paypal",
"payer_info":{"shipping_address":{}}},
"transactions":[{"amount":{"total":"7.47","currency":"USD","details":   {"subtotal":"7.47"}},"related_resources":[]}],"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3XB52861RA479681CKTPCVMY","rel":"self","method":"GET"},{"href":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-39015200YL315920D","rel":"approval_url","method":"REDIRECT"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3XB52861RA479681CKTPCVMY/execute","rel":"execute","method":"POST"}]}

A: "payment_method":"paypal"
This means the user (your customer) must (these are the missing steps in above):

*

*be redirected to Paypal from your application to the approval_url returned in the response (their response to your last curl call).

*the user will/must "approve" your request

*user will be sent back to your site/application to the url you set in return_url

*you'll need to execute the payment after that.

Reference: Accept a PayPal payment
This essentially maps to "Express Checkout" in the Classic API.
Hth..


text:
Q: Android studio can not recognize manifest file My Android Studio Chipmunk can not recognize AndroidManifest.xml files in all projects.
Other .xml files are correctly recognized. AndroidManifest is recognized as "plain-text".
I tried to update android studio (got bumblebee before) do completely clean install and also delete and reimport projects.
Any idea what could help ?

A: Problem fixed after updating Android Studio to Dolphin (2021.3.1) and gradle to 7.3.0


text:
Q: udunits2.h not found when installing units R package I have udunits2 R package installed but units R package still fails even if I use configure.arg containing correct headers and libs:
$ ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/
converter.h  udunits2.h  udunits.h

$ ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib/
libudunits2.a   libudunits2.so    libudunits2.so.0.1.0
libudunits2.la  libudunits2.so.0

Log from package installation:
> library(udunits2)
udunits system database read

configure.args = c(
  '--with-udunits2-lib=/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib/',
  '--with-udunits2-include=/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/'
)

> install_packages("units", reps, configure.args = configure.args)

* installing *source* package 'units' ...
** package 'units' successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... yes
configure: error: in `/tmp/RtmpPvLQ81/R.INSTALL1c932925e979/units':
configure: error:
--------------------------------------------------------------------------------
  udunits2.h not found!

  If the udunits2 library is installed in a non-standard location, use:

    --configure-args='--with-udunits2-lib=/usr/local/lib'

  for example, if the library was not found, and/or

    --configure-args='--with-udunits2-include=/usr/include/udunits2'

  if the header was not found, replacing paths with appropriate values for your
  installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
  environment variables.

  If udunits2 is not installed, please install it.
  It is required for this package.
------------------------------------------

File udunits2.h exists in path:
$ls /path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include/:
converter.h  udunits2.h  udunits.h

Setting environment variable doesn't help too:
export UDUNITS2_INCLUDE="/path/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/include"
export UDUNITS2_LIB="/apps/udunits/2.2.26/x86_64-linux-2.6-rhel6/lib"

Any ideas why units fails to install?


text:
Q: Visualforce apex:inputField and apex:detail with SLDS: on the roadmap or workaround? Long waiting, but seems still no support for apex:inputField and apex:detail in SLDS.
https://www.lightningdesignsystem.com/platforms/visualforce/
Does anyone know if that's on the roadmap or any viable workaround?
We have made a Bootstrap-layer hackish on the top of old VF-styles, but it's still incomplete and I need to decide to either finalize it or wait or dig for alternatives.
Requirement roughly is: 100% VF-features in a contemporary skin. needs not to be 100%-looking like SLDS, but must not look like aloha-retro style with the flair of 2006...


text:
Q: How to send MIDI or OSC signals to a Mac application from my iOS application? I'm thinking of writing an iPhone/iPad application to emulate a MIDI controller. I know there are already quite a few available but I still want to do my own. I have several questions about that:

*

*I know a little bit about MIDI, but I've recently heard about OSC. Obviously MIDI is supported by almost all DJ software applications, but does OSC have a critical advantage that makes it compelling?

*For example, is it possible for my iOS application to send OSC messages directly to the DJ application without going through a hosted proxy application (like most remoting applications)? Is it possible with MIDI?

*If I'm forced to go through a server application installed on the host machine, I've read about Bonjour and TCP sockets to communicate between iOS and my host proxy, but how can my host proxy send MIDI or OSC signals to DJ applications? Does it have to pose as a virtual MIDI device? Are there libraries available for that? On MacOSX? On Windows?

A: Take a look at the vvopensource project on Google Code.


text:
Q: Sentencia de insert no inserta nada a la BD y no muestra error Tengo esta sentencia preparada para insertar datos, aunque los recibe y sale que se inserto no inserta nada en la base de Datos:
Echo de las variables:
 echo "
".$unidad;
 echo "
".$cedula1;
 echo "
".$cedula2;
 echo "
".$cedula3
 echo "
".$articulo_falta;
 echo "
".$aparte_falta;
 echo "
".$documentos_implode;
 echo "
".$fecha_inicio;
 echo "
".$fecha_termino;
 echo "
".$dias;
 echo "
".$aclaratoria;
 echo "
".$estado_sancion_id;
 echo "
".$tipo_medida;
 echo "
".$tipo_circunstancia;
 echo "
".$atenuantes_implode;
 echo "
".$agravantes_implode;
 echo "
".$total_demerito;
 echo "
".$lugar;

Datos de los Echo
033100000000
17739707
8644097
8644097
35
1
2-1
2017-03-23
2017-03-24
1
qwrqwrwq
1
2
40
3-4
0
6.55
2

Sentencia
$stmt = $conexion->prepare("INSERT INTO sanciones (
      unidad,
      cedula_sancionado,
      cedula_sancionador,
      cedula_superior,
      articulo_falta,
      aparte_falta,
      documento_seleccion,
      fecha_inicio,
      fecha_termino,
      dias_sancion,
      aclaratoria_sancion,
      estado_sancion_id,
      medida_id,
      articulo_circunstancias,
      agravante_seleccion,
      atenuante_seleccion,
      total_demerito,
      estado_lugar_id)
      VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
var_dump($stmt);

$stmt->bind_param("siiiiisssisiiissdi"
 ,$unidad
 ,$cedula1
 ,$cedula2
 ,$cedula3
 ,$articulo_falta
 ,$aparte_falta
 ,$documentos_implode
 ,$fecha_inicio
 ,$fecha_termino
 ,$dias
 ,$aclaratoria
 ,$estado_sancion
 ,$tipo_medida
 ,$tipo_circunstancia
 ,$agravantes_implode
 ,$atenuantes_implode
 ,$total_demerito
 ,$lugar);
$stmt->execute();

var_dump($stmt);

if ($stmt){
echo ('');
/*echo ("");*/
$stmt->close();
}else{
    echo ('');
    echo ("");
}

Sale "OMD generada satisfactoriamente" pero no inserta en la base de datos
Empezo a fallar cuando agregue $unidad a la insercion. la tabla tiene 19 campos (uno es el ID autoincremental)
El problema era que cuando la persona ingresaba algun dato este se ponia disabled, para evitar eso decidi clonar los campos de texto y al ser llenado un campo este obtenia su valor, resulta que varios valores INT se convertian a STRING procedi a multiplicar por 1 las variables
Ahora me da error el bind_param

A: Prueba lo siguiente, devuelve un booleano:
if($stmt->execute()){
    //...
}else{
    //...
}

A: El problema era que estaba asignando $estado_sancion y era $estado_sancion_id


text:
Q: Is the light escaping from a massive star held back a bit by the pull of gravity, or by the warping of spacetime near it? In The Universe in a Nutshell chapter 4, Hawking explains the warping of spacetime according to general relativity.
Near a massive but ordinary star, spacetime is warped such that the light emitted from the star appears to move slower when near the star, and appears to "speed up" to the constant speed of light c when away from the star, from the viewpoint of an outside observer.  Of course, we can't directly measure this experimentally because there is no way to measure the speed of light near a star from the reference point far away from a star. (Do I have this right?)
Hawking writes that this "slower" light is due to the warping of spacetime near the star, and this leads into the discussion of how spacetime and light behaves near a black hole.
I've always heard that light cannot escape a black hole due to the extreme gravity from the super-dense black hole (star).  And so it make sense that near an ordinary massive star, light can escape but "struggle" to do so, going "slower" near the star before "breaking free" and "speeding up" to what we see as the speed of light farther away from it.  (I use scare quotes as I realize these idioms are shortcuts for understanding relativity and not literally true.  Feel free to correct me if I am using them incorrectly.)
So which is it?  Is the light escaping from a massive star held back a bit by the pull of gravity, or by the warping of spacetime near it?   Or is it both, additively?  Or are both concepts two sides of the same coin in a way I am missing?

A: I believe it is the warping of spacetime. Because gravity described by general relativity is't like a normal force you would think of it is the bending of spacetime that is gravity. And light moves constant in a vacuum. PLEASE PLEASE PLEASE correct me if I am wrong because I love information.

A: I don't have enough physics knowledge, so please correct me as you see fit.
Short answer: both.
Long answer: the "actual" reason can be said to be the warping of spacetime as Hawking describes. But what is this warping for? Isn't it because of the gravity? The gravity affects particles as it warps the spacetime, and these two are just different ways of saying one thing. Even earth bends spacetime and so attracts other objects. This is this warped spacetime that let's earth to attract you to it and this warping is so negligible that gravity is the smallest force of nature. This means that the two scenarios you have mentioned as two distinct answers are both the same, and warped spacetime is the reason of the other answer based on common experience of gravity.


text:
Q: Create variable only once inside a looped function I have function which gets looped very often.
Inside of it I want to create a variable which then will be increased constantly.
My problem is that when I define it inside the function, it gets overwritten with a new iteration, nullifying its use.
So I want to define it only once no matter how often it gets looped. But maybe there is another solution, too.
My code and the variable I mean is aniTimer:
def animate(self, sprite_array, animation_length_in_s, pos):
    aniTimer = ?    #How do I define it only once?
    ani_len     = animation_length_in_s
    sprite_len  = len(sprite_array) -1

    if time.time() >= aniTimer + ani_len:
        self.aniCount += 1
        aniTimer = time.time()
        if self.aniCount > sprite_len:
            self.aniCount = 0

I tried this:
def animate(self, sprite_array, animation_length_in_s, pos):
    try:
        aniTimer
    except NameError:
        aniTime = time.time()

    ani_len     = animation_length_in_s
    sprite_len  = len(sprite_array) -1

    if time.time() >= aniTimer + ani_len:
        self.aniCount += 1
        aniTimer = time.time()
        if self.aniCount > sprite_len:
            self.aniCount = 0

And I tried this:
def animate(self, sprite_array, animation_length_in_s, pos):

    if "aniTimer" not in locals():
         aniTime = time.time()

    ani_len     = animation_length_in_s
    sprite_len  = len(sprite_array) -1

    if time.time() >= aniTimer + ani_len:
        self.aniCount += 1
        aniTimer = time.time()
        if self.aniCount > sprite_len:
            self.aniCount = 0

But both tries always execute. Which also leads me to the questions why this happens. The NameError should only be there once and after defining the variable, it should be in locals().
Also defining the variable globally leads to the error that the local variable gets referenced before it gets defined.
And defining it as a global var inside the functions utillity.
MRE
And here is a MRE, with nearly the same problem, but with the variabel timer. This function would be called by many objects, so timer would need to have a individual value for each object who called it.
timer = 0
breaks = 3
looping = True

def test():

    while looping:
        timer += 1
        print(timer)
        if timer >= breaks:
            print("Print this")
            break

test()

A: Try a class variable that's initialized to None.  This is the standard idiom in Python, with direct cognates in many other languages.
import time
class Foo():

    aniTime = None

    def animate(self):
        if Foo.aniTime is None:
            Foo.aniTime = time.time()

food = Foo()
food.animate()
print(food.aniTime)
time.sleep(2)

fool = Foo()
fool.animate()
print(fool.aniTime)

Output:
1603149209.5965674
1603149209.5965674

The second call does not change the originally-saved time.

A: If you wanted to use a global variable, you could use global aniTime at the top of your function to use it in your function
The best practice is probably to save your variable outside the loop where the function is being called, and you can pass it as a parameter into the function

A: Try to define the variable outside of any functions, call it into the function and then return it from the function after each use.
var = 1

def example(var):
    #insert program code
    var += 1
    return var

var = example(var)

This will make it that every time the 'example' function runs, 'var' is passed into it and then brought back out increased by one. Every time this function is used while the program is running, the variable 'var' will be increased by one.
In this case you can substitute the 'var' variable I have used as an example for for 'aniTime' variable and you only have to define it once before the function and it is not overwritten with the initial starting value every time you call the function.


text:
Q: Regular expression for relative URLs (segment after the domain name) [& no querystring] The relative URLs that I need to match are as follows:
/
/asdf
/asdf.php
/sdfsf/
/asdfsdf/asdf
/asdfsdf/s-_df.jpg
/
/asdf#
/asdf.php#
/sdfsf/
/asdfsdf/asdf#
/asdfsdf/s-_df.jpg#

I have tried a number of patterns but seem to be hitting the wall -
https://regex101.com/r/GnK43b/4
https://regex101.com/r/GnK43b/1
In the outcome, I need the the regex groups such that I get the segments:
For e.g.
/sdfsf/ => Group 1: sdfsf
/asdfsdf/asdf => Group 1: asdfsdf; Group 2: asdf

A: It's not very clear how exactly you expect the results, but let's imagine you want to get these matches:
URL                     GROUP1        GROUP2
----------------------------------------------------------
/
/asdf                   asdf
/asdf.php               asdf.php
/sdfsf/                 sdfsf
/asdfsdf/asdf           asdfsdf       asdf
/asdfsdf/s-_df.jpg      asdfsdf       s-_df.jpg
/asdfsdf/s-_df.jpg#     asdfsdf       s-_df.jpg

then you could use this regex:
/^/(?:([0-9a-zA-Z._]+)#?)(?:/([0-9a-zA-Z._]+#?)?)?$/gmU
https://regex101.com/r/GUTGn4/2

A: To match all those values, you could match the forward slash followed by repeating 0+ times all the characters that you would allow in the character class to match followed by a forward slash.
At the end repeat 0+ times any chars listed in the character list and an optional #
^/(?:[0-9a-zA-Z_]+/)*[0-9a-zA-Z_.-]*#?$

*

*^/ Start of string and forward slash

*(?:[0-9a-zA-Z_]+/)* Match 0+ times any of the listed and forward slash

*[0-9a-zA-Z_.-]* Match 0+ times any of the listed

*#? Match optional #

*$ End of string

Regex demo


text:
Q: How to flag a given value based on a range rule I've flags, each range of value has a flag.
for ex :

*

*value = 0 is D

*value > 0 and < 0.2 is C

*value >=0.2 and <=0.8 is B

*value > 0.8 is A

flag = ["A", "B", "C", "D"]
def get_flag(value) :
            if value == 0: return "D"
            elif value > 0.8: return "A"
            elif value <=0.8 and value >= 0.2: return "B"
            else: return "C"

i think this implementation is annoying and not algorthmically pretty to see, any suggestions so i can get the correct index in python, i thought about modulo and div but values are floats between 0 and 1.

A: Reorder your conditions:
def get_flag(value) :
    if value == 0: return "D"
    elif value < 0.2: return "C"
    elif value <= 0.8: return "B"
    else: return "A"

It looks pretty clear to me what the ranges are now.

A: You don't need elif and else here, since return ends the execution of the function (so that lines after a return are not executed if the preceding return is triggered):
def get_flag(value) :
    if value == 0: return "D"
    if value < 0.2: return "C"
    if value <= 0.8: return "B"
    return "A"

A: Yet another option to improve readability:
def get_flag(value):
    if value >= 0.8:
        return('A')

    elif value >= 0.2:
        return('B')

    elif value > 0:
        return('C')

    else:
        return('D')

A: Using the same idea as @aa_nador (his answer has been deleted), store the separation points and flags in the list, and determine the index through binary search. Here, the second separation point is the next floating point number in the negative direction of 0.2 instead of 0.2 so that 0.2 can be distributed to index 2:
>>> seps = [0, math.nextafter(0.2, -math.inf), 0.8]
>>> flags = list('DCBA')
>>> {i / 10: flags[bisect.bisect_left(seps, i / 10)] for i in range(10)}
{0.0: 'D',
 0.1: 'C',
 0.2: 'B',
 0.3: 'B',
 0.4: 'B',
 0.5: 'B',
 0.6: 'B',
 0.7: 'B',
 0.8: 'B',
 0.9: 'A'}


text:
Q: Link (Href) to a hidden (display:none) html element I've a problem with anchor tags :/
I've got the following code:

 A

 B

B

My goal is that when i click on B (divHrefB) the application go to "divB" but since this element hidden it doesn't work.
Please note, that i don't want to show divB (i want a link to the place where div are... is that possible?
At this point, i'm thinking on generate dynamically the href value (in this case, i would generate the following div)

B

Thanks a lot.

A: just don't apply display: none, just add this css for the hidden div.

B

A: You're missing the ending closing " comment.
try this guy:
style="display: none;"

A: you are missing " in style end

    A

    B

   B


text:
Q: Woocommerce Orders List Output I'm trying to make a table with the list of Orders but something is missing and I don't understand what it is ...
Can you help me?
My custom plugin is called "connector-wc-alma" and my output page is "testes.php" (connector-wc-alma/testes.php)
What am I missing?
Here goes the code:
<?php
{
    /**
     * Classe woo_export
     **/
    if (!class_exists('woo_export')) {

        class woo_export {

            public function __construct() {

                $this->order_status = array(
                    'completed'     => __( 'Concluída', 'woo-export-order' ),
                    'cancelled'     => __( 'Cancelada', 'woo-export-order' ),
                    'failed'        => __( 'Falhada', 'woo-export-order' ),
                    'refunded'      => __( 'Reembolsada', 'woo-export-order' ),
                    'processing'    => __( 'Processamento', 'woo-export-order' ),
                    'pending'       => __( 'Pendente de Pagamento', 'woo-export-order' ),
                    'on-hold'       => __( 'Pendente de Pagamento Paypal', 'woo-export-order' ),
                );

                add_action( 'admin_enqueue_scripts', array(&$this, 'export_enqueue_scripts_css' ));
                add_action( 'admin_enqueue_scripts', array(&$this, 'export_enqueue_scripts_js' ));
            }

            /**
             * Funções
             */

            function export_enqueue_scripts_css() {

                if ( isset($_GET['page']) && $_GET['page'] == 'conector-wc-alma%2Ftestes.php' ) {
                    wp_enqueue_style( 'semantic', plugins_url('/css/semantic.min.css', __FILE__ ) , '', '', false);

                    wp_enqueue_style( 'semanticDataTable', plugins_url('/css/dataTables.semanticui.min.css', __FILE__ ) , '', '', false);

                    wp_enqueue_style( 'semanticButtons', plugins_url('/css/buttons.semanticui.min.css', __FILE__ ) , '', '', false);

                    wp_enqueue_style( 'dataTable', plugins_url('/css/data.table.css', __FILE__ ) , '', '', false);
                }
            }

            function export_enqueue_scripts_js(){

                if (isset($_GET['page']) && $_GET['page'] == 'conector-wc-alma%2Ftestes.php') {
                    wp_register_script( 'dataTable', plugins_url().'/conector-wc-alma/js/jquery.dataTables.js');
                    wp_enqueue_script( 'dataTable' );

                    wp_register_script( 'dataTableSemantic', plugins_url().'/conector-wc-alma/js/dataTables.semanticui.min.js');
                    wp_enqueue_script( 'dataTableSemantic' );

                    wp_register_script( 'dataTableButtons', plugins_url().'/conector-wc-alma/js/dataTables.buttons.min.js');
                    wp_enqueue_script( 'dataTableButtons' );

                    wp_register_script( 'buttonsSemantic', plugins_url().'/conector-wc-alma/js/buttons.semanticui.min.js');
                    wp_enqueue_script( 'buttonsSemantic' );

                    wp_register_script( 'woo_pdfmake', plugins_url().'/conector-wc-alma/js/pdfmake.min.js');
                    wp_enqueue_script( 'woo_pdfmake' );

                    wp_register_script( 'jszip', plugins_url().'/conector-wc-alma/js/jszip.min.js');
                    wp_enqueue_script( 'jszip' );

                    wp_register_script( 'vfsfonts', plugins_url().'/conector-wc-alma/js/vfs_fonts.js');
                    wp_enqueue_script( 'vfsfonts' );

                    wp_register_script( 'buttonsHTML5', plugins_url().'/conector-wc-alma/js/buttons.html5.min.js');
                    wp_enqueue_script( 'buttonsHTML5' );
                }
            }

            function export_orders_page(){

                global $wpdb;

?>

<?php
function get_customerorderid(){
global $order, $post;

if( ! is_a($order, 'WC_Order') ) {
        $order_id = $post->ID;

        // Ir buscar a instance do object WC_Order
        $order = wc_get_order($order_id);
    } else {
        $order_id = $order->id;
    }

    // Ir buscar o user ID à WC_Order methods
    $user_id = $order->get_user_id(); // or $order->get_customer_id();

return $user_id;
}

                $args = array(
                    'limit' => -1,
                );
                $orders = wc_get_orders( $args );
                $var = $today_checkin_var = $today_checkout_var = $booking_time = "";
                foreach ( $orders as $id_key => $order ) {

                    //$order = wc_get_order( $id_value->order_id );

                    if ( $order->get_status() === 'processing' ) {
                        $order_items = $order->get_items();

                        $my_order_meta = get_post_custom( $order->get_id() );

                        $c = 0;
                        foreach ($order_items as $items_key => $items_value ) {
                            $var .= "

    ".$order->get_id()."
    ".$this->order_status[$order->get_status()]."
    ".$my_order_meta['_billing_first_name'][0]." ".$my_order_meta['_billing_last_name'][0]."
    ".$order->get_user_id()."
    ".$my_order_meta['_billing_email'][0]."

    ".$order->get_formatted_order_total()."
    ".$order->get_date_created()->format ('d/m/Y H:i')."
    get_id()."&action=edit\">Encomenda
    get_id()."\">Anexos
    get_id()."&_wpnonce=c414ccf266\">Alterar p/ Em Processamento
    get_id()."\">Sincronizar

";

                            $c++;
                        }
                    }
                }

                ?>

                            <?php _e( 'Enc.' , 'woo-export-order' ); ?>
                            <?php _e( 'Estado', 'woo-export-order' ); ?>
                            <?php _e( 'Cliente' , 'woo-export-order' ); ?>
                            <?php _e( 'ID Cliente', 'woo-export-order' ); ?>
                            <?php _e( 'Email', 'woo-export-order' ); ?>

                            <?php _e( 'Valor' , 'woo-export-order' ); ?>
                            <?php _e( 'Data' , 'woo-export-order' ); ?>
                            <?php _e( 'Ver' , 'woo-export-order' ); ?>
                            <?php _e( 'Download' , 'woo-export-order' ); ?>
                            <?php _e( 'Acção' , 'woo-export-order' ); ?>
                            <?php _e( 'Sincronizar' , 'woo-export-order' ); ?>

                    <?php echo $var;?>

            <?php

            }
        }
    }

    $woo_export = new woo_export();
}

Can you help me?
What am I missing?


text:
Q: AHB AP transaction error with zynq board I'm new at zynq board. I am trying to work with XADC of zynq-xc7z020 and want to see its quality for my application through vivado and xilinx SDK.
I tested two ways of designing through lab3 and lab4 tutorials. Synthesis, implementation and generating bitstream are OK in vivado. in the Xilinx SDK, after programming of the board, when I run a simple printf through system debugger or GDB but I get "AHB AP transaction Error". I googled it a lot and spent few days for it, but didn't get any solution. Additional, I tried to connect to the arm core of the board through XMD console by "connect arm hw" command. but console get JTAG connection error, while JTAG cable is connected and programming of the board is done.
suggested solutions of here didn't help.
thank you.

A: I understand what my mistake was.
Through XSCT console in SDK, I run mrd command to access DDR and read its address. but I couldn't. So I got that the problem was from DDR configurations.
I create a new project and at the first step of designing, after adding ZYNQ7 Processing System to block design, click on 'run block automation' and continue all previous steps and it worked. The point was that automation run. It sets some auto configuration of block that have to be set; and my mistake was this, that I connected DDR port manually.


text:
Q: What is the best way to share an AWS RDS instance across multiple Stacks? I'd like to create one larger RDS instance and share it across OpsWorks stacks so I can pool the database resources across multiple applications.  Here is a reference to the OpsWorks docs for configuring the data sources for an app:
http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-all-app-types
I've tried using the RDS option (under Data Sources) to select an existing RDS instance.  However, Opsworks only displays instances that are currently not attached to another Stack.
The only option I can think of is to choose None under Data Sources and then manually configure the deploy JSON for the database settings.  One downside to this approach is the hookup is not "automatic" so I'm not sure if any functionality will be lost.  Also, I would have to store the database user and password in the Stack JSON which is possibly less secure than the automatic hookup.
Any advice is appreciated.

A: Here is the solution I ended up using.

*

*Select "None" for the App Data source type.

*Add the following deploy Custom JSON database settings to your Stack Settings for each app:

  {
    "deploy": {
        "YOURAPP": {
          "database": {
            "adapter": "mysql2",
            "host": "HOST",
            "port": "3306",
            "database": "DATABASE",
            "username": "USERNAME",
            "password": "PASSWORD",
            "reconnect": "false"
          }
        }
      }
    }


text:
Q: Dynamically initialize a ng-model directive I'm dynamically building a form with angular depending of the kind of input:

        <myDirective my-data="field.param" ng-model="field.model"></myDirective>

I've got two problems with my directive which builds a custom dropdown input:

*

*Ng-model directive interprated the name field.model as plain text, whereas I would like the attributs ng-model="field.model" would be replaced by the value contained into field.model. Curly brackets don't seems to work here. Any idea?

*How to let the ng-model value accessible both in my form controller, and into my custom directive's controller?
Exemple of a field object:
{
    label : "Name",
    model : "employeeName",
    type : "dropdown",
    param : {
        dropdownArray : result,
        dropdownName : 'Nom',
        dropdownFieldValue : 'nameUUID',
        dropdownVisibleValue : [ 'employeeSS', 'employeeName' ]
    }
}

Then in my controller I should be able to access this dropdown value with: $scope.employeeName.

A: *

*It sounds like you're accessing field.model via the attributes input parameter supplied to the link function in your directive. Instead, you should be accessing it via the scope variable.
link: function(scope, element, attributes) {
  // attributes.ngModel will yield 'field.model'
  // scope.ngModel will contain the actual value of field.model
}

*If you don't explicitly define an isolate scope for your directive, then ng-model assigned to field.model should be available in your directive via the scope variable as I mentioned above.
scope: false  // This is the default

// Define an isolate scope with field.model available through scope.ngModel
scope: {
  ngModel: '='
}

Hope that helps.


text:
Q: Upload file using multer after specific database operation in node js I am using multer to upload files via express.
Is there a way to perform a database operation before uploading the file?
I need to perform a conditional check whether the user insertion in the database was successful or not depending on that, the file upload should be performed.

A: To use multer as per required you can use the following code:
var path = require('path');
var multer = require('multer');

var storage = multer.diskStorage({
    destination: function(req, file, callback) {
        callback(null, './uploads')
    },
    filename: function(req, file, callback) {
        console.log(file)
        callback(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname))
    }
});

destination is to specify the path to the directory where uploaded files will be stored.
filename is used to determine what the file should be named inside the folder. In this case, we upload the file using a return number value from Date.now() instead of the original name and add a original file extension using the built-in path Node.js library.
path.extname(file.originalname);

app.post('/insertUpload', function(req, res) {
    // connection  is db connection variable
    var username = req.body.username;
    var query = connection.query('INSERT INTO users SET ?', username,
      function(err, result) {
        console.log(result);
        if(!err){ // if not error after insert

          var upload = multer({
             storage: storage
          }).single('userFile')
          upload(req, res, function(err) {
            res.end('File is uploaded')
          });
        }
    });

});


text:
Q: How many words are fixed by a permutation subgroup? Let $A$ be an alphabet with $N$ letters, and consider the set $W$ of words of length $Q$ with letters drawn from $A$:
$$ W = \left\{ \mathbf{w} = (w_{1},w_{2},\dots,w_{Q}), w_{i} \in A \right\}.$$
Let $G$ be a subgroup of the permutation group $S_{Q}$. We define the action of $G$ on $W$ by
$$g \cdot (w_{1},w_{2},\dots,w_{Q}) = (w_{g^{-1}(1)},w_{g^{-1}(2)},\dots,w_{g^{-1}(Q)}),$$
where $G$ acts on $[Q] = \{1,2,\dots,Q\}$ as a permutation.
Let $W^{G}$ be the subset of $W$ consisting of words fixed by all elements of $G$:
$$W^{G} = \{ \mathbf{w} \in W \colon g \cdot \mathbf{w}  = \mathbf{w} \,\, \forall g \in G\}.$$
I am interested in the size of $W^{G}$. I have the following conjecture:

Conjecture: $$ \left| W^{G} \right| = N^{\left| [Q] / G \right|},$$
where $[Q] / G$ is the set of orbits of $G$ in its action on $[Q]$.

Is this true, and if so, how can we prove it? Something like this appears in this question, but there no proof is given.

A: As said elsewhere, its not a group action, see $\mathbb{Z}_5$ as a subgroup of $S_5$ and the induced action on a vector space.
Hint: Since the group $G$ and the set $W$ the group operates on are finite,
you can apply the orbit-stabilizer theorem for verification of your conjecture.


text:
Q: axios data is not fetched on first run I am trying to fetch and display data from OpenWeather api but on first run the currentWeather object will be empty then on reload the data is fetched. Here is the code
import { Box, CssBaseline } from "@mui/material";
import { useEffect, useState } from "react";
import CardList from "./components/CardList";
import axios from 'axios'

function App() {
  const [currentWeather, setCurrentWeather] = useState({})

  useEffect(() => {
    const getCurrentWeather = (city) => {
      axios.get(`https://api.openweathermap.org/data/2.5/weather? q=${city}&appid=${API_KEY}&units=metric`)
      .then(res =>
        setCurrentWeather(res.data)
        )
      .catch(err =>
        console.log(err)
        )
      .finally(() => {
        console.log(currentWeather)
       }
       )
    }
    getCurrentWeather('Bulawayo')
}, [])

return (
  <Box sx={{
    p: 4,
    backgroundColor: "#f3f6fa",
  }}>
    <CssBaseline />
    <CardList currentWeather={currentWeather} />
  </Box>
);
}

export default App;

any help would be appreciated thank u


text:
Q: WPF Borderless window is maximized only to primary screen size I have a problem with multimonitor system and maximizing my borderless WPF C# .NET 4.0 window. One monitor is 1680x1050 (primary) and the second is 1920x1080 (secondary). When I'm maximizing my window on the primary screen - no problems, even when I switch the order of those two. But every time I'm trying to maximize it on the secondary screen it's being cut off to the size of primary monitor. I see that the window size is given appropriate but this doesn't work.
Getting the size of monitor:
    private System.Windows.Forms.Screen GetCurrentScreen()
    {
        System.Drawing.Point centerPoint = new System.Drawing.Point((int)(Left + Width / 2), (int)(Top + Height / 2));
        foreach (System.Windows.Forms.Screen s in System.Windows.Forms.Screen.AllScreens)
        {
            if (s.Bounds.Contains(centerPoint))
            {
                return s;
            }
        }
        return null;
    }

Maximizing:
    private void Maximize
    {
        if (this.WindowState == WindowState.Normal)
        {
            var scr = GetCurrentScreen();

            //this.MaxHeight = scr.WorkingArea.Height;
            //this.MaxWidth = scr.WorkingArea.Width;

            if (scr != null)
            {
                if (scr.Primary)
                {
                    this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
                    this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
                }
                else
                {
                    this.MaxHeight = double.PositiveInfinity; //even ridiculous values don't work
                    this.MaxWidth = double.PositiveInfinity;
                    this.Height = scr.WorkingArea.Height; // correct values of 2nd screen
                    this.Width = scr.WorkingArea.Width;
                }
            }
            else
            {
                this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
                this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
            }

            this.WindowState = WindowState.Maximized;
    }

What I get is:
http://imgur.com/ZYzVV9Q,yf7lSfY#1
What I want:
http://imgur.com/ZYzVV9Q,yf7lSfY#0
Thanks

A: This worked for me last time I had to maximize a window on my secondary screen:
Screen sTwo = Screen.AllScreens[1];
this.Top = sTwo.Bounds.Top;
this.Left = sTwo.Bounds.Left;
this.Width = sTwo.Bounds.Width;
this.Height = sTwo.Bounds.Height;

Make sure you add the reference
using System.Windows.Forms;

And set
AllowsTransparency="True"

in your *.xaml

A: There is a possibility that some of your code is causing this issue as I cannot replicate it on my two screens... they are both the same size, but if I change the resolution on one, the application still maximises correctly. If you start a new WPF Application and just add
WindowState = "Maximized"

to the Window declaration, do you still have the same problem?

A: Try to override or correct ArrangeOverride method:
http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.arrangeoverride.aspx

When overridden in a derived class, positions child elements and
  determines a size for a FrameworkElement derived class

Symptoms are similar.


text:
Q: Authenticating django with Authomatic - Best workflow I just started working in Django and it is awesome!
I want my webapplication to be accessible for a restricted number of people with their twitter account. To realize this, I use the plugin Authomatic.
This is a starter example that shows how you can use Authomatic with Django. From this, I use the following code snippit:
def login(request, provider_name):
    # We we need the response object for the adapter.
    response = HttpResponse()

    # Start the login procedure.
    result = authomatic.login(DjangoAdapter(request, response), provider_name)

    if result:
        response.write('Home')

        elif result.user:
            if not (result.user.name and result.user.id):
                result.user.update()

            var username = result.user.name
            var id = result.user.id
return response

My question is as follows: After checking if the username is one of the allowed twitter users, how do I login so the user kan browse all the protected pages? I am used to use something like this:
user = authenticate(username=username, password=password)
if user is not None:
    if user.is_active:
        login(request, user)

But the problem is that the twitter users don't have a User object assigned to them. The only thing I can think off is hardcoding a default "allowed" user in my code, but that seems quite dodgy...
EDIT: I tried to implement Ashwin's answer, but that gives me this:
# We we need the response object for the adapter.
    response = HttpResponse()
# Start the login procedure.
result = authomatic.login(DjangoAdapter(request, response), provider_name)
if result:
    response.write('Home')
if result.error:
    # Login procedure finished with an error.
    response.write('
Damn that error: {0}
'.format(result.error.message))

elif result.user:
    # We need to update the user to get more info.
    if not (result.user.name and result.user.id):
        result.user.update()

    # Welcome the user.
    response.write(u'
Hi {0}
'.format(result.user.name))
    response.write(u'
Your id is: {0}
'.format(result.user.id))
    response.write(u'
Your email is: {0}
'.format(result.user.email))

    # if result.user.id == 110740012624414845989:
    uname = result.user.id
    pwd = '** RANDOM PASSOWRD I SHOULD HAVE? **'
    user = authenticate(username=uname, password=pwd)
    login(request, user)

First of all I can't imagine that it is good practice to have a password writter in my code like this. Second I get the error Provider name "username" not specified!
Does anybody know what I am doing wrong?

A: You can create individual User objects for all the allowed users, then the job will be really easy. Just check if the username is available in the database, authenticate and login the request.


text:
Q: Minecraft fully-auto fuel source? (I believe) I'm using the latest version of Minecraft Bedrock Edition (1.17.10) and I want to know if I can design a fully-auto fuel system for furnaces/smokers/blast furnaces?
Things I've thought about:

I've wondered about kelp, but you have to craft dried kelp into kelp blocks to use it as fuel, so I don't think this is possible

Maybe bamboo would work? The only thing with bamboo is that it doesn't last long as fuel, so I'd probably need massive amounts of it to keep smokers going.

How about lava with drip stones to fill cauldrons so I can use lava buckets? I don't know how to get something to fill a bucket with lava, place it into a smoker for fuel, come out afterwards, and grab more lava!

Question: Can someone give a link or an idea of how to make a FULLY-auto fuel source to keep at least 1 smoker going all day? If needed, I can scale up from whatever you all come up with.
As always, thanks!

A: You can try using this universal wood farm design by SilentWhisperer, and then hooking it up with hoppers to a super smelter to create charcoal (Also designed by SilentWhisperer). Once you create that charcoal, you can then hook that up to whatever furnace you want to smelt automatically. Just note that the wood farm needs to use bone meal. I recommend finding a bonemeal video by SilentWhisperer or JCPlayz, because they mostly specialist in making Minecraft Bedrock Edition farms.
Wood Farm:
Silentwhisperer's Wood Farm
Super Smelter:
Silentwhisperer's Super Smelter

A: Build a large scale bamboo farm with flyign machines and as long as those chuncks are rendered, itll be fully automatic, you can try building a redstone chunk loader.(pretty sure ilmango has a video on them)


text:
Q: Protecting I2C bus with diodes I'm trying to add some protection to an I2C bus, and keep getting an unexpected result.

simulate this circuit – Schematic created using CircuitLab
In principle, I'd expect this to clamp the signal (which I simulate with a sine wave and a small resistor) to between -0.6 to 5.6V. In the simulation, this looks good, but in reality (using LSM115JE3 diodes), the bus signal cannot reach above 3.6V -- which coincidentally is \$5V - (2 \times 0.7V)\$.
Any idea what might cause such an effect?

A: Looking at the datasheet datasheet, it seems like those diodes can have a significant reverse current -- up to several milliamps at 5V if they're warm. They also have a nontrival junction capacitance, on the order of 100 pF.
The main question is whether this is an AC problem or a DC problem. If the DC level is correctly pulled up to 5V but the rise times are too slow during transmission, try using stiffer pull-ups, no more than 1000 ohms. (You do have pull-up resistors, right? You need pull-ups for I2C.) If the DC level is stuck at 3.6V, try measuring the diode current with a multimeter to make sure they're not broken. You could also try removing the 100 ohm resistor.


text:
Q: Toeplitz matrix initialization I am trying to initialize a Toeplitz matrix in java. I want it to have this form
6 -4 1 0 0 ... 0
-4 6 -4 1 0 ... 0
 1 -4 6 -4 1 ...0
 ................
 0 ... 1 -4 6 -4 1
 0 ... ...1 -4 6-4
 0 .. ... 0 1 -4 6
I realized that the problem is in the if(j>i) in the bounds of data[i-j-1] . I tried to change it but i get the IndexOutOfBounds error. Here is the code i've written so far
    int a1[][] = new int[size][size];

    int data[] = new int[size];

    data[0] = 6;
    data[1] = -4;
    data[2] = 1;

    for(int i=3; i<size; i++){
        data[i] = 0;
    }

    /* Creating the A1 matrix */
    for(int i=0; i<size; i++)
    {
        for(int j=0; j<size; j++)
        {
            if(j>i){
                a1[i][j] = data[j-i-1];

            }else if(j==i){
                a1[i][j] = data[0];

            }else{
                a1[i][j] = data[i-j-1];
            }

        }
    }

And the output is
    The Matrix is :
6   6   -4  1   0   0   0   0   0   0
6   6   6   -4  1   0   0   0   0   0
-4  6   6   6   -4  1   0   0   0   0
1   -4  6   6   6   -4  1   0   0   0
0   1   -4  6   6   6   -4  1   0   0
0   0   1   -4  6   6   6   -4  1   0
0   0   0   1   -4  6   6   6   -4  1
0   0   0   0   1   -4  6   6   6   -4
0   0   0   0   0   1   -4  6   6   6
0   0   0   0   0   0   1   -4  6   6

A: The problem is if i = j+1 or j = i+1, a1 is assigned a1[i][j] = data[0]. This is an off-by-one mistake, you should remove the 1:
for(int j=0; j<size; j++) {
    if(j>i){
        a1[i][j] = data[j-i];
    }else if(j==i){
        a1[i][j] = data[0];
    }else{
        a1[i][j] = data[i-j];
    }
}


text:
Q: Change label of donut chart in c3js I've used setting label on start and its working, here is the working code:
var chartDonut1 = c3.generate({
    data: {
        columns: [
            ['data1', 30],
            ['data2', 120],
        ],
        type : 'donut'
    },
    donut: {
        title: "title"
    }
});

But, i want to change the label on the donut based on search, and for that purpose i need to use load function.
EDIT:
Here is example of donut chart and with title: LINK
How can label be change/set on load?
I've tried setting like code bellow, but i can't make it work:
chartDonut1.load({
    json: dataJsonGraph,
    donut: {
        title: 'title1',
    },
    bindto: '#chartDonut1'
});

Any suggestion will be great!

A: I think the bindto: '#chartDonut1' should be declared inside the generate function.
It seems you cannot change dynamically graph's title inside load function (In c3js documentation, no reference to it).
You will need to select the chart using d3 instance, then change the title. Example:
var label = d3.select('#chart2 text.c3-chart-arcs-title');
label.html(''); // remove existant text
label.insert('tspan').text('30').attr('dy', 0).attr('x', 0).attr('class','big-font');
label.insert('tspan').text('Test Data').attr('dy', 20).attr('x', 0);

A way to change it is to edit html's code : http://plnkr.co/edit/ew5dDA1R3biXnMp80LDd?p=preview


text:
Q: Event ID 91 — AD CS Active Directory Domain Services Connection I have installed AD CA and I am getting this error(Event ID 91) :
A connection to Active Directory Directory Services could not be established. Active Directory Certificate Services will try to connect again when it needs Active Directory access.

it seems that CA cant connect to AD, I read this article about that,
PS:

*

*The ping to domain name and dc machine are normal

*The permissions on essential AD DS containers and objects are fine

*The result of nltest /sc_verify: [domainname] is :
I_NetLogonControl failed: Status = 1355 0x54b ERROR_NO_SUCH_DOMAIN
I am using VMware for testing this scenario.
but I still have this problem,
How can I solve that?
Thanks in your Advise.

A: my problem solved by installing Windows Server 2008 SP2.


text:
Q: sbyte and if operator Why the first statement is allowed but not the second in the below sample code?
sbyte test1 = true ? 1 : -1;             // Allowed
sbyte test2 = "a".Equals("b") ? 1 : -1;  // Not allowed

I checked that all .Equals(..) overloads for string return a bool.

A: The first statement includes a constant expression that can be evaluated at a compile-time. It's equivalent to this:
sbyte test1 = 1;

Technically, this is an assignment of an int literal (1) to an sbyte variable. But the compiler is smart enough to figure out that the value is small enough to fit into an sbyte range and allows an implicit conversion, i.e. you don't need to cast it to int.
The second statement includes a method call and those are only evaluated at runtime. In other words, the compiler isn't smart enough to simplify an expression. The only thing it knows is that this impression returns an unknown int value and those should be converted explicitly. For example, like this:
sbyte test2 = (sbyte) ("a".Equals("b") ? 1 : -1);

All of this is explained in the C# specification. See, Implicit constant expression conversions:

A constant_expression (Constant expressions) of type int can be converted to type sbyte, byte, short, ushort, uint, or ulong, provided the value of the constant_expression is within the range of the destination type.


text:
Q: Returning config.read() from function I have a config.py which reads in multiple config files.
from ConfigParser import *

def zones_config():
  zones_config = ConfigParser()
  zones = zones_config.sections()
  zones_config.read('zones.ini'), zones

def settings_config():
  settings_config = ConfigParser()
  settings_config.read('settings.ini')

Then in my database.py file:
from utils.config import settings_config

settings_config()

#mysqbdb config
ip = settings_config.get('mysqldb', 'ip')
username = settings_config.get('mysqldb', 'username')
password = settings_config.get('mysqldb', 'password')
database = settings_config.get('mysqldb', 'database')

However I get the following error:
AttributeError: 'function' object has no attribute 'get'

A: settings_config is a function, and .get() is a method of the ConfigParser object. This should explain it more clearly:
def settings_config_function():
  settings_config_object = ConfigParser()
  settings_config_object.read('settings.ini')
  return settings_config_object

Then in database.py:
from utils.config import settings_config_function

config_object = settings_config_function()

#mysqbdb config
ip = config_object.get('mysqldb', 'ip')
username = config_object.get('mysqldb', 'username')
password = config_object.get('mysqldb', 'password')
database = config_object.get('mysqldb', 'database')

Edit:
I also recommend you call
settings_config_object = settings_config_function()
another_example_config_object = another_example_config_function()

once at the bottom of config.py and later just
from utils.config import settings_config_object, another_example_config_object

in any files that require the configs, so that you don't have to instantiate a new ConfigParser and read the config files for every module that uses the config.


text:
Q: Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Web.Mvc.SelectList' I have a method in my controller:
private void ConfigureViewModel(EngineOIRemovalsViewModel model)
{
    model.MajSecList = db.EngineOIRFRs.Select(m => new SelectListItem { Value = m.MajorSection.ToString(), Text = m.MajorSection });
    if (model.SelectedMajorSection != null)
    {
        IEnumerable<EngineOIRFR> Areas = db.EngineOIRFRs.Where(l => l.MajorSection == model.SelectedMajorSection);
        model.AreaList = new SelectList(Areas);
    }
    else
    {
        model.AreaList = new SelectList(Enumerable.Empty<SelectListItem>());
    }
    if (model.SelectedArea != null)
    {
        IEnumerable<EngineOIRFR> SubAreas = db.EngineOIRFRs.Where(l => l.Area == model.SelectedArea);
        model.SubAreaList = new SelectList(SubAreas);
    }
    else
    {
        model.SubAreaList = new SelectList(Enumerable.Empty<SelectListItem>());
    }
    if (model.SelectedArea != null)
    {
        IEnumerable<EngineOIRFR> Failures = db.EngineOIRFRs.Where(l => l.SubArea == model.SelectedSubArea);
        model.FailureList = new SelectList(Failures);
    }
    else
    {
        model.FailureList = new SelectList(Enumerable.Empty<SelectListItem>());
    }
}

And I'm getting an error, from the title, in the below line:
model.MajSecList = db.EngineOIRFRs.Select(m => new SelectListItem { Value = m.MajorSection.ToString(), Text = m.MajorSection });

It says an explicit conversion exists for this, but so far my searching hasn't been able to find one. Any idea on how to solve this?

A: You have two problems (at least)
First, you are also not Selecting the right type. MajSecList is of type SelectList, but you are explicitly selecting SelectListItem. You will need to update your Select.
Second, Select is not executed right away. You need to use something like ToList or FirstOrDefault (depending on what you need) to actually execute the query and return the result:
model.MajSecList = db.EngineOIRFRs.Select(m => new SelectListItem { Value = m.MajorSection.ToString(), Text = m.MajorSection }).ToList();

The idea is that you can build a query, chaining together operations like Select or Where, etc. without performing the query each time.
Once you're done building your query and use FirstOrDefault or ToList (or others), it actually performs the query and returns the results.
Or just do what you're doing below that, and pass the query to the constructor of SelectList:
model.MajSecList = new SelectList(db.EngineOIRFRs.Select(m => new SelectListItem { Value = m.MajorSection.ToString(), Text = m.MajorSection }));


text:
Q: Netflow application ID to application name Im getting netflow data from multiples machines using filebeat, one of the fields I get is netflow.application_id and I need to transate the Id to the name of the application, the format of the application_id is this:
3, 0, 1, 244
four comma separated values.
how I can translate the id to a name?
is there a dictionary out there?
Thanks!

A: What you could do is use a script processor to split the values in the network.application_id field and then do a lookup to append the values accordingly. This is definitely an option, but not necessarily the only option. Feel free to accept this answer if it works for you.


text:
Q: Using package.json exports in a Typescript package I have a local Typescript package that I am importing into a project using npm I ./path/to/midule. The package.json for this package looks as follows:
{
    "name": "my_package",
    "version": "1.0.0",
    "main": "./build/src/index.js",
    ...
}

I am trying to switch from using the main field to the newer exports field as I would like more control over how my package is imported. I tried to replace the main field with something I thought to be equivalent:
{
    "name": "my_package",
    "version": "1.0.0",
    "exports": {
        ".": "./build/src/index.js"
    },
    ...
}

This however, does not work. When trying to import the package into my other project, I'm getting the following error:
Cannot find module 'my_package' or its corresponding type declarations.

I am generating the .d.ts files using the declarations flag with the typescript compiler and specified provided the exact path to the index.d.ts file in package.json, but the same error message persisted.
I am probably missing something simple, but can't seem to find what it is. How can I use the exports field in a Typescript package?

A: I ended up finding the answer:
You need to set the moduleResolution field in your tsconfig.json file to nodenext. I also needed to update to the latest LTS version of node.js.


text:
Q: Creating XPS-file programmatically creates corrupted file I am having problems creating a XPS-file programmatically. The code below does generate a XPS-file but when I try to open it is somehow corrupted and won't open. The output file isn't empty and its size is about right for type document I am trying to create. Output can be downloaded at here
     static void Main(string[] args)
    {
        using (var writer = File.OpenWrite("c:/temp/test.xps"))
        {
            using (var s = getXpsStream())
            {
                s.Seek(0, SeekOrigin.Begin);
                s.CopyTo(writer);
            }
        }
    }
    static Stream getXpsStream()
    {
        var stream = new MemoryStream();
        var package = Package.Open(stream, FileMode.Create);
        var xpsDoc = new XpsDocument(package, CompressionOption.Normal);
        var xpsWriter = xpsDoc.AddFixedDocumentSequence();
        string tempPath = "c:/temp/Document";
        for (int i = 1; i <= 3; i++)
        {
            var docWriter = xpsWriter.AddFixedDocument();
            var pageWriter = docWriter.AddFixedPage();
            var image = pageWriter.AddImage(XpsImageType.JpegImageType);

            using (Stream imageStream = image.GetStream())
            {
                string filename = tempPath + i;
                using (var istream = File.OpenRead(filename + ".png"))
                {
                    istream.CopyTo(imageStream);
                }
            }
        }
        xpsDoc.Close();
        return stream;
    }


text:
Q: missing expression in oracle dynamic sql Am trying to print Hierarchy information through store procedure. When I execute the simple statement am able to retrieve the records. But when am running the in loop using cursor, its throwing missing expression.
DECLARE
--VAR1 VARCHAR2(200):='''810011148''';
RESUTL1 VARCHAR2(2000);
V__ROWID_PARTY_CHILD_FK  VARCHAR2(2000);
V__ROWID_PARTY_PARENT_FK   VARCHAR2(2000);
V_CONNECTBY_ISCYCLE  NUMBER;
STM1 VARCHAR2(2000);
VAR1 VARCHAR2(200) ;

CURSOR C1 IS
SELECT DISTINCT S_ROWID_PARTY_CHILD_FK  INTO VAR1
FROM C_REL_PARTY_XREF
WHERE ROWNUM <10;

BEGIN
FOR C2 IN C1

LOOP

STM1 :=  'SELECT * FROM (
  SELECT LEVEL, s_rowid_party_child_fk , s_rowid_party_parent_fk  ,CONNECT_BY_ISCYCLE ISCYCLE
  FROM C_REL_PARTY_XREF
  START WITH  S_ROWID_PARTY_CHILD_FK ='|| VAR1||'
  CONNECT BY NOCYCLE  PRIOR   s_rowid_party_parent_fk=s_rowid_party_child_fk )A  WHERE A.ISCYCLE=1';

 -- EXECUTE IMMEDIATE STM1 ;

EXECUTE IMMEDIATE STM1 INTO RESUTL1, V__ROWID_PARTY_CHILD_FK,V__ROWID_PARTY_PARENT_FK , V_CONNECTBY_ISCYCLE ;
DBMS_OUTPUT.PUT_LINE(RESUTL1 || ','|| V__ROWID_PARTY_CHILD_FK || ','|| V__ROWID_PARTY_PARENT_FK || ','||  V_CONNECTBY_ISCYCLE);
END LOOP;
END;

Thanks

A: Should be:
CURSOR C1 IS
SELECT DISTINCT S_ROWID_PARTY_CHILD_FK
FROM C_REL_PARTY_XREF
WHERE ROWNUM <10;

and then
begin
  for c2 in c1
  loop
    SELECT *
      INTO RESUTL1, V__ROWID_PARTY_CHILD_FK,V__ROWID_PARTY_PARENT_FK , V_CONNECTBY_ISCYCLE
      FROM (
          SELECT LEVEL, s_rowid_party_child_fk , s_rowid_party_parent_fk  ,CONNECT_BY_ISCYCLE ISCYCLE
            FROM C_REL_PARTY_XREF
           START WITH  S_ROWID_PARTY_CHILD_FK = c2.S_ROWID_PARTY_CHILD_FK
          CONNECT BY NOCYCLE  PRIOR   s_rowid_party_parent_fk=s_rowid_party_child_fk
           ) A
     WHERE A.ISCYCLE=1
    ;
    DBMS_OUTPUT.PUT_LINE(RESUTL1 || ','|| V__ROWID_PARTY_CHILD_FK || ','|| V__ROWID_PARTY_PARENT_FK || ','||  V_CONNECTBY_ISCYCLE)
  end loop;
end;


text:
Q: is __cxa_throw safe to ignore with Core Audio? A similar question has been asked.. but I wanted to make it more specific to core audio.. as some of us may have noticed core audio has very little room for error.
As the answer to the said question explains, __cxa_throw is a C++ unhandled exception, which can be ignored (this problem seems to be new with Xcode 4.5.1.. I've never seen it before as well)
can we say the same about core audio? What makes me nervous is that it has to do with formatting of the audio.. which a lot of my code depends on:
I'm trying to convert an AAC file unto lPCM..
output format:
// set up the PCM output format for conversion
streamer->PCMoutputFormat.mSampleRate = 44100.0;
streamer->PCMoutputFormat.mFormatID = kAudioFormatLinearPCM;
streamer->PCMoutputFormat.mFormatFlags = kAudioFormatFlagsCanonical;
streamer->PCMoutputFormat.mBytesPerPacket = 4;
streamer->PCMoutputFormat.mFramesPerPacket = 1;
streamer->PCMoutputFormat.mBytesPerFrame = 4;
streamer->PCMoutputFormat.mChannelsPerFrame = 2;
streamer->PCMoutputFormat.mBitsPerChannel = 16;

input format:
mSampleRate = 44100
mFormatID = 1633772320 (AAC)
mFormatFlags = 0
mBytesPerPacket = 0
mFramesPerPacket = 1024
mBytesPerFrame = 0
mChannelsPerFrame = 2
mBitsPerChannel = 0

instance variables:
game.h
@interface Game : NSObject <GKSessionDelegate>
{
    AudioStreamer *streamer;
}

@property (nonatomic, assign) AudioStreamBasicDescription mediaItemInputFormat;

audioStreamer.h
@interface AudioStreamer : NSObject
{
    @public
        AudioStreamBasicDescription PCMoutputFormat;
        AudioConverterRef audioConverter;
}

setting up converter command in game.m (this is where the __cxa_throw unhandled exception is thrown!)
// set up converter
OSStatus result = AudioConverterNew(&_mediaItemInputFormat,
                                    &streamer->PCMoutputFormat,
                                    &streamer->audioConverter);

A: If the exception didn't end up terminating the application then some other piece of code handled it. If you trust whatever piece of code that was then there's nothing to worry about.


text:
Q: ItemAdd Event on Redemption Folder - how to use properly with Console Application I have a .Net Console Application that emails documents using Redemption with Outlook. I attach the "Items.ItemAdd" event to the relevant folder. The event never fires.
But in my test harness which is a WPF application, using the same method and the same references etc, it does work.
Does the event actually work in a console app? Is there an example of the correct way, or of an alternate way?

A: Your app needs to run the Windows message loop for the events to work.

A: OK thanks for that hint. I tried various things and eventually it seems to work as below:
DispatcherOperation op = System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() => { SomeMethod(someArgs); }));
DispatcherOperationStatus status = op.Status;
while (status != DispatcherOperationStatus.Completed && status != DispatcherOperationStatus.Aborted)
{
    status = op.Wait(TimeSpan.FromMilliseconds(10000));
    if (status == DispatcherOperationStatus.Completed || status == DispatcherOperationStatus.Aborted)
    {
        // do your final code
    }
}


text:
Q: Webpack 5 Module Federation throwing error Module doesn't exists in the container I am trying to build a remote/host sample MFE using Single SPA with Module Federation feature from WebPack 5.
but I am getting this error in the host application

here is the webpack of the remote:
const HtmlWebPackPlugin = require("html-webpack-plugin");
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
const deps = require("./package.json").dependencies;
module.exports = {
  output: {
    publicPath: "http://localhost:3001/",
  },

  resolve: {
    extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
  },

  devServer: {
    port: 3001,
    historyApiFallback: true,
  },

  module: {
    rules: [
      {
        test: /\.m?js/,
        type: "javascript/auto",
        resolve: {
          fullySpecified: false,
        },
      },
      {
        test: /\.(css|s[ac]ss)$/i,
        use: ["style-loader", "css-loader", "postcss-loader"],
      },
      {
        test: /\.(ts|tsx|js|jsx)$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
        },
      },
      {
        test: /\.(png|jpg|jpeg|svg)$/,
        exclude: /node_modules/,
        use: {
          loader: "file-loader",
        },
      },
    ],
  },

  plugins: [
    new ModuleFederationPlugin({
      name: "mfe",
      filename: "remoteEntry.js",
      remotes: {},
      exposes: {
        "/EventListing":"./src/Events/EventListing",
      },
      shared: {
        ...deps,
        react: {
          singleton: true,
          requiredVersion: deps.react,
        },
        "react-dom": {
          singleton: true,
          requiredVersion: deps["react-dom"],
        },
      },
    }),
    new HtmlWebPackPlugin({
      template: "./src/index.html",
    }),
  ],
};

and this is WebPack of the host
const HtmlWebPackPlugin = require("html-webpack-plugin");
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");

const deps = require("./package.json").dependencies;
module.exports = {
  output: {
    publicPath: "http://localhost:3000/",
  },

  resolve: {
    extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
  },

  devServer: {
    port: 3000,
    historyApiFallback: true,
  },

  module: {
    rules: [
      {
        test: /\.m?js/,
        type: "javascript/auto",
        resolve: {
          fullySpecified: false,
        },
      },
      {
        test: /\.(css|s[ac]ss)$/i,
        use: ["style-loader", "css-loader", "postcss-loader"],
      },
      {
        test: /\.(ts|tsx|js|jsx)$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
        },
      },
    ],
  },

  plugins: [
    new ModuleFederationPlugin({
      name: "host",
      filename: "remoteEntry.js",
      remotes: {
        "mfe":"mfe@http://localhost:3001/remoteEntry.js"
      },
      exposes: {},
      shared: {
        ...deps,
        react: {
          singleton: true,
          requiredVersion: deps.react,
        },
        "react-dom": {
          singleton: true,
          requiredVersion: deps["react-dom"],
        },
      },
    }),
    new HtmlWebPackPlugin({
      template: "./src/index.html",
    }),
  ],
};

and here is the index.tsx of the host app:
import { registerApplication, start } from 'single-spa';
import './index.d';
registerApplication(
  'event-listing',
  () => import('mfe/EventListing'),
  location => location.pathname.startsWith('/')
);

start();

and finally here is the HTML of the host app:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>host</title>

any idea what I am missing?

A: You need to tell webpack exactly which file you are wanting to serve -- change "/EventListing":"./src/Events/EventListing" to "/EventListing":"./src/Events/EventListing.js"


text:
Q: Robocup,param was not declared in this scope i want to install robocup rcssserver 15.2.2
after configuration when i press make i get tons of errors saying the same thing: param was not declared in this scope and note: in expansion of macro Builder. what should i do?

A: You should remove bison3 and install bison2.7 .
For installing bison2.7 read this post.
https://askubuntu.com/questions/444982/install-bison-2-7-in-ubuntu-14-04

A: $ sudo apt-get install g++ build-essential libboost-all-dev qt4-dev-tools libaudio-dev libgtk-3-dev libxt-dev

$ sudo apt-add-repository ppa:gnurubuntu/rubuntu

$ sudo apt-get update

$ sudo apt-get install rcssserver rcssmonitor

Use these commands to install rcssserver & monitor without thinking about dependences


text:
Q: Babel not recognizing TypeScript syntax when running test using jest on TypeScript file "dependencies": {
    "@types/node": "^14.14.13"
  },
  "devDependencies": {
    "@babel/preset-typescript": "^7.12.7",
    "@types/jest": "^26.0.19",
    "jest": "^26.6.3",
    "ts-jest": "^26.4.4",
    "typescript": "^4.1.3"
  },
  "scripts": {
    "test": "jest"
  }

Above is my current package.json file. I'm trying to run test on single file. Right from the beginning of my function, it points at semicolon then I get bunch of babel parser errors. I npm installed all the related dependencies for unit testing on typescript. Am I missing more dependencies to install or is it more of configuration error?
const getTwoSum = (file: string[])

    at Parser._raise (node_modules/@babel/parser/src/parser/error.js:60:45)
          at Parser.raiseWithData (node_modules/@babel/parser/src/parser/error.js:55:17)
          at Parser.raise (node_modules/@babel/parser/src/parser/error.js:39:17)
          at Parser.unexpected (node_modules/@babel/parser/src/parser/util.js:139:16)
          at Parser.expect (node_modules/@babel/parser/src/parser/util.js:116:28)
          at Parser.parseParenAndDistinguishExpression (node_modules/@babel/parser/src/parser/expression.js:1364:14)
          at Parser.parseExprAtom (node_modules/@babel/parser/src/parser/expression.js:1035:21)
          at Parser.parseExprSubscripts (node_modules/@babel/parser/src/parser/expression.js:565:23)
          at Parser.parseUpdate (node_modules/@babel/parser/src/parser/expression.js:545:21)
          at Parser.parseMaybeUnary (node_modules/@babel/parser/src/parser/expression.js:529:17)


text:
Q: AS: if statement evaluating incorrectly I have a very simple piece of logic as follows:
var divert:Number = 0;
for (var connection in _connections) {
    trace("target: " + _connections[connection].target + " || i: " + (i + 1));
    if(int(_connections[connection].target) != (i + 1)) {
        trace("bad connection");
        divert++;
    }
}

The problem is that when i + 1 and int(_connections[connection].target) are equal the if statement is returning true as can be seen in the output of my trace() statements below:
target: 0 || i: 1
bad connection
target: 1 || i: 1
bad connection

Can anyone see what could be causing this to happen?
EDIT: The function this is contained in as per request:
public function loadListener(i:Number, onProgress:Function, onComplete:Function):Void
    {
        trace("load listening to: "+i);
        trace("next in queue: " + _queues["lower"][0] + " | " + _queues["upper"][0]);
        _functions[i] = {onProgress:onProgress, onComplete:onComplete};
        if (_queues["lower"][0] != i + 1 || _queues["upper"][0] != i + 1) {
            var divert:Number = 0;
            for (var connection in _connections) {
                trace("target: "+_connections[connection].target+" || i: "+(i+1));
                if(int(_connections[connection].target) != (i + 1)) {
                    trace("bad connection");
                    divert++;
                }
            }
            if (divert == _connections.length) {
                _diversion = i + 1;
                trace("divert: "+divert+" || connections: "+_connections.length);
            }
        }
    }

A: First of all, why use a for(var) loop when you can use
var divert:Number = 0;
for each(var connection in _connections) {
    trace("target: " + connection.target + " || i: " + (i + 1));
    if(int(connection.target) != (i + 1)) {
        trace("bad connection");
        divert++;
    }
}

To debug further, replace
trace("target: " + connection.target + " || i: " + (i + 1));

with
trace("target: " + int(connection.target) + " || i: " + (i + 1));

If this traces zero, you know where the issue is.
You could try doing
if(connection.target.toString() != (i + 1).toString()) {


text:
Q: Access custom thread methods I have created a custom thread with extra methods. I have created several threads in the loop.
I m interested to know if I can execute the extra method using Thread.getAllStackTraces() as shown below.
public class CustomThread extends Thread
{

    int pid;

    CustomThread(int processID)
    {
        this.pid = processID;
    }

    @Override
    public void run()
    {
        System.out.println("Thread running");
    }

    public void printDetails()
    {
        System.out.println("PID "+this.pid);
    }
}

public class Main
{

   public static void main(String[] args)
   {
       for(int i = 0;i<5;i++){
           CustomThread ct = new CustomThread(1);
           ct.start();
       }
   }
   System.out.println(Thread.getAllStackTraces().get(0).printDetails); <- Is it possible to access the method like this?

}

A:
Thread.getAllStackTraces() Returns a map of stack traces for all live threads. The map keys are threads and each map value is an array of StackTraceElement that represents the stack dump of the corresponding Thread.

As Map<Thread, StackTraceElement[]> is returned you can't get element with get(0). You have to provide Thread instance as a key but you will get StackTraceElement[].
 In your case you need Thread.getAllStackTraces().keySet().get(0) to get first thread or you can iterate over the whole map keys
for (Thread t : Thread.getAllStackTraces().keySet()) {
   if (t instanceof CustomThread) {
       ((CustomThread)t).printDetails();;
   }
}

A: While typing this I see that Evgeny has beaten me in typing speed, however I'd like to point out a few things. His method is correct but won't give you any output:
First of here is an elaboration on the method:
Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces();
Set<Thread> threads = map.keySet();//Get the keys of the map, in this case the key is the thread
for(Thread thread : threads){//iterate over all the threads
    if(thread instanceof CustomThread){//check to see if it is one of our custom threads
        CustomThread custom = (CustomThread)thread;//cast it to a custom thread
        custom.printDetails();//call your method
    }
}

And this method won't give you any feedback (yet) because your threads are already dead by the time this runs.
@Override
public void run() {
    System.out.println("Thread running");
    while(true){}//add this to keep the thread alive
}

So to test it you can just add an infinite while loop to the Thread and then the method will work.
Also all of your Threads will have the same PID as instead of using i as the PID in your loop you are using 1. So to give all your custom Thread a different PID you could use:
for(int i = 0;i<5;i++){
  CustomThread ct = new CustomThread(i);
  ct.start();
}

I hope this helps :)
P.S. Evgeny was first so credit where credit is due.


text:
Q: Configuring Connection from Sharepoint List Filter Web Part to List View Web Part For some reason I can't get a selectable connection to pass the filter values to the list view web part.  I select the web part to pass the filter values to, but then the Connection Box comes up empty - there's no default connection type - or any connection type - to select and configure.  The filter correctly pulls selectable values from the source list.  This is Sharepoint 2013 Enterprise.

A: You've ran into this problem 3 hours before me going by the time of your post.
Apparently one of the issues is that in IE11 you have to turn on compatibility mode. Once I did that it worked, and then I had to select "Get filter values" rather than parameters in order to get the list of filter options.
I hope that helps!

A: Or if using Edge then switch to IE.


text:
Q: cout vs printf when doing fork() I am trying to understand fork() using some test program. And I find different behaviors between cout and printf() :
program 1:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
using namespace std;

int main()
{
    printf("Hi , %d\n" , getpid());
    fork();
    return 0;
}

I get:
Hi , 9375
Hi , 9375
program 2:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
using namespace std;

int main()
{
    cout << "Hi , " <<getpid() << endl;
    fork();
    return 0;
}

I get:
Hi , 7277
The only difference between two program is the first use printf() to print the output  while second use cout
Can anyone explain it?
Thanks

A: When you use stdio, stdout is fully-buffered unless it's writing to a terminal; when writing to a terminal it's line-buffered.
So if you run Program 1 with output redirected to a file or pipe, printf writes the line to the output buffer, but doesn't flush the buffer. When the process forks, the buffer is duplicated in both processes. When they exit, they each flush their copy of the buffer, which prints the line.
You would get the same result in Program 2 if you'd written:
cout << "Hi , " <<getpid() << "\n";

But endl, in addition to outputting the newline character, also flushes the buffer. The equivalent in Program 1 would be:
printf("Hi , %d\n" , getpid());
fflush(stdout);


text:
Q: Not saved image when creating content on Drupal 6 this problem:
In the form of adding material has fields with images. Choose a file, click download, the file is loaded, the image is displayed. Others fill in the form and add material.
The material is added, it's fine, but that's only the images are not stored.
But after editing, all the images are stored properly. That is, the problem only by adding material.
I watched the logs of Drupal (admin/reports/dblog), while adding no error pops up.
In what could be the problem? How can I solve it?
Thank you. Sorry for my bad English.

Found out that the problem with the cache. Table cache_content. When adding material to the table empty entered information. If you clear the cache (admin / settings / performance). That image will be displayed.
Solved the problem using hook_nodeapi. When updating the material was clearing the cache for it.

A: I'm not really sure what you are asking here, but sometimes when editing a node, block, or content type and a picture or piece of code doesn't save, just double check that you are saving the text field as "Full Html".
"Plain text" or "Filtered Html" will strip any <img> or <a> tags from your markup.


text:
Q: provide a default location to look for a perl module only if not in default INC I have a module which I will need in most of my other modules.  ideally this module will in a directory pointed to by PERL5LIB.  Failing that I know the expected file structure of the modules, so I could theoretically find the desired module using a path relative to current module, to fall back on before failing.
The problem is that the standard use lib 'path' format looks at 'path' before it looks at the rest of @INC, such as those dir provided by PERL5LIB.  Is there a convenient syntax to specify paths to look at only after @INC has been searched, short of modifying @INC by pushing the variables to the back of the array?

A:
Is there a convenient syntax to specify paths to look at only after @INC has been searched,

No, there's no way to specify paths to search without including them in the list of paths to search (@INC).

A: If you don't have perl version or perl architecture specific directories you want automatically included (the way use lib does), just do
BEGIN { push @INC, 'path' }

If you do have such directories, and you want to do exactly what use lib does only have the added directories come at the end, do:
BEGIN { push @INC, do { require lib; local @INC; 'lib'->import('path'); @INC } }


text: Q: Can you use any Java library with an android app? For example, if I wanted to use EasyModbusJava with my android app, would it be as simple as adding the jar file as a library dependency or are there certain restrictions on libraries?


text:
Q: Numerical analysis-secant method I am trying to solve the secant problem here but i do not know how to derive the f(x).
Question: Use secant method to approximate ln(2) to 3 decimal place, x_0= 0.6, X_1= 0.7
I need help.

A: The secant method is one method to find roots of functions, that is, given a function $f(x)$ and two pairs of values $(x_0, f(x_0))$ and $(x_1, f(x_1))$, it attempts to find the value of $x$ such that $f(x) = 0$.
You want to find the value of $\ln2$ so you need to express that problem in terms of the language of the secant method. The secant method gives you the value $x$ for which $f(x) = 0$. You want it to give you $\ln2$, though, so that means you want to find a function $f(x)$ such that $f(\ln2) = 0$.
You could choose $f(x) = e^x - 2$, for example. Note that $f(x) = 0$ implies $e^x = 2$ which is equivalent to $x = \ln2$. Then you need two starting values (and their corresponding $f$ values). You could choose $x_0 = 0$, for which you get $f(x_0) = -1$, and $x_1 = 1$, for which $f(x_1) = e - 2$.
The rest is just feeding numbers into the method and stopping when you get the desired number of significant digits.