text:
Q: New verb: "to verbal" I seem to be noticing this one entering the popular lexicon lately, but cannot find a good definition.
Examples:

*

*No, you're just verballing...

*Leakegate: Leake verballed Richard Dawkins

*Jailed man sues over police verballing _ The Sydney Morning Herald

Usually used in a debate, it seems to suggest that someone is twisting or misconstruing someone else's statement.  Of course, it comes from the adjective verbal, but seems to mean something different.

A: I can't recall ever hearing it, but the verb verbal is in the OED:

colloquial transitive To attribute a damaging statement to (an accused or suspected person). Also const. up.

Their first quotation is from The Times (London) of 1963:

Those chaps were about and they won't be able to verbal me.

The three later quotations are all in a police context, and one is from a Brisbane, Australia newspaper.

A: Both the examples you've given support this definition from Wiktionary

Noun
verballing (uncountable)
1.The putting of damaging remarks into the mouths of suspects during police
interrogation

In the Leake case, Dawkins insists that Leake put words into his mouth, i.e. misquoted him greatly.
I wonder if this has originated or is common usage in Australia as you've given an SMH (Sydney Morning Herald) example and another example I find here which states

The next day Labor's John Faulkner
takes Costello's words and puts them
in Howard's mouth

and more examples here and here from Australian media articles. One of them defines it thus

Here in the free world we have strong
laws to protect criminal suspects from
confessions which are obtained by
'verballing' that is, off-the-record
threats, intimidation or physical
violence being used by the police to
elicit incriminating statements from a
suspect.

A: My understanding from law school is that this phrase originated in the State of Queensland in Australia where police corruption was endemic in the 1970s/80s.
The Fitzgerald Report (A Royal Commission in to Government and Police Corruption) dedicated a whole chapter to 'verballing' in its 1987 report.
See page 206 of the volume.

A: Literally it was the practice of police to write a transcript of a verbal statement that was not precisely what the suspect actually said at interview. The suspect would sign it either without checking thoroughly or without realising the incriminating details that were included or aware of the contents but signing under threat or coercion. It is common in Australia to now be used as a metaphor by someone alleging that they are being 'verballed', that is, deliberately misquoted or quoted out of context by an opponent to make it appear that they said something they did not intend.

A: I can't say I have seen verballing or verballed before. However, on Free Dictionary the definition of verbal or balling is pretty much the same as you said, but it's said to only be in use with police.
Also, since I had never heard of it, I looked it up on Urban Dictionary, but there they don't even mention the need for it to be police who do the action.
I agree with you, verballing implies "someone is twisting or misconstruing someone else's statement". Definitely a negative connotation that isn't apparent in verbal.

A: The two before me have defined what "verballing" means, but I just want to add that "verballing" does come from "verbal." It comes from "verbal" being used as a verb, and it means:

(transitive, UK, Australian) To fabricate a confession

also

verbal (third-person singular simple present verbals, present participle verballing,

Thus, "verballing" would be to 'fabricate someone making something up about what someone said'.
Definition of "verballing":

A: Verballing is an old Australian police practice of writing a confession to a crime without the courtesy of consulting the suspect on points of detail, such as whether they actually did it.  It saves paperwork and time if you are lazy, and if the magistrate will collude in accepting it, as concocted confessions can be far more incriminating than real ones.  Something like Stalin's show trials, although I'm not sure if verballed statements had to be signed by the purported author.

A: I can confirm that 'to verbal' (The putting of damaging remarks into the mouths of suspects during police interrogation) was common parlance in the UK criminal justice system and police in the Seventies.


text:
Q: Baseline aligned TextView clips bottom line of multi-line text I would like the items in a ListView in my android app to contain a check box on the left, followed by some text, followed by a button.  I would like the check box and button to be baseline aligned with the text.  To achieve this, I put all three in a LinearLayout which tries to baseline align its items by default.  This works great, except that the bottom line of multi-line text is always clipped.
Here is an example of how it looks:

There is a related question on StackOverflow with the proposed solution to be to set layout_gravity = "fill" for the TextView, but that defeats the purpose as it disables the baseline align.  Is there any solution to this problem that allows me to preserve the baseline align?  This seems like a pretty basic problem that surely many people must encounter.
The only other solution I've found is to add some padding to the bottom of the text view, but this seems hacky and not robust against font sizes.  I could set the padding procedurally from code based on the font size, but it seems like it may be tricky to get the correct values.
Here is a sample layout that illustrates the problem:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="8dp"
    android:paddingTop="8dp"
    android:baselineAligned="true">

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="9dp"
        android:layout_marginRight="8dp"
        android:textSize="16sp"/>

    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Woah, this is a long text line, enough that tit has to wrap to multiple lines, thus demonstrating our problem.  In fact, it wraps to multiple lines!  So many lines!  I hope they all show up correctly!"
            android:textSize="16sp"/>

    <FrameLayout
        android:layout_width="40dp"
        android:layout_height="match_parent">

        <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="12dp"
                android:src="@drawable/ic_note_check_delete"/>
    </FrameLayout>
</LinearLayout>

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do I prove the function $f(z) = \sin \bar{z}$ is not differentiable on the disc $D(0,1)$? How do I prove the function $f(z)=\sin \bar{z}$ is not differentiable on the disc $D(0,1)$?
I originally used cauchy reimann equations to prove it is not differentiable everywhere, but I need to be able to show it's not differentiable specifically for the disc. Any help would be greatly appreciated.

A: Try the limit $$f'(0)=\lim_{z\to0}\frac{\sin(\overline{z})-\sin(0)}{z-0}=\lim_{z\to0}\frac{\sin(\overline{z})}{z}=\lim_{z\to0}\frac{\overline{z}}{z}\frac{\sin(\overline{z})}{\overline{z}}=\lim_{z\to0}\frac{z}{\overline{z}}$$

A: The CR equations tell you at which points $z \in \mathbb{C}$ the function $f$ is differentiable. In particular, applying them shows that it is not differentiable everywhere on $D(0, 1)$.


text:
Q: Using an https:// asmx-based service with Monotouch I'm trying to add a web reference to an asmx web service with ssl. I'm getting this error:
Error getting response stream:(Write: The authentication or decryption has failed.)SendFailure
I have self a signed certificate.
Is there a solution to this problem? Thanks.

A: It's a trust issue. Your application depends on Mono and the iOS certificate stores to deice if an TLS/SSL connection is acceptable. By default self-signed certificates are not (because they are unknown to both Mono and iOS).
Like mentioned in the comments, using System.Net.ServicePointManager.ServerCertificateValidationCallback is likely the easiest solution - but blindly returning true is not :-)
There's a wiki article on the Mono-project web site that describe several options:
http://www.mono-project.com/UsingTrustedRootsRespectfully


text:
Q: How can I monitor DB calls in weblogic? How do I find which DB call is currently executed by my weblogic server?

A: you can find it in .out log file

A: you can use JDBCSpy provided by weblogic.
http://download.oracle.com/docs/cd/E11035_01/wls100/jdbc_drivers/spy.html
You may need to switch the driver to one provided by weblogic.
[]s


text:
Q: Can I use optimally scaled variables for a factor analysis to account for rotation? If I can then how? I have discussed this issue several times in this site, but I am asking it again for a final justification from the experts of our community. I wanted to extract four factors (I should call dimensions here I think) from a CATPCA along with the factor scores (note that, factor scores are not available if I use polychoric correlation matrix and factor analyze it) from a data set containing only categorical variables. I have 22 categorical variables overall.
Now, as far I know, CATPCA doesn't use rotation which can be handy to extract factors in standard factor analysis or PCA. I am having a little problem to get clear factors although it seems like a rotation may improve understanding of the factors. Or, in simple terms, I am a little desperate to extract neat factors so that I want to employ different rotations. (I should not be though!) :D
However, we can save the transformed variables in some out file and use them in a standard factor analysis as the variables are now quantified. Note that we need to mention the number of dimensions once while getting the optimally scaled (i.e. quantified) variables. I have reckoned that different number of dimensions mentioned produces different quantification. Using these quantified variables into further factor analysis will require to mention the number of factors again.
Is this a problem? Because as I want 4 factors to be extracted, while asking for the optimally scaled variables I am mentioning 4 dimensions and then planning to use the quantified variables in a standard factor analysis (to get the facility of rotation) where I need to mention the number of factors once again.
If this is a problem, then can we take the number of dimensions to be 22 for CATPCA to get optimally scaled variables (as there are 22 variables overall)? This is only to make sure we have no loss in percentage of variance explained. Then we can use the quantified variables from that for a standard factor analysis and get factor scores in SPSS with mentioning 4 factors this time. I totally don't know if it is a weird idea!
So, waiting for your kind direction.

A: I don't consider rotation as a way to better understand factors (PCs) based on loadings.  Rather, rotation is a way to enforce variables to "mostly load" on one factor, which may have large repercussions on factor determination. However, if you a priori know what the factors are supposed to represent, and then are trying to confirm that the appropriate variables are loading correctly on factors, then whatever rotation schemes work are likely to be appropriate.  Otherwise, it sounds like you are performing confirmatory factor analysis.
You never stated what the factor scores are going to be used for(?)


text:
Q: cell type and if condition I have a cell 1x200 B and I want to use it in an if condition. Here an exemple with an 1x4 cell
1x4 cell
8   []  []  []

that I search is to say :
if all cell exept the first are empty (other saying 1x0 double) so I return at the begin of the initial loop else I applied other things. I start with this but it doesn't work :
if B{1,2:end}==[]
           return
else
bla bla bla
end

A: Does this work for you?
if isempty([B{1,2:end}])
    disp('Cells are empty');


text:
Q: Progress bar, wait form In my main form, i have a button to load alot of stored process across multiple databases. I wanted to create a progress/waiting form while this loads. when i press the button i have it showdialog the waitform.
I have a backgroundworker process that calls workerDoWork.
Within that method i want to call the main form that has all the code to do the loading.  When i make it public i can call it. but theres so many references inside the main form, global variables, different methods being called it doesn't work.  How can i get it to work without having to move all the code into the wait form.?
Code inside the wait form.
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)

    _worker = New BackgroundWorker()
    AddHandler _worker.DoWork, AddressOf WorkerDoWork
    AddHandler _worker.RunWorkerCompleted, AddressOf WorkerCompleted

    _worker.RunWorkerAsync()
End Sub

' This is executed on a worker thread and will not make the dialog unresponsive.  If you want
' to interact with the dialog (like changing a progress bar or label), you need to use the
' worker's ReportProgress() method (see documentation for details)
Private Sub WorkerDoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
    'Dim main As New frmMain()
    frmMain.LoadARData()
    ' MsgBox("hi there ")

End Sub

' This is executed on the UI thread after the work is complete.  It's a good place to either
' close the dialog or indicate that the initialization is complete.  It's safe to work with
' controls from this event.
Private Sub WorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs)
    Me.DialogResult = Windows.Forms.DialogResult.OK
    Me.Close()
End Sub

A: You have:
frmMain.LoadARData()

which is using the default instance of frmMain and most likely is not the same as the one you've got displayed on screen (causing the errors and unexpected behavior).
You need to reference the correct instance of frmMain for it to work correctly.  One way to solve this is to pass the reference to frmMain into the Show()/ShowDialog() call:
' ... running from within frmMain ...
Dim progress As New frmProgress()
progress.ShowDialog(Me) ' <-- passing in "Me" (the reference to frmMain)

Now, over in your progress form, you can cast the Owner property to the frmMain type and call your desired method:
Private Sub WorkerDoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
    Dim main As frmMain = DirectCast(Me.Owner, frmMain)
    main.LoadARData()
End Sub


text:
Q: Keep iOS App alive to work with MQTT protocol For a project I need many clients to subscribe to different hardware devices. In this setup  the clients are iOS - Devices. The hardware is something like a raspberry pi but i don't think this matters. This hardware devices send a signal if it measures some kind of information. This is a rare event and possibly could never happen.
Purpose of the app is to warn the user when some kind of event appears in a location he is interested to.
I planed to implement this using the MQTT protocol.
That is where my problem is. To work with MQTT the app needs to send PINGREQ every few minutes even when the app is in background. Also the app needs to receive its subscriptions and handle them immediately.
This is what I planned to do:

*

*Set the "UIBackgroundModes" key in Info.plist to "voip".

*Mark the socket as voip socket to wake the app when it receives something

*Set the keepAliveTimer:callback: and send the PINGREQ

.. as described here
My questions are: Will Apple allow this? My app is not an VoIP app. If no, are there any alternatives to this approach?

A: If Apple policies doesn't allow your to put your MQTT client App running in the background, then the solution should be to implement an additional push service.
A push service subscribes to your MQTT broker and sends push notifications to your mobile devices, so that either they have the MQTT client App running or not they will get the events.

A: Yes!
There is a chance that apple can reject your application when you are using VOIP(even though your app is not a VOIP Kind of application) to keep application alive!
I'm using Location services which is a proper solution to keep application alive in background mode.
Ask permissions to use location services even when the app in background mode & after getting the allow call back,set your location manager's desired accuracy to worst,distance filter to 99999(means your app will be notified if the user travels more than 99999 Meters from last location update call back)
By altering the desired Accuracy and distance filters you can save the user's battery consumption,otherwise your app will consumes lot of energy
That was one proper way which makes your application to run in background for more than 2 days continuously (Already using in our projects).
HTH! Have fun in coding :)


text:
Q: Emacs attempts to open ESS data directory while working I am cording on R (version 3.1.1) in emacs (version 24.3.1) using the ESS[S] (version 13.09) mode. Occasionally, while I am working the minibuffer pops up with the following
ESS (*R:2*, R (newest)) starting data directory? c:/Users/vince151/Documents/Dissertation/

I am uncertain as to why this keeps appearing. If I hit enter it opens a new buffer of R usually called R:2 and runs the following code.
options(chmhelp=FALSE, help_type="text")
options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient.exe', show.error.locations=TRUE)

It often seem that the minibuffer opens when autocomplete is active. Is there a known bug when using these two that I was unable to find by searching?
I also noticed that is occasionally opens a blank buffer called ess-command-output.
This problem continues to happen even after an additional r buffer is open and I can easily open 5 buffers of R, if I don't pay enough attention, at which point emacs typically freezes.

A: taken from the manual: http://ess.r-project.org/Manual/ess.html#Customizing-startup
If you do not wish ESS to prompt for a starting directory when starting a new process, set the variable ess-ask-for-ess-directory to nil.
(setq ess-ask-for-ess-directory nil)

It'll solve your problem.
Cheers,
LEslie


text:
Q: Python rest api Put method throws 500 I have following python code
https://github.com/salikhanan/my_login_testing/blob/master/login_app/api.py
Here when a put request is made to update user data It throws
<title>500 Internal Server Error</title>

while it works fine when a get request is made to retrieve data for a single user.
Can someone see what is wrong with PUT ? I would really appreciate it. I saw this project online to learn automation but I got myself stuck with this error.

A: The 500 is probably due to an exception being raised and not caught in your application code. You should run your app in development mode:
export FLASK_ENV=development

.. then start the server with flask run. Now when you get the error, you will see in the browser a traceback pointing out the exact statement which is raising an exception.


text:
Q: Как выполнить действие при столкновении игрока с объектом только один раз? Написал функцию обработки столкновения игрока с объектом, используя модуль pygame:
def collide(self, xvel, yvel, plantlist):

    for sprite in plantlist:
      if collide_rect(self, sprite):
        if isinstance(sprite, sunPlants):
            print("sun")

        if isinstance(sprite, shadowPlants):
            print("shadow")

        if isinstance(sprite, waterPlants):
            print("water")

Но есть проблема. Функция выполняет нужное условие бесконечно, пока игрок не отойдёт от объекта. А мне нужно, чтобы оно (условие) выполнилась только один раз и в следующий раз, только после того как игрок вновь "столкнётся" с объектом.
Полный исходный код игры можно найти на GitHub.

A: С точки зрения ООП, лучше всего может быть хранить в игроке список объектов с которыми сейчас есть контакт. При добавлении нового элемента в список, выполнять событие начала контакта, а при удалении объекта из списка - окончание контакта.


text:
Q: Toggle multiple Div names/content by one button click i have 4 different divs in german. By clicking a button, i want to hide the german divs and instead show the english divs, which are hidden before.
There are ways to change between 2 divs, but how can i change mulitple divs at the same time by clicking one time on one button?

A: You'll need JavaScript
or for an easier approach a JavaScript library like jQuery.
The basic approach is to add data-* attributes and classes to your elements:
<button class="langButton" data-language="en">EN ARTICLES</button>
<button class="langButton" data-language="de">DE ARTICLES</button>
<button class="langButton" data-language="it">IT ARTICLES</button>

En 1...

En 2...

De 1...

De 2...

It 1...

It 2...

than your jQuery might look like:
$(function() {   // Document is now ready to be manipulated

   // Cache all .article elements
   var $articles = $('.article');

   $(".langButton").click(function(){
       // Get the "en", "de" or "it" value
       var language = $(this).attr("data-language");
       // Hide all articles
       $articles.hide();
       // Show only the ones that have the ."language" related class
       $("."+ language ).show();
   });

});

Here's a live jsBin example you can play with or even download

A: Are you restricted to not use a framework like jQuery?
jQuery offers multiple methods to run your code on more than one selected elements.
Here is a basic working solution in pure javascript for you:
var shown = 'english';

function swap() {
    if (shown === 'english') {
       document.getElementById('german-1').style.display = "inline-block";
       document.getElementById('german-2').style.display = "inline-block";
       document.getElementById('german-3').style.display = "inline-block";
       document.getElementById('english-1').style.display = "none";
       document.getElementById('english-2').style.display = "none";
       document.getElementById('english-3').style.display = "none";
       shown = 'german';
   } else {
       document.getElementById('english-1').style.display = "inline-block";
       document.getElementById('english-2').style.display = "inline-block";
       document.getElementById('english-3').style.display = "inline-block";
       document.getElementById('german-1').style.display = "none";
       document.getElementById('german-2').style.display = "none";
       document.getElementById('german-3').style.display = "none";
       shown = 'english';
   }
};

Link to jsfiddle:
https://jsfiddle.net/v2k3rzge/
Hope it helps


text:
Q: Invite friends, facebook application development, stuck at last stage, using php-sdk I am trying to develop a facebook application, the last step is unfinished, that of inviting friends to play the app. i try the following code, but i am getting error. Please suggest how to go about. Thanks!
From index.php i am calling invite.php which is written as follows, i am already able to post comments on user's wall.
invite.php
<?php

         $app_id = '************';

         $canvas_page = '127.0.0.1/****/';
         $message = "Would you like to join me in this great app?";

         $requests_url = "http://www.facebook.com/dialog/apprequests?app_id="
                . $app_id . "&redirect_uri=" . urlencode($canvas_page)
                . "&message=" . $message;

         if (empty($_REQUEST["request_ids"])) {
            echo("<script> top.location.href='" . $requests_url . "'</script>");
         } else {
            echo "Request Ids: ";
            print_r($_REQUEST["request_ids"]);
         }
?>

A: I found it easier to just use the request dialog, which was recently released. It uses the javascript SDK, not the OpenGraph URL method.
http://developers.facebook.com/docs/reference/dialogs/requests/


text:
Q: Getting celery task id I have made something like that
@app.task
def some_task()
    logger.info(app.current_task.request.id)
    some_func()

def some_func()
    logger.info(app.current_task.request.id)

So I receive normal id inside some_task, but it equals to None inside some_func. How can I get real task id?

A: You could bind the task and pass the request around rather than relying on a global.
@app.task(bind=True)
def some_task(self)
    logger.info(self.request.id)
    some_func(self.request)

def some_func(celery_request=None)
    # celery_request is optional assuming you're using it elsewhere.
    if celery_request:
        logger.info(celery_request.id)


text:
Q: How to fix CSS in wordpress after transfer it from localhost? I am working for a client on creating a WordPress site for her. I have worked from a "www.test-accounts.co.uk" and all works fine. Now I have finished and I am transferring it to the live site that the client already has "www.lebaneat.co.uk"
However, CSS is not working. I try to replace the URL in the DB manually, I tried to use a tool in the dashboard, I tried to many things but still nothing.
Can someone look at both sites I put up and give me an indication of where to look to?

A: You need to change the site URL from the database with the new URL. Go to wp_options table and change the site URL from there

A: Did you have change all the url of youre website ?
you can do it with :

# Change URL

UPDATE wp_options
SET option_value = replace(option_value, 'http://localhost/wordpress', 'http://newwebsite.com')
WHERE option_name = 'home'
OR option_name = 'siteurl';

# Change URL  GUID

UPDATE wp_posts
SET guid = REPLACE (guid, 'http://localhost/wordpress', 'http://newwebsite.com');

# Change URL  médias articles pages

UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://localhost/wordpress', 'http://newwebsite.com');

# Change URL meta

UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://localhost/wordpress','http://newwebsite.com');

A: There is a great plugin to change all URL in your WP, it's Velvet Blues Update URLs
I use it for all my transfert in production.
I hope this will help you. ;)

A: Try DB Search Replace. WP keep some data as serialized strings and some are backslash escaped. DB Search Replace will replace occurrences in both.

A: SQL Queries to Change Website Domain
https://rudrastyh.com/tools/sql-queries-generator
When moving WordPress websites from one domain to another, this tool is a great time saver. Just generate the queries and run them in MySQL.


text:
Q: Does redux wait for previous actions changes to flow down as props before dispatching next action? I'm new to redux. I have this question, i can't find any good blogs or explanation regarding this.
Thank-you.

A: Yes the previous changes will flow down as props before dispatching next action, please refer to this diagram below:
Redux Diagram without API Middleware


text:
Q: When running on Windows Server I get 'unicode error' but on my pc works fine for some reasons when I run my python script on my windows server 2016 i get the error SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape .
On my PC works everything just fine.
Lines that I use to execute the program:
cmd = "C:\Users\Administrator\Desktop\GTA - San Andreas\samp.exe\samp.exe jade.nephrite.ro"
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, creationflags=0x08000000)
process.wait()

A: Use a raw string for "c:\Users...".  The \U begins a Unicode escape sequence on Python 3, where strings are default Unicode.
>>> print("C:\Users")
  File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
>>> print(r"C:\Users")
C:\Users


text:
Q: How to Select UNCOMMITTED rows only in SQL Server? I am working on DW project where I need to query live CRM system. The standard isolation level  negatively influences performance. I am tempted to use no lock/transaction isolation level read uncommitted. I want to know how many of selected rows are identified by dirty read.

A: Maybe you can do this:
SELECT * FROM T WITH (SNAPSHOT)
EXCEPT
SELECT * FROM T WITH (READCOMMITTED, READPAST)

But this is inherently racy.

A: Why do you need to know that?
You use TRANSACTION ISOLATION LEVER READ UNCOMMITTED just to indicate that SELECT statement won't wait till any update/insert/delete transactions are finished on table/page/rows - and will grab even dirty records. And you do it to increase performance. Trying to get information about which records were dirty is like punch blender to your face. It hurts and gives you nothing, but pain. Because they were dirty at some point, and now they aint. Or still dirty? Who knows...
upd
Now about data quality.
Imagine you read dirty record with query like:
SELECT *
FROM dbo.MyTable
WITH (NOLOCK)

and for example got record with id = 1 and name = 'someValue'. Than you want to update name, set it to 'anotherValue` - so you do following query:
UPDATE dbo.MyTable
SET
    Name = 'anotherValue'
WHERE  id = 1

So if this record exists you'l get actual value there, if it was deleted (even on dirty read - deleted and not committed yet) - nothing terrible happened, query won't affect any rows. Is it a problem? Of course not. Becase in time between your read and update things could change zillion times. Just check @@ROWCOUNT to make sure query did what it had to, and warn user about results.
Anyway it depends on situation and importance of data. If data MUST be actual - don't use dirty reads

A:
The standard isolation level negatively influences performance

So why don't you address that? You know dirty reads are inconsistent reads, so you shouldn't use them. The obvious answer is to use snapshot isolation. Read Implementing Snapshot or Read Committed Snapshot Isolation in SQL Server: A Guide.
But the problem goes deeper actually. Why do you encounter blocking? Why are reads blocked by writes? A DW workload should not be let loose on the operational transactional data, this is why we have ETL and OLAP products for. Consider cubes, columnstores, powerpivot, all the goodness that allows for incredibly fast DW and analysis. Don't burden the business operational database with your analytically end-to-end scans, you'll have nothing but problems.


text:
Q: How to access Event object inside javascript tag of Aspx page header content? I am trying to fire a event from script inside aspx page. To fire a event I am using Event.observe() method. In that line I am getting error like "Event is not an object". Please help me in this issue.
My code:
 function Submitkeyword() {
        obj = document.getElementById("select");//select is button id
        Event.observe(obj, 'change', function () {
            var e = document.getElementById("lookupvaluesDropdown");//lookupvaluesDropdown is dropdownlist id
            var valueddl = e.options[e.selectedIndex].value;
        });
        fireEvent(obj, 'submit');
        window.close(); //To close the popup window
    }
    function fireEvent(element, event) {
        if (document.createEventObject) {
            // dispatch for IE
            var evt = document.createEventObject();
            return element.fireEvent(event, evt);
        }
        else {
            // dispatch for firefox + others
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent(event, true, true); // event type,bubbling,cancelable
            return !element.dispatchEvent(evt);
        }
    }

A: Event.observe requires the Prototype JavaScript library loaded. If its not loaded and you try to use it you will get the error "Event is not an object"
You need to include that in your <head> as follows :
<script src="/path/prototype.js" type="text/javascript"></script>


text:
Q: How can we re-use the deleted id from any MySQL-DB table? How can we re-use the deleted id from any MySQL-DB table?
If I want to rollback the deleted ID , can we do it anyhow?

A: It may be possible by finding the lowest unused ID and forcing it, but it's terribly bad practice, mainly because of referential integrity: It could be, for example, that relationships from other tables point to a deleted record, which would not be recognizable as "deleted" any more if IDs were reused.
Bottom line: Don't do it. It's a really bad idea.
Related reading: Using auto_increment in the mySQL manual
Re your update: Even if you have a legitimate reason to do this, I don't think there is an automatic way to re-use values in an auto_increment field. If at all, you would have to find the lowest unused value (maybe using a stored procedure or an external script) and force that as the ID (if that's even possible.).

A: You shouldn't do it.
Don't think of it as a number at all.
It is not a number. It's unique identifier. Think of this word - unique. No record should be identified with the same id.

A: 1.
As per your explanation provided "@Pekka, I am tracking the INsert Update and delete query..." I assume you just some how want to put your old data back to the same ID.
In that case you may consider using a delete-flag column in your table.
If the delete-flag is set for some row, you shall consider program to consider it deleted. Further you may make it available by setting the delete-flat(false).
Similar way is to move whole row to some temporary table and you can bring it back when required with the same data and ID.
Prev. idea is better though.
2.
If this is not what you meant by your explanation; and you want to delete and still use all the values of ID(auto-generated); i have a few ideas you may implement:
- Create a table (IDSTORE) for storing Deleted IDs.
- Create a trigger activated on row delete which will note the ID and store it to the table.
- While inserting take minimum ID from IDSTORE and insert it with that value. If IDSTORE is empty you can pass NULL ID to generate Auto Incremented number.
Of course if you have references / relations (FK) implemented, you manually have to look after it, as your requirement is so.
Further Read:
http://www.databasejournal.com/features/mysql/article.php/10897_2201621_3/Deleting-Duplicate-Rows-in-a-MySQL-Database.htm

A: Here is the my case for mysql DB:
I had menu table and the menu id was being used in content table as a foreign key. But there was no direct relation between tables (bad table design, i know but the project was done by other developer and later my client approached me to handle it). So, one day my client realised that some of the contents are not showing up. I looked at the problem and found that one of the menu is deleted from menu table, but luckily the menu id exist in cotent table. I found the menu id from content table that was deleted and run the normal insert query for menu table with same menu id along with other fields. (Id is primary key) and it worked.
insert into tbl_menu(id, col1, col2, ...) values(12, val1, val2, ...)


text:
Q: Align divs vertically but keep order consistent The problem is that my divs are being ordered so that the first column collapses first and is read first on mobiles (intended).
But on word-wrapping at very specific screen dimensions, the divs get out of balance and now look a little funky on their vertical balance with each other.
An image can be found here (red shows divs):

What I want is to add some space on the text that wasn't word wrapped so that

A: Personally, Id say the current design works well, as it can fit and change to different screen sizes, the fact that it doesnt line up is understandable as the word is just to long.
However if you wanted to you could set a min-width on the container which represents that box. This means the word wouldnt be wrapped when the screen gets smaller. But it could come with side effects as it will push over the other two divs depending on how the css works.


text:
Q: SSE version of modf I have the following working implementation of modf using SSE intrinsics, but it seems quite wasteful to be converting to __m128i and back in the process, when I need the result as a __m128.
__m128 integer = _mm_cvtepi32_ps(_mm_cvttps_epi32(value));
__m128 fraction = _mm_sub_ps(value, integer);

Does there exist an instruction for truncation without type conversion, or some magic number hack?

A: With SSE4.1, you can use the roundps and roundpd instructions:
//  Single Precision
__m128 integer = _mm_round_ps(value,_MM_FROUND_TRUNC);
__m128 fraction = _mm_sub_ps(value,integer);

//  Double Precision
__m128d integer = _mm_round_pd(value,_MM_FROUND_TRUNC);
__m128d fraction = _mm_sub_pd(value,integer);

This will separate the integer and fractional parts while preserving the sign for both of them.
Likewise, for AVX:
//  Single Precision
__m256 integer = _mm256_round_ps(value,_MM_FROUND_TRUNC);
__m256 fraction = _mm256_sub_ps(value,integer);

//  Double Precision
__m256d integer = _mm256_round_pd(value,_MM_FROUND_TRUNC);
__m256d fraction = _mm256_sub_pd(value,integer);

If you also have the XOP instruction set, you can get the fractional part alone with only one instruction (via _mm256_frcz_pd and family).
But without SSE4.1, then there isn't really a better way to do it aside from converting, or doing the +/- magic number trick. (both of which will run into problems in the case of overflow)


text:
Q: Merecasters in Numenera I got to necropolis and I got my hands on things called merecasters that let you 'experience' an episode of someone else's live...
Do they serve any other purpose - like can I get skills for them or quests or something?
Or after doing the story I should just sell them?

A: Most of them are self contained stories with no effect on the game. Think of them as little gamebooks. You will get some experience for completing them, but that's about it.
Sadly none of the amazing places (I especially liked that town on top of a whale) or legacy you leave behind from completing a merecaster is seen anywhere in the game, so you won't notice the consequences of your choices within the mere.
There are a few merecasters related to the main story, you can easily notice them by having to complete them to progress (I think, there are 3 of those). Those will have consequences in the real world after you finished them.
The merecaster object itself can be sold freely after you completed your adventure in the mere.


text:
Q: how to preload tinymce editor? since tiny_mce takes long to load i tried preloading it's script and the image.. once i put the code below it won't load at all. can't figure out why.. paths are correct. if i remove this it will load slowly like before. and i am loading tiny_mce in a ui dialog. is anything conflicting? please help me...
$js = path+ "jscripts/tiny_mce/tiny_mce.js";

                            $.getScript($js , function() {

                            });

A: Problem here is that tiny_mce.js is not all you need in order to make tinymce work.
There are css files custom plugins and maybe other stuff that does not get loaded if you just load the js file. What you could do to improve speed is to download the tinymce developer version and then build your own tinymce_full.js using an ant build script.


text:
Q: Am I interpreting this theorem correctly? Here is a theorem which my professor stated in Algebra class, in the chapter on Galois theory.

Let $f(x)=x^p+a_{p-1}x^{p-1}+...+a_0\in \mathbb{Q}[x]$, where $p$ is prime. Assume $f(x)$ is irreducible over $\mathbb{Q}$ and $f(x)$ has exactly two complex non-real roots. Then the Galois group of $f$ is isomorphic to $S_p$.

Here is where I believe there is some ambiguity: what does it mean for $f(x)$ to have "exactly two complex non-real roots?" I mean, does this count multiplicity? Even if it doesn't satisfy the other hypotheses, how many "complex non-real roots" does $x^4+2x^2+1$ have? Two or four?

A: It means that $f$ has $2$ roots in $\mathbb{C} \setminus \mathbb{R}$, and $p-2$ in $\mathbb{R}$.
If $f$ is irreducible over a field $F$ of characteristic zero, it has no multiple roots in any field extension of $F$ (consider the GCD of $f$ and its formal derivative).
Finally, your example doesn't have prime degree, so the result doesn't apply to it anyway, but it has 4 (distinct) complex roots.

A: As Morgan Rogers said in the comments, the roots will always be distinct anyway for an irreducible polynomial, so it won't make a difference.
In general with wording like this, context matters, but prima facie I'd assume multiplicity counts, so your (reducible) example would have 4 nonreal roots, not 2.


text:
Q: How can I open OneNote files in a text editor? Noob here, hi. Reading diagonally the specification for oneNote files (here and here) it seems that oneNote notes are in an XML-like format.
Opening them (.one and .onetoc2 files) with a text editor (VS Code) shows nonsense, so i guess these files are binaries.
Is there a way to open the oneNote files, without OneNote itself? The goal ultimately is to know if I am able to parse through them and access my notes and data, if I want in the future to just move to another application (eg. cherrytree).
It is important to me, before starting using OneNote notebooks, that my notes/data isn't "trapped" in the software. I know I can export notebooks as PDFs, but I'd prefer something more than that.

A: A OneNote file is in a proprietary format.
Perhaps this method will work:

*

*In OneNote, save as an MHT file

*In Word, open the MHT file

*Save the file as an HTML file

*Try to import the HTML file into cherrytree. If this does not work,
you will need to extract the data from the HTML file in another format.

You might also be interested in the article
Bulk export OneNote 2013/2016 pages as HTML,
containing the PowerShell script for the export.

A: I can export notebooks as PDFs, but I'd prefer something more than that.
OneNote 2016 (the desktop version) can export pages (or page ranges) or sections as Word Documents (docx) or Word 97-2003 Documents (.doc). These are editable in other programs, for example OpenOffice or LibreOffice.
For exporting notebooks, the available formats include XPS (Open XML Paper Specification). However, apart from Microsoft there is not much software that can handle XPS files (and most of them are view only). There is a list at .xps Extension - List of programs that can open .xps files
For more information see How to Export Your OneNote 2016 Notes to Different File Formats

Further Reading

*

*Open XML Paper Specification - Wikipedia


text:
Q: Как скопировать нужное значение из множества блоков в input? Есть много блоков одинаковых блоков с разными значениями p

2

63,2

2

  <button>Click</button>

5

77,2

2

  <button>Click</button>

  <form action="" class="contact-info-form">
    <input name="quantity" id="quantity" type="text" placeholder="Quantity" required="required">
    <input name="square" id="square" type="text" placeholder="Square" required="required">
    <input name="floor" id="floor" type="text" placeholder="Floor" required="required">
    <input name="name" id="name" type="text" placeholder="Name" required="required">
    <input name="phone" id="phone" type="text" placeholder="Phone" required="required">
    <button class="send">Send</button>
  </form>

Как при клике на кнопку Click перенести значения quantity, square, floor в соответствующие input'ы формы, причем с того блока, по которому кликнули?

A: Как вариант:

var iQuantity = document.getElementById("quantity");
var iSquare = document.getElementById("square");
var iFloor = document.getElementById("floor");
var btn = document.querySelectorAll("button");

for (var i = 0; i < btn.length; i++) {
  btn[i].addEventListener("click", (e) => {
    iQuantity.value = e.currentTarget.closest(".info").querySelector("p.quantity").textContent;
    iSquare.value = e.currentTarget.closest(".info").querySelector("p.square").textContent;
    iFloor.value = e.currentTarget.closest(".info").querySelector("p.floor").textContent;
  });
}

2

63,2

2

  <button>Click</button>

5

77,2

2

  <button>Click</button>

  <form action="" class="contact-info-form">
    <input name="quantity" id="quantity" type="text" placeholder="Quantity" required="required">
    <input name="square" id="square" type="text" placeholder="Square" required="required">
    <input name="floor" id="floor" type="text" placeholder="Floor" required="required">
    <input name="name" id="name" type="text" placeholder="Name" required="required">
    <input name="phone" id="phone" type="text" placeholder="Phone" required="required">
    <button class="send">Send</button>
  </form>


text:
Q: qsort comparator function doesn't order the entire array (leaves 1 element out) Relevant code (index is the size of the array):
typedef struct elemento {
    unsigned long linha;
    unsigned long coluna;
    double valor;
} elemento;

elemento Representados[MAXN];
qsort(Representados, index, sizeof(Representados[0]), lcomparator);

int lcomparator(const void *el1, const void *el2) {
    int l1 = ((elemento *)el1)->linha;
    int l2 = ((elemento *)el2)->linha;
    int c1 = ((elemento *)el1)->coluna;
    int c2 = ((elemento *)el2)->coluna;

    if (l1 < l2) {
        return -1;
    }
    else if (l1 == l2) {
        if (c1 < c2) {
            return -1;
        }
        else if (c1 == c2) {
            return 0;
        }
        else if (c2 > c1) {
            return 1;
        }
    }
    else {
        return 1;
    }

}

gcc also prints out the 'control reaches end' warning for lcomparator, but I don't see how it would be possible for my function to not return anything.

A: else if (c2 > c1) {
    return 1;
}

is wrong and should be
else if (c1 > c2) {
    return 1;
}

or better
else {
    return 1;
}

and of course replace int by unsigned long

A: My suggestion:

*

*Change the types of the function local variables to unsigned long. You are losing precision when they are of type int. That might be the source of the problem you are seeing but it's hard telling without actual values.

*The core logic can be made simpler by using a helper function.
Here's an updated version of your function.
int compare_helper(unsigned long l1, unsigned long l2)
{
   if ( l1 < l2 )
   {
      return -1;
   }
   if ( l2 < l1 )
   {
      return 1;
   }
   return 0;

   // The line below does the same thing but relies on the logical expressions
   // to be 1 or 0.
   // return (l2<l1) - (l1<l2);
}

int lcomparator(const void *el1, const void *el2) {
    unsigned long l1 = ((elemento *)el1)->linha;
    unsigned long l2 = ((elemento *)el2)->linha;
    unsigned long c1 = ((elemento *)el1)->coluna;
    unsigned long c2 = ((elemento *)el2)->coluna;

    if ( l1 != l2 )
    {
       return compare_helper(l1, l2);
    }

    return compare_helper(c1, c2);
}

A: Previous comments and answers have already shown the type difference between unsigned long and int, and the comparison bug. Your code may in practice always return a value but the compiler does not like the hanging else.
I suggest the following:
int lcomparator(const void *el1, const void *el2) {
    unsigned long l1 = ((elemento *)el1)->linha;
    unsigned long l2 = ((elemento *)el2)->linha;
    unsigned long c1 = ((elemento *)el1)->coluna;
    unsigned long c2 = ((elemento *)el2)->coluna;

    if(l1 < l2) {
        return -1;
    }
    if(l1 > l2) {
        return 1;
    }
    if(c1 < c2) {
        return -1;
    }
    if(c1 > c2) {
        return 1;
    }
    return 0;
}

A: To add to an already correct answer by @Stargateur, here's an automated way to find bug in your code using SortChecker:
LD_PRELOAD=$HOME/SortCheck/bin/libsortcheck.so ./a.out
a.out[3024]: qsort: comparison function is not symmetric (comparison function 0x400526 (/home/yugr/src/so/a.out+0x400526), called from 0x4005c6 (/home/yugr/src/so/a.out+0x4005c6), cmdline is "./a.out")

This warning says that lcomparator returns inconsistent results when order of arguments is swapped. To further debug this issue, run with
export SORTCHECK_OPTIONS=raise=1

and examine generated codedump.


text:
Q: Emulate ios with live reload not working I got problem with live reload in ionic. Here is what I exactly did:
console code:
ionic start myApp tabs
cd myApp
ionic emulate ios -lc
//here is everything working fine

and after that I do:
ionic platform remove ios
ionic platform add ios
ionic emulate ios -lc

after this ionic app never show up I can see only splash screen still loading. You can see on screen shot:

A: Add <allow-navigation /> tag in your config.xml:
<allow-navigation href="*"/>

Or for security, only assign your local dev server to href, something like below:
<allow-navigation href="http://192.168.1.158:8100" />

And change the ip and port to your own and ensure the value of href can be visit in your browser.


text:
Q: How can I define a variable inside a function only the first time its called? I need to define a variable into a function's scope, but only the first time its called. The function will be called multiple times because it's inside a for loop, so defining a variable every time its called would make that variable unusable, since I need it to retain the value I want. I don't want to use a class, because then I would need to create a new instance of the class every time I want to use the function, and I can't use a global variable, because then multiple calls of the function would change that variable at different times and it would just make a mess. Consider this code:
for(var i = 0; i < x; i++){
    myFunction(parameter1, parameter2, parameter3);
}

The for loop will repeat itself x times, and the function will be called x times too. Now, consider this is the function definition:
function myFunction(parameter1, parameter2, parameter3){
    var a = 5;
    var d = 0;

    parameter2[d].method();
    d++;
}

(This is a hypothetical situation, the unused parameters and variables should not bother you).
Now, as you can see, I need to go through parameter2's array, but I can't do that when d is constantly being defined to 0 every time its called. I need it to be defined the first time only, and then it can be added to it. As I said, no global variables or classes, they can fix the problem but they are unpractical for my use.

A: You can set a property on a function, which would probably the most akin to what you want to do

function increaseCaller( args ) {
  let d = increaseCaller.d || 0;
  args[d]( d );
  increaseCaller.d = d + 1;
}

function log( arg ) {
  console.log( 'log: ' + arg );
}

function warn( arg ) {
  console.log( 'warn: ' + arg );
}

function error( arg ) {
  console.log( 'error: ' + arg );
}

const params = [log, warn, error];

increaseCaller( params );
increaseCaller( params );
increaseCaller( params );

another option is however, to use a generator function instead, like

function *methodCaller( args ) {
  let d = 0;
  while (d < args.length ) {
    yield args[d](d);
    d++;
  }
}

function log(arg) {
  console.log('log: ' + arg);
}

function warn(arg) {
  console.log('warn: ' + arg);
}

function error(arg) {
  console.log('error: ' + arg);
}

const params = [log, warn, error];

const iterator = methodCaller( params );

iterator.next();
iterator.next();
iterator.next();

Now, this might not be exactly what you are after, however, it does allow you to reset your function,  by simply calling methodCaller again with different arguments, and how you want to let it handle the iterations is up to you :)
This does take a bit of getting use to, but these generators are really useful :)

A: Ok, so I ended up using a class despite me not wanting to. It's the easiest answer honestly, I have to make a compromise but at least it works. If anyone needs to know how, here's how:
class myClass{
    constructor(){
        this.d = 0;
    }

    someMethod(parameter1, parameter2, parameter3){
        this.a = 0;
        parameter2[this.d].method();
        this.d++;
    }
}

Then, when you want to use it, you define a variable that contains an object of this class.
var someVar = new myClass();

Then you can use the variable elsewhere as such:
someVar.someMethod(parameter1, parameter2, parameter3);

That's it, I wanted to avoid creating variables each time, but oh well.


text:
Q: Calendar get year returns wrong result I want to create a calendar object and set it to a certain year and a week in that year.
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.WEEK_OF_YEAR, weekOfYear);  // 1
calendar.set(Calendar.YEAR, year); // 2016
setWeekChecked(calendar);

This is the toString of the calendar object as I pass it to the setWeekChecked method:

java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=America/New_York,firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2016,MONTH=0,WEEK_OF_YEAR=1,WEEK_OF_MONTH=2,DAY_OF_MONTH=7,DAY_OF_YEAR=7,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=5,HOUR_OF_DAY=5,MINUTE=25,SECOND=43,MILLISECOND=219,ZONE_OFFSET=-18000000,DST_OFFSET=0]

In the setWeekChecked method:
public void setWeekChecked(final Calendar cal) {
    final int targetWeek = cal.get(Calendar.WEEK_OF_YEAR); // Returns 1
    final int targetYear = cal.get(Calendar.YEAR); // Returns 2015??
}

This is the toString of the calendar object now:

java.util.GregorianCalendar[time=1451557543219,areFieldsSet=true,lenient=true,zone=America/New_York,firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2015,MONTH=11,WEEK_OF_YEAR=1,WEEK_OF_MONTH=5,DAY_OF_MONTH=31,DAY_OF_YEAR=365,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=5,HOUR_OF_DAY=5,MINUTE=25,SECOND=43,MILLISECOND=219,ZONE_OFFSET=-18000000,DST_OFFSET=0]

What am I doing wrong?

A: I suspect that the calendar is trying to use the current day-of-week (it's Thursday today) in the first week of 2016.
Now, looking at your calendar settings, you've got firstDayOfWeek=1 (so weeks run Sunday to Saturday) and minimalDaysInFirstWeek=1 (so the first week of the year is the one that includes January 1st).
That means that the first week of 2016 in your calendar ran from Decemember 27th 2015 to January 2nd 2016. Therefore Thursday in the first week was December 31st - which is exactly what the calendar you've shown us says.
Fundamentally, calendar arithmetic with "week of year" is tricky because:

*

*There are lots of different culture-specific ways of looking at them

*Typically requirements don't specify which of those you're actually interested in

I'd strongly recommend using Joda Time if at all possible to make your date/time-handling code clearer to start with, but you'll still need to work out exactly what you mean by "set it to a certain year and a week in that year". Note that Joda Time separates the concepts of "week-year" (used with week-of-week-year and day-of-week) from "year" (used with month and day-of-month) which helps greatly. You need to be aware that for a given date, the week-year and year may be different.

A: tl;dr
LocalDate.of( 2016 , Month.JULY , 1 )
         .with( IsoFields.WEEK_OF_WEEK_BASED_YEAR , 1 )

Details
The Answer by Jon Skeet is correct. Update: We have a better way.
The java.time classes built into Java 8 and later supplant the troublesome old legacy date-time classes bundled with the earliest versions of Java. And java.time officially supplants Joda-Time, as that project is now in maintenance mode.
As Skeet points out, there are different ways to define week-of-year.
The java.time classes provide support for the standard ISO 8601 definition of week-of-year. This definition is that week number 1 is the first week with a Thursday, and that week starts on a Monday. So the beginning of the week may include one or more days of the previous year, and the last week may include one or more days from the following year. The year always has either 52 or 53 weeks.
See my Answer to a similar Question for more details.
The LocalDate class represents a date-only value without time-of-day and without time zone.
Get a date near the middle of the desired year. That desired year is a week-based year rather than a calendar year, so must avoid the very beginning or ending of the calendar year. In your case, you wanted week-based year of 2016.
LocalDate ld = LocalDate.of( 2016 , Month.JULY , 1 ) ;

Next we adjust that date into the desired week by using IsoFields.WEEK_OF_WEEK_BASED_YEAR.
LocalDate dayIn2016W01 = ld.with( IsoFields.WEEK_OF_WEEK_BASED_YEAR , 1 ) ;

If you want the first day of that week, use another TemporalAdjuster from the TemporalAdjusters class.
LocalDate firstDayOf2016W01 = dayIn2016W01.with( TemporalAdjusters.previousOrSame( DayOfWeek.MONDAY ) );

Tip: When Android becomes more capable, use the YearWeek class from the ThreeTen-Extra project.

About java.time
The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date, Calendar, & SimpleDateFormat.
To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations. Specification is JSR 310.
The Joda-Time project, now in maintenance mode, advises migration to the java.time classes.
You may exchange java.time objects directly with your database. Use a JDBC driver compliant with JDBC 4.2 or later. No need for strings, no need for java.sql.* classes. Hibernate 5 & JPA 2.2 support java.time.
Where to obtain the java.time classes?

*

*Java SE 8, Java SE 9, Java SE 10, Java SE 11, and later  - Part of the standard Java API with a bundled implementation.

*

*Java 9 brought some minor features and fixes.

*Java SE 6 and Java SE 7

*

*Most of the java.time functionality is back-ported to Java 6 & 7 in ThreeTen-Backport.

*Android

*

*Later versions of Android (26+) bundle implementations of the java.time classes.

*For earlier Android (<26), a process known as API desugaring brings a subset of the java.time functionality not originally built into Android.

*

*If the desugaring does not offer what you need, the ThreeTenABP project adapts ThreeTen-Backport (mentioned above) to Android. See How to use ThreeTenABP….


text:
Q: Select element with Xpath by attribute value with character wildcard I'm trying to learn xpath, and I can't seem to find any results of anyone getting element by with character wildcards. I'm not sure if or how this is possible?
example

    Opgavebeskrivelse:

        click me

        click me too

I want to get both -elements by searching for the id. But since they are not exactly equal, I want to use a character wildcard, something like:
//*[@id='m_Content_opgaverDS*']

but this doesn't find any elements. And this
//*[contains(@id, 'm_Content_opgaverDS')]

only finds the first element. I need both :'(
Edit:
I use the Javascript console in the safari browser for Mac to test the Xpaths. I'm going to implement these Xpaths into a iOS app the uses the safari browser to scrape some websites.
I've declared this function in the browser:
function getElementByXpath(path) {
  return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}

and then evaluate the path like so: getElementByXpath("//a[starts-with(@id, 'm_Content_opgaverDS')]")
But if I remove the .singleNodeValue part, I get an error:

TYPE_ERR (DOM XPath Exception 52): The expression could not be
  converted to return the specified type.

A: Try this xpath :
//a[starts-with(@id, "m_Content_opgaverDS")]

Check function starts-with()
Like the function name, it select nodes a with @id starting with second argument
Edit: I get both //a


text:
Q: How to exit full screen mode in textedit FORMAT WINDOW mac 10.13.3 can't exit full screen in the FORMAT WINDOW for textedit  mac 10.13.3
Have tried restoring default settings.  The top left buttons: red closes window as it should, orange is not active (the regularly orange button is just gray) and green button does nothing.

A: Try pressing the Escape key. I know in Finder hitting Esc will get you out of full screen mode. But not every app supports Escape as a way to get out of full screen mode so you can try this keyboard stroke:
"Command+Control+F" to exit or enter Full Screen Mode.


text:
Q: multiple versions of stdlib.h I was trying to compile a program and stdlib.h didn't seem to exsist. When I tried to search for it I seem to be able to find 4 versions of stdlib.h. I was wondering how one can correct this issue:
:6:20: fatal error: stdlid.h: No such file or directory
 #include <stdlid.h>
                    ^
compilation terminated.

sudo find / -name 'stdlib.h'
/usr/lib/syslinux/com32/include/stdlib.h
/usr/include/stdlib.h
/usr/include/x86_64-linux-gnu/bits/stdlib.h
/usr/include/c++/4.8/tr1/stdlib.h

A: stdlid.h is wrong, you need a b instead of a d


text:
Q: How to handle "post" request in node.js in a one-page web app I know there are a few answers matching this question already. But I am looking for something else.
In the client side I have a signUp form that will send a post request to the server with username and password.
In the server side I authenticate the request. This is the code. (I use express)
server.post('/', function(req, res) {

 res.redirect('/');// I want to get rid of the "confirm resubmission message upon refreshing the page"
 authenticate(req.body.username){
        if(false){
           client.emit('signUpResponse',{success:false}); //cannot do it without a client's socket id
        } else {
        db.user.insert({username:req.body.username})
            client.emit('signUpResponse',{success:true}); //cannot do it without a client's socket id
        }
    };

At this stage I don't want to make another webpage(like/signup) to handle the signUp event.
I can access the client's socket id if I put the above code under the io.sockets.on code.
io.sockets.on('connection', function (client) {

 server.post('/', function(req, res) {
 console.log(client.id) //now I can access the client's socket
 res.redirect('/');// I want to get rid of the "confirm resubmission message upon refreshing the page"
 authenticate(req.body.username){
        if(false){
           client.emit('signUpResponse',{success:false}); //nothing happens at the client' side. maybe something to do with the "res.redirect"?
        } else {
        db.user.insert({username:req.body.username})
            client.emit('signUpResponse',{success:true}); ////nothing happens at the client' side. maybe something to do with the "res.redirect"?
        }
    };

In the server.post handler, I dont want to use any method like res.send,res.redirect(newURL) as I want the client side to stay at the same page. So is there a way to communicate with client side in the "post" handler like client emit?

A: I take it that the site is using https. With that said you should just use socket.io. It's much more easier.

// On the client-side
var client = io();

client.on('userLoggedIn', function(confirm) {
  if (confirm) {
    // Do your post login confirmation stuff here
  }
});

var form = document.getElementById('login-form'),
  username = document.getElementById('username').value,
  password = document.getElementById('password').value;

form.addEventListener('submit', function(event) {
  client.emit('login', {
    username: username,
    password: password
  });

  // Stops the form from redirecting the web page to the action link
  event.preventDefault();
}, false);

// Server-side
io.on('connection', function(client) {
  // Login user
  client.on('login', function(user) {
    // Do your login stuff here
  });
});


text:
Q: Why do i have several flexipage instances? I have 3 flexipage instances and cant understand why ?

Approval_Process_Instance_Record_Page.flexipage
  Approval_Process_Instance_Record_Page1.flexipage
  Approval_Process_Instance_Record_Page2.flexipage

And where i can find what is default ?


text:
Q: Does Dart support enumerations? Does Dart support enumerations? For instance:
enum myFruitEnum { Apple, Banana }

A cursory search of the docs suggests no.

A: With r41815 Dart got native Enum support see http://dartbug.com/21416 and can be used like
enum Status {
  none,
  running,
  stopped,
  paused
}

void main() {
  print(Status.values);
  Status.values.forEach((v) => print('value: $v, index: ${v.index}'));
  print('running: ${Status.running}, ${Status.running.index}');
  print('running index: ${Status.values[1]}');
}

[Status.none, Status.running, Status.stopped, Status.paused]
  value: Status.none, index: 0
  value: Status.running, index: 1
  value: Status.stopped, index: 2
  value: Status.paused, index: 3
  running: Status.running, 1
  running index: Status.running

A limitation is that it is not possibly to set custom values for an enum item, they are automatically numbered.
More details at in this draft https://www.dartlang.org/docs/spec/EnumsTC52draft.pdf

A: Enumeration should be available in the future. But until Enum has landed you can do something like :
class Fruit {
  static final APPLE = new Fruit._();
  static final BANANA = new Fruit._();

  static get values => [APPLE, BANANA];

  Fruit._();
}

A: This and this may be the answers on your question:
... for the technology preview it was decided to leave it out and just
use static final fields for now. It may be added later.

You can still do something like this:
interface ConnectionState { }
class Connected implements ConnectionState { }
class Connecting implements ConnectionState { }
class Disconnected implements ConnectionState { }

//later
ConnectionState connectionState;
if (connectionState is Connecting) { ... }

wich is in my opinion more clear for use. It's a bit more difficult for programming the application structure, but in some cases, it's better and clear.

A: how about this approach:
class FruitEnums {
  static const String Apple = "Apple";
  static const String Banana = "Banana";
}

class EnumUsageExample {

  void DoSomething(){

    var fruit = FruitEnums.Apple;
    String message;
    switch(fruit){
      case(FruitEnums.Apple):
        message = "Now slicing $fruit.";
        break;
      default:
        message = "Now slicing $fruit via default case.";
        break;
    }
  }
}

A: Beginning 1.8, you can use enums like this:
enum Fruit {
  apple, banana
}

main() {
  var a = Fruit.apple;
  switch (a) {
    case Fruit.apple:
      print('it is an apple');
      break;
  }

  // get all the values of the enums
  for (List<Fruit> value in Fruit.values) {
    print(value);
  }

  // get the second value
  print(Fruit.values[1]);
}

The old approach before 1.8:
class Fruit {
  static const APPLE = const Fruit._(0);
  static const BANANA = const Fruit._(1);

  static get values => [APPLE, BANANA];

  final int value;

  const Fruit._(this.value);
}

Those static constants within the class are compile time constants, and this class can now be used in, for example, switch statements:
var a = Fruit.APPLE;
switch (a) {
  case Fruit.APPLE:
    print('Yes!');
    break;
}

A: Yes! Its actually very useful to do Enums in Dart:
  enum fruits{
    BANANA, APPLE, ORANGE
  }

A: Just use Types Class File.
Dart-Types
easy, fast, more powerful and more helpful.
little problem, it is this class limited to five Different Choice and plus one for acts as null.

A: In case of anybody still searching for a quick solution for this.
We sometimes need integer value for an enum , sometimes string value. So we implement a quick package for this.
Enum Value Generator and an extension to easly generate necessary codes but this is not mandatory.vscode extension.
It is also capable of use with jsonAnnotation too.
import 'package:mobkit_generator/annotations.dart';

part 'example.g.dart'

@EnumSerializable(String)
enum PersonStr {
  @EnumValue('John')
  name,
  @EnumValue('66')
  number,
}

@EnumSerializable(int)
enum PersonInt {
  @EnumValue(1)
  name,
  @EnumValue('66')
  number,
}


text:
Q: collision detection in actionscript using bitmap.hittest Okay so I have two png files, a circle and a maze. Basically the maze is a square with some paths carved through it. I want to draw these images, move the circle to the mouse coordinates, and have a text say 'hit' when the circle intersects a wall of the maze and 'miss' when it doesn't. Now I want to do these using the bitmapdata.hittest method. The circle is a 32x32 image and the maze is a 256*256 image. I've gotten everything set up and everything draws on the screen correctly but I can't get the actual collision detection part of it to work, that is it always displays 'miss' rather than 'hit' even when the circle clearly intersects the maze. Here's what I've done:
package
{
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.text.TextField;
    import flash.utils.getTimer;
    import flash.net.URLRequest;
    import flash.ui.Mouse;
    import flash.system.*;
    import Math;
    public class MAIN extends Sprite
    {
        private var TEXT:TextField = new TextField();
        public var LOADER_1:Loader = new Loader();
        public var LOADER_2:Loader = new Loader();
        public var DATA_1:BitmapData;
        public var DATA_2:BitmapData;

        public function MAIN()
        {
            LOADER_2.load(new URLRequest('TEST.png'));
            LOADER_2.x = 125;       LOADER_2.y = 125;
            DATA_2 = new BitmapData(256,256,true,0);
            DATA_2.draw(LOADER_2);
            addChild(LOADER_2);

            LOADER_1.load(new URLRequest('BALL.png'));
            LOADER_1.x = mouseX;        LOADER_1.y = mouseY;
            DATA_1 = new BitmapData(32,32,true,0);
            DATA_1.draw(LOADER_1);
            addChild(LOADER_1);

            Mouse.hide();
            stage.frameRate = 60;
            addChild(TEXT);
            stage.addEventListener(Event.ENTER_FRAME,STEP);
        }
        public function STEP(event:Event):void
        {
            LOADER_1.x = mouseX;
            LOADER_1.y = mouseY;

            if (DATA_1.hitTest(new Point(LOADER_1.x,LOADER_1.y),255,DATA_2,new Point(LOADER_2.x,LOADER_2.y)))
            {
                TEXT.text = 'hit';
            }
            else
            {
                TEXT.text = 'miss';
            }
        }
    }
}

So can someone tell me what I'm doing wrong here?

A: You have to wait until your images load before drawing them to a BitmapData.
        LOADER_2.load(new URLRequest('TEST.png'));
        LOADER_2.x = 125;       LOADER_2.y = 125;
        DATA_2 = new BitmapData(256,256,true,0);
        DATA_2.draw(LOADER_2);

At this point you are taking a "snapshot" of your loader, but the loader has no content. So, you should ait for the Event.COMPLETE event to fire on each loader, and the draw to the BitmapData object.


text:
Q: Formula field to separate strings in a Text field? I'm stuck with a problem:
I have a text field that has Names_c =Test1,Test2,Test3,Test4
How can I split those four names using separate formula fields?
ex: Firstname=Test1, Secondname=Test2, Thirdname=Test3, Fourthname=Test4
anyone help me please

A: I would do this in Apex, but if you must use formula fileds, you can use this to get the first three formulas that separate the commas:
First_Name__c  -> TRIM(LEFT(Names__c , FIND(",", Names__c)-1))
Second_Name__c -> LEFT(RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c)), FIND("," , RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c)))-1)
Third_Name__c  -> LEFT(RIGHT(Names__c, LEN(RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c))) - FIND (",", RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c)))), FIND("," , RIGHT(Names__c, LEN(RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c))) - FIND (",", RIGHT(Names__c, LEN(Names__c) - FIND (",", Names__c)))))-1)

It won't be hard for you to work out how to get the fourth using this pattern.
Hope this helps!


text:
Q: Ubuntu 12.04, Php5-fpm, Apache2, Postfix: impossible to send a mail with PHP Resources I followed
I followed several howtos and questions on askubuntu:

*

*https://help.ubuntu.com/community/Postfix

*How to configure apache / php / postfix website emails when using vhosts?

*Sending mails with PHP, LAMPP and PostFix
And it does not fix my issue.
Configuration

*

*This is a Kimsufi server from OVH, quad core with 2 Gb of memory

*I just installed the basic Ubuntu 12.04 LTS server

*I then installed apache2, php-fpm, mysql, two custom cron scripts for backup

*I use it for a multisite Wordpress, where I manage my blog and blogs of family and friends, plus a few customers

Issue
Php-fpm cannot send email, even after following official community documention on Ubuntu wiki, and other tips and tricks I find.
For PHP, it seems that the email is sent, but the test mail never come in my inbox...
What do I miss ? Is there a very simple solution ?
By the way, when this will be fixed, I would be happy to write a full howto about that.
/var/log/mail.log
http://pastebin.com/8j7y1upw

A: As I was unable to make Postfix working, I finally used Exim4.
At the beginning, test emails with php worked out of the box, except for emails sent by Wordpress. Exim4 gave this message : Unrouteable address.
The solution
I made a mistake in the configuration. Instead of giving the name of the machine (ns3098501.ip-94-23-10.eu) I gave "libre-factory.com", which is the name I use for the Wordpress network.
Once I did a new configuration with the good name, it worked.
Please notice that the path to sendmail is set to default "/usr/sbin/sendmail -t -i" and that it works well.


text:
Q: Graphics card recommendation for dual-HD output? I'm wanting a dual HD monitor desktop.  Desktop system with two monitor outputs (1920x1080 and 1920x1200) side-by-side, displaying one X screen (Xinerama, TwinView, XRandR, whatever works).  Will be running Ubuntu 11.10 64-bit with Unity 3D.
Looking for a recommended graphics card for such a setup.  Other requirements:

*

*Dual DVI output. Or dual-HDMI output if it works with Ubuntu.

*Smooth non-buggy desktop compositing in Unity 3D/Compiz

*Smooth rendering of (Chrome) browser and non-accelerated IDE windows.

*At least 60fps on fullscreen glxgears (1920x1200 resolution), but not looking to play games.

*Smooth fullscreen video playback (just because)

A: I am running Ubuntu 11.10 and using the mini DisplayPort to export video display to a 1920X1080p HD Monitor (Dell) and the HDMI port to a 1920X1080p HD Monitor (SAmsung).
All the requirments you mentioned above are met but one which is a true xinerama and that is because my computer is Nvidia Optimus Enabled.
But in your case (Desktop Computer) you will not have Optimus (supposing you go for Nvidia). Just be sure not to have hybrid graphics.
Nvidia GTS series graphics card offer the best Price/quality balance on the market over ATI while ATI offers better results when it comes to its EyeFinity high ends graphics cards.
If you would not do gaming at all or occasionaly play non resources consuming games, then get yourself a Nvidia GTS series card with 2Go of memory for more texture quality.
These series offer three outputs : two DVI and 1 HDMI. The advantage that HDMI has over DVI is that is capable of outputting sound.
Here is what you need:
Nvidia GTS 450
Ps: Be sure to install nvidia proprietary drivers to enable Unity 3D and GPU acceleration.

A: Considering the only two good brands on the market, ATI and Nvidia, i suggest ATI over Nvidia without a doubt.
I have a netbook with an AMD C50 ( which surely it's not a powerfull APU ) and i have no problem using both the integrated display and the VGA and HDMI output to an HD screen, audio bridge included. Same good performance with a 5770 on my desktop.
Be sure to install the closed source proprietary driver from the official AMD ATI website.


text:
Q: Post values to controller from table rows that are created dynamically I am using codeigniter for a project.
I have a table with rows added dynamically through jquery append.
So when I click on a button submit, it post values for all the rows values to the controller, but I am not sure how to do that.
My table row is like this
<td>
  <input type="text" class="createWOBlockBG large ui-autocomplete-input" name="basefabrics" id="basefabrics1" autocomplete="off">
</td>

I do not want to use ajax calls.. How do I pass many of the inputs from the view to the controller?Thanks in advance for the help.

A: If your table with rows and as mentioned submit button is inside a form
then specify action attribute of your form to the controller where you want to access your values
and in the controller you can get the values as follows
$value = $this->input->post('name_of_your_input');

considering your input
$base_fabrics = $this->input->post('basefabrics');

if your form action is calling the same controller method which loaded the view, you can check for the click of submit button and then fetch values
if ($this->input->post('name_of_submit_btn'))
{
    $base_fabrics = $this->input->post('basefabrics');
}

EDIT: if all your inputs have same name then better name it as name="basefabrics[]"
so that when you fetch the value
$base_fabrics = $this->input->post('basefabrics');

$base_fabrics will be an array


text:
Q: Is it possible to plot multiple ecdf and cdf in one plot using cdf? I'm making a cdf for my dataset x,y, and z. How do I put them in one plot?
Im using fitdist to obtain the ecdf and cdf for x,y, and z.
  ## Say if we have
  x=runif(30)
  y=runif(30)
  z=runif(30)

  ## To fit the distribution I used fitdist
   a=fitdist(x, "norm")
   b=fitdist(y, "norm")
   c=fitdist(z, "norm")

   par(mfcol=c(1,3))
   cdfcomp(a, xlab="yield loss", ylab="probability", main="1st Stage",      datacol="black", fitcol="green")
   cdfcomp(b, xlab="yield loss", ylab="probability", main="2nd Stage",datacol="gray", fitcol="blue")
   cdfcomp(c, xlab="yield loss", ylab="probability",main="3rd Stage",datacol="navy", fitcol="red")

These codes give a three separate plots. Is there a way to put them in the same plot?
I tried doing
    cdfcomp(list(a,b, c), horizontals = FALSE)

but it gives the following message
   "Error in FUN(X[[i]], ...) :
    All compared fits must have been obtained with the same dataset."

What do I do?

A: It is possible, use add = TRUE:
library(fitdistrplus)
x=runif(30)
y=runif(30)
z=runif(30)
a=fitdist(x, "norm")
b=fitdist(y, "norm")
c=fitdist(z, "norm")
cdfcomp(a, xlab="yield loss", ylab="probability", datacol="black", fitcol="green")
cdfcomp(b, datacol="gray", fitcol="blue", add = TRUE)
cdfcomp(c, datacol="navy", fitcol="red", add = TRUE)


text:
Q: A problem in Kac's book infinite dimensional Lie algebras I have a question about Kac's book.
On page 331, 14.2 and 14.3, let $A$ be an affine type matrix such that ${}^tA = X_\ell^{}(1)$ and let $g$ be a simple finite dimensional Lie algebra of type $X_{\ell}$. Let $j \in \mathbb{Z}_+$, $c_j$ the number of roots of $g$ of height $j$, $M_j$ the number of times $j$ appears in $E_0$. Then
\begin{align}
& c_j + c_{j-1} - M_{j-1}, M_{j} = M_{h-j}, (1) \\
& c_j + c_{h-j} = \ell + M_j, (2) \\
& c_j + c_{h+1-j} = \ell, (3) \\
& c_j + c_{h+2-j} = \ell - M_{j-1}. (4)
\end{align}
Let $L(\Lambda)$ be an integrable $g(A)$-module of level 1. It is said that the following followings from (14.4.4) and (1)--(4).
\begin{align}
& \dim_q L(\Lambda) = \prod_{j \geq E_0} \prod_{n \in \mathbb{Z}_+} (1-q^{j+nh})^{-1}, (i) \\
& \dim_q L(2\Lambda) = \prod_{j \geq E_0} \prod_{n \in \mathbb{Z}_+} (1-q^{j+nh})^{-1}(1-q^{j+1+n(h+2)})^{-1}. (ii)
\end{align}
The formula (14.4.4) is
\begin{align}
\dim_q L(\Lambda_0) = \prod_{j \geq 1} (1-q^j)^{-\dim s_j},
\end{align}
where $s = \oplus_{j \in \mathbb{Z}} s_j$ is the principal subalgebra of $g'(A)$.
How to prove (i) and (ii)? Any hint would be greatly appreciate!


text:
Q: C# WCF Client Argument Exception XmlNode[] cannot be converted to type "..." I'm trying to create a SOAP Client with C# and WCF.
My Environment:

*

*Visual Studio 2019

*.net Core 3.0 MVC Project

*WSDL Url with Basic Authentification

Code:
AccountServicePortClient.EndpointConfiguration configuration = new AccountServicePortClient.EndpointConfiguration();
AccountServicePortClient client = new AccountServicePortClient(configuration);
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
client.Endpoint.Binding = binding;
client.ClientCredentials.UserName.UserName = "XXX";
client.ClientCredentials.UserName.Password = "XXX";
Task<CheckAddressSuccess> success = client.checkAddressAsync(*Some Arguments*);
success.Wait();
CheckAddressSuccess successResult= success.Result;

When receiving the result I get an ArgumentException:

Object of type 'System.Xml.XmlNode[]' cannot be converted to type 'ServiceReference2.CheckAddressSuccess'

Does anyone have a idea how i could solve this problem?
Update:
The Client was created by adding the WSDL URL as WCF Provider. I did not build the Soap Service. I already found out that the SOAP Response CheckAddressSuccess has a typo in the Namespace ("http..." instead of "https..."). I would like to use the WCF DataContractSerializer. How can i accomplish that?
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.1")]
[System.ServiceModel.ServiceContractAttribute(Namespace="https://XXX/account", ConfigurationName="ServiceReference2.AccountServicePort")]
public interface AccountServicePort
{
    [System.ServiceModel.OperationContractAttribute(Action="https://XXX/account#checkAddress", ReplyAction= "*")]
    [System.ServiceModel.XmlSerializerFormatAttribute(Style = System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults = true, Use = System.ServiceModel.OperationFormatUse.Encoded)]
    [return: System.ServiceModel.MessageParameterAttribute(Name="return")]
    System.Threading.Tasks.Task<ServiceReference2.CheckAddressSuccess> checkAddressAsync(string transactionId, ServiceReference2.Address address, bool checkHousenumberAdditive);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.SoapTypeAttribute(Namespace="https://XXX/account")]
public partial class CheckAddressSuccess
{
    ...
}

A: There was a problem during deserialization. How do you define data contracts? Did you use the XML serializer? In some cases, using XML directly to deserialize custom objects can cause errors. Here is an example.
https://forums.asp.net/t/1704221.aspx?Unable+to+cast+object+of+type+System+Xml+XmlNode+to+type
I would like to know the data contract information of your server and the configuration of creating your server.
Finally, I suggest that you use the DataContractSerializer as the default serializer in WCF.
Please refer to the below serialization advice.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/types-supported-by-the-data-contract-serializer
Feel free to let me know if the problem still exists.


text:
Q: Novel eDirectory and Windows XP/Seven clients A customer asked if it's possible to authenticate windows users (on XP or Win7 machines) against an eDirectory server to be able to open a session on a Windows 2008 server.
Let me try to clarify my setup:
+--------+                    +------------+              +---------+
| Win XP |-- ask permision -->| eDirectory |-- connects ->| Win2008 |
+--------+                    +------------+              +---------+

eDirectory contains the centralized list of users/passwords that can connect to many servers in the company, including this Win2008. My customer wants to log-in to a Windows XP machine with some credentials, then be able to open a session in Win2008 to use a specific program.
If this is possible, could you give me some pointers on how can this be accomplished?.

A: The functionality you're looking for is called Domain Services for Windows. I haven't used Novell products in ages and I can't tell you anything about the compatibility or reliability of this functionality. It looks like they're leveraging Samba (and, probably, proprietary code) to emulate an Active Directory domain.


text:
Q: How can I add seconds to time series data in Python? So I have the following timestamps that belong to a TS in a pandas dataframe:
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),
 Timestamp('2010-11-20 00:00:00'),

The original csv file has readings 60 readings for each minute passed, but the timestamp only has hh:mm (e.g. 13:23) and when I convert/parse the dates it just adds 00 to all the seconds entries. Is there any pandas functionality to add seconds? The motivation behind this is so that it will graph nicely in matplotlib. Currently I have 60 overlapping points for each minute, however I want the timestamps to be increasing e.g. 00:00:01, 00:00:02, 00:00:03, etc.

A: manually add seconds in there assuming they are sorted and increment is always 1 second:
df = pd.Series([pd.Timestamp(2020,11,20,0,0)]*10)
df += pd.Series(pd.Timedelta(seconds=i) for i in range(10))

0   2020-11-20 00:00:00
1   2020-11-20 00:00:01
2   2020-11-20 00:00:02
3   2020-11-20 00:00:03
4   2020-11-20 00:00:04
5   2020-11-20 00:00:05
6   2020-11-20 00:00:06
7   2020-11-20 00:00:07
8   2020-11-20 00:00:08
9   2020-11-20 00:00:09
dtype: datetime64[ns]


text:
Q: How do I properly test NIC teaming in Windows Server 2012 R2 I'm trying out NIC teaming in Windows Server 2012 R2 and I am not getting the testing results I expect. My setup is a PCI-X 64-bit 133 MHz Intel Pro 1000/GT Quad on one server, and four individual Realtek 8111 gigabit PCI-E x1 cards on the other server. All are connected to a managed gigabit switch that supports LACP. I have configured all of the relevant different NIC teaming modes the same on both servers (switch dependent/switch independent, address hash/dynamic) but I receive the same results of only 1 Gbps transfer rate no matter which of the four possible settings I choose. The NIC team on both servers consists of all four network connections and it appears as a 4 Gbps network adapter to the server.
I am using PassMark Advanced Network test, which includes a server and client component, and performs the network transfers entirely in RAM so as to achieve the full possible throughput.
The way I performed the test was to open two instances of the server component on one 2012 server, and open two instances of the client component on the other 2012 server. I connect both client components to the IP address of the NIC team adapter on the other server, but I use a different port number for each client.
When I perform the test by starting one client, I receive 1 Gbps throughput. When I start the test on the other client, instead of gaining another 1 Gbps, both clients drop to 500 Mbps. I thought that by using different port numbers, the stream would get hashed differently and therefore use another physical connection, resulting in each of the two streams achieving 1 Gbps.
I am beginning to wonder if it is my testing methodology, and perhaps there is a better way to test than the way I am doing it, because it seems like everything is configured correctly by using Switch Dependent mode with Address Hashing (though like I said, I have tried all combinations and received the same results).

A: I think it would depend on which mode you picked (switch dependent/switch independent) and how your traffic is transferred. Client->Server Server-> Client. If you are in switch independent mode you only have 1 port for inbound on the server and all ports will do outbound. I guess it just depends on how your test is running is it coming from the server or to the server.


text:
Q: Video Archive Manager I am developing an application in which I need to capture and display as well as record live video feed coming from an input camera or any other source.
I am working on  Windows 7 64 bit machine and building my application in C++ using Visual Studio. Now since I will be archiving all the videos, so along with my application I need to provide a video archive manager which can easily save them and attach tag to the videos based on their name and timestamp and fetch them based on some query. I dont want to write the whole archive manager by my self because of time constraints. So can anyone suggest some open source or even some proprietary tool which can do this for me.

A: If you don't want something elaborate, you can use the OS IpropertyStore to update metadata for the file and use Windows Search to retrieve them.

*

*IPropertyStore to update tags

*ISearchQueryHelper for searching them.

Developing Property Handlers for Windows Search shows more.


text:
Q: Using shared memory on a shared hosting Linux account I want to optimize the access to some files that are always read by my custom script, using the shared memory functions of PHP. But there are some questions I have:

*

*In a shared hosting (like GoDaddy's Linux Unlimited Hosting), is a single computer executing all of the script's instances, or could there be several computers due to load balancing?

*If there are several computers executing the script, is the same shared memory accessed by all of them?

*And, how much shared memory is it possible to allocate? I'd like to load some megabytes of data.

Best regards!

A: *

*There could be multiple if they are doing load balancing, you would have to ask them.

*No, shared memory is shared across the current host, not multiple

*Depends on system ram and limits in place by the system administrator.

A better solution would probarbly be to create a MySQL table with the engine type of HASH, which makes it a memory table. This would work around the issue of load balanced setups and also keep your data away from other users on the same server.


text:
Q: Pretty print for Java I am trying to change the content of a .java file
I got the AST thanks to:
ast = createAstFromFile(|project://foo/src/main/Main.java|,true);
ast = doSomeChanges(ast);

Then I want to serialize the AST.
Is there a way to get back the source code from an AST?


text:
Q: Возникает ошибка java.lang.NoClassDefFoundError: Failed resolution of: [Ljava/awt/geom/Line2D$Float; Работаю над андроид игрушкой и вылазит ошибка

java.lang.NoClassDefFoundError: Failed resolution of:
  [Ljava/awt/geom/Line2D$Float;
          at com.redromashka.entities.Player.hit(Player.java:151)

Вот кусок кода где ошибка:
public void hit()
    {
        if(hit){return;}

        hit = true;

        dx = dy = 0;

        GameSound.stop("thruster");
        left = right = false;

        hitLines = new Line2D.Float[4]; //вот строка где ошибка
        for(int i = 0, j = hitLines.length - 1; i < hitLines.length; j = i++)
        {hitLines[i] = new Line2D.Float(shapex[i], shapey[i], shapex[j], shapey[j]);}

        hitLinesVec = new Point2D.Float[4];
        hitLinesVec[0] = new Point2D.Float(
                MathUtils.cos(radians + 1.5f),
                MathUtils.sin(radians + 1.5f)
        );
        hitLinesVec[1] = new Point2D.Float(
                MathUtils.cos(radians - 1.5f),
                MathUtils.sin(radians - 1.5f)
        );
        hitLinesVec[2] = new Point2D.Float(
                MathUtils.cos(radians - 2.8f),
                MathUtils.sin(radians - 2.8f)
        );
        hitLinesVec[3] = new Point2D.Float(
                MathUtils.cos(radians + 2.8f),
                MathUtils.sin(radians + 2.8f)
        );
    }


text:
Q: How to create a feature collection after importing different shapefiles from assets in Google Earth Engine? I am importing 2 different shapefiles from assets to plot the time series chart of MODIS

but I am unable to make the feature collection out of these shapefiles
how to do that?

var Haryana_state = ee.FeatureCollection('users/abhilashaanu92/HaryanaBoundary');

Map.addLayer(Haryana_state);

var Punjab_state = ee.FeatureCollection('users/abhilashaanu92/punjab_state_boundary');

Map.addLayer(Punjab_state);

// Combine features into a feature collection.
var both_states = ee.FeatureCollection([Haryana_state, Punjab_state]).flatten();

Map.addLayer(both_states);

// Load MODIS vegetation indices data and subset annual images.

var vegIndices = ee.ImageCollection('MODIS/006/MOD13A1')
                     .filter(ee.Filter.date('2019-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .seriesByRegion({
          imageCollection: vegIndices,
          band: 'NDVI',
          regions: both_states,
          reducer: ee.Reducer.mean(),
          scale: 500,
          seriesProperty: 'label',
          xProperty: 'system:time_start'
        })
        .setOptions({
          title: 'Average NDVI Value by Date',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'NDVI (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['f0af07', '0f8755', '76b349'],
        });
print(chart);

if I put the name of a single shapefile variable in the regions then it is working but when I combine the 2 shapefiles into a feature collection then it is showing the error.
How to rectify this?
I want output something like this. (the time series of both the states on the same chart).

Chart Source URL

A: Two things need to be done here. First, add .flatten() after combining the two FeatureCollections.
This way, you make a collection of features (FeatureCollection), which is desired.
Otherwise, you end up with a collection of FeatureCollections, which prompts the error.
Second, the seriesProperty needs to match the label of your FeatureCollection. In this case, 'STATE_NAME'. You can check this by adding print(both_states) to check how your new FeatureCollection looks like. I've updated the code.
var Haryana_state = ee.FeatureCollection('users/abhilashaanu92/HaryanaBoundary');

Map.addLayer(Haryana_state);

var Punjab_state = ee.FeatureCollection('users/abhilashaanu92/punjab_state_boundary');

Map.addLayer(Punjab_state);

// Combine features into a feature collection.
var both_states = ee.FeatureCollection([Haryana_state, Punjab_state]).flatten();
print('Check the properties; this will tell you what seriesProperty to use', both_states)

Map.addLayer(both_states);

// Load MODIS vegetation indices data and subset annual images.

var vegIndices = ee.ImageCollection('MODIS/006/MOD13A1')
                     .filter(ee.Filter.date('2019-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .seriesByRegion({
          imageCollection: vegIndices,
          band: 'NDVI',
          regions: both_states,
          reducer: ee.Reducer.mean(),
          scale: 500,
          seriesProperty: 'STATE_NAME',
          xProperty: 'system:time_start'
        })
        .setOptions({
          title: 'Average NDVI Value by Date',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'NDVI (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['f0af07', '0f8755', '76b349'],
        });
print(chart);