text:
Q: Remove Column Names in the output I want to read data from MySQL database, and here's my code:
def create_server_connection(host, user, password,db):
    connection = None
    try:
        connection = pymysql.connect(host=host,
                                     user=user,
                                     password=password,
                                     database=db,
                                     cursorclass=pymysql.cursors.DictCursor)
        print("MySQL Database connection successful")
    except err as error:
        print(f"Error: '{error}'")
    return connection

connection = create_server_connection("localhost", "root", "root1234","raw_data")
cur = connection.cursor()

def get_Tables_byName(cursor, tableName):
    q1 = f'''
    SELECT * FROM raw_data.{tableName}; '''
    res = []
    cursor.execute(q1)
    for row in cursor:
        res.append(row)
    return res

results = get_Tables_byName(cur,'data_31942010201')
print(results)

One of lines of the output is {'a': 3, 'b': 6, 'c': 9}. How do I remove the variable names so that the output becomes {3, 6, 9}?
Sample rows from "raw_data.{tableName}"
Part of the output:
[{'IMU_sample_rate': 500.0, 'grf_sample_rate': 1000.0, 'lshank_time': None, 'lshank_accel_x': None, 'lshank_accel_y': None, 'lshank_accel_z': None, 'lshank_gyro_x': None, 'lshank_gyro_y': None, 'lshank_gyro_z': None, 'lshank_mag_x': None, 'lshank_mag_y': None, 'lshank_mag_z': None, 'lshank_quat_x': None, 'lshank_quat_y': None, 'lshank_quat_z': None, 'rshank_time': None, 'rshank_accel_x': None, 'rshank_accel_y': None, 'rshank_accel_z': None, 'rshank_gyro_x': None, 'rshank_gyro_y': None, 'rshank_gyro_z': None, 'rshank_mag_x': None, 'rshank_mag_y': None, 'rshank_mag_z': None, 'rshank_quat_x': None, 'rshank_quat_y': None, 'rshank_quat_z': None, 'sacrum_time': None, 'sacrum_accel_x': None, 'sacrum_accel_y': None, 'sacrum_accel_z': None, 'sacrum_gyro_x': None, 'sacrum_gyro_y': None, 'sacrum_gyro_z': None, 'sacrum_mag_x': None, 'sacrum_mag_y': None, 'sacrum_mag_z': None, 'sacrum_quat_x': None, 'sacrum_quat_y': None, 'sacrum_quat_z': None, 'grf_time': 177.6229999943701, 'grf_x': -1.2485357103999917, 'grf_y': 3.549862406599999, 'grf_z': 642.777432292, 'grf_fp1_ax': None, 'grf_fp1_ay': None, 'grf_fp2_ax': None, 'grf_fp2_ay': None}, {'IMU_sample_rate': 500.0, 'grf_sample_rate': 1000.0, 'lshank_time': None, 'lshank_accel_x': None, 'lshank_accel_y': None, 'lshank_accel_z': None, 'lshank_gyro_x': None, 'lshank_gyro_y': None, 'lshank_gyro_z': None, 'lshank_mag_x': None, 'lshank_mag_y': None, 'lshank_mag_z': None, 'lshank_quat_x': None, 'lshank_quat_y': None, 'lshank_quat_z': None, 'rshank_time': None, 'rshank_accel_x': None, 'rshank_accel_y': None, 'rshank_accel_z': None, 'rshank_gyro_x': None, 'rshank_gyro_y': None, 'rshank_gyro_z': None, 'rshank_mag_x': None, 'rshank_mag_y': None, 'rshank_mag_z': None, 'rshank_quat_x': None, 'rshank_quat_y': None, 'rshank_quat_z': None, 'sacrum_time': None, 'sacrum_accel_x': None, 'sacrum_accel_y': None, 'sacrum_accel_z': None, 'sacrum_gyro_x': None, 'sacrum_gyro_y': None, 'sacrum_gyro_z': None, 'sacrum_mag_x': None, 'sacrum_mag_y': None, 'sacrum_mag_z': None, 'sacrum_quat_x': None, 'sacrum_quat_y': None, 'sacrum_quat_z': None, 'grf_time': 177.624, 'grf_x': -1.382789665600015, 'grf_y':
3.6822509309999916, 'grf_z': 642.082102484, 'grf_fp1_ax': None, 'grf_fp1_ay': None, 'grf_fp2_ax': None, 'grf_fp2_ay': None}]


text:
Q: A generalization of Erdős–Newman–Mirsky? Given a sequence $S$ of natural numbers, write ${\bf Gap}(S)$ for the set of differences between consecutive terms.  (So $|{\bf Gap}(S)|=1$ precisely for arithmetic progressions, hence the connection to Erdős–Newman–Mirsky.)
Question 1: Can one partition the natural numbers into finitely many sequences $S_i$ with all the ${\bf Gap}(S_i)$ collectively disjoint and with no ${\bf Gap}(S_i)$ containing 1?
Question 2: If so, can one do it with  $|{\bf Gap}(S_i)|<\infty$ for all $i$?
Question 3: If Question 2 comes up negative, can one prove this in something like the usual way, via generating functions and their poles?  (I believe that a counter-example plus the pigeon-hole principle would yield a periodic counter-example.)

A: I've now found that extending cyclically the pattern
12131214121312413151412131215
gives a partition of the natural numbers into five sets with disjoint gap sets.
No examples exist with fewer than five cells in the partition.
So any possible generalization of Erdős–Newman–Mirsky will require some additional hypothesis.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Pearson's or Spearman's? We are doing a lab report comparing attachment scores and their effect on trust scores.
We have been told to do correlations followed by linear regression to get rid of confounders.
However, we have found that trust, the dependent variable, strongly deviates from normality kurtosis = 2.02 and q-q plot looks abnormal but the KS test does not suggest abnormality.
I am not sure whether to report Pearson's or Spearman's considering the independent variable is normally distributed and confused as to why we have been asked to do regression if trust is not normally distributed.
Spearman's is not significant whereas Pearson's is.
A simplified answer would be preferred as I am an undergraduate doing my first research project.

A: Focusing on the correlation issue (Pearson vs. Spearman), based on what you've told us, it sounds like the Pearson correlation will be adequate for this situation.
The KS test tends to be overly sensitive to departures from normality, so that non-significant KS test, along with the modest kurtosis, suggests that normality isn't grossly violated.  The Pearson correlation will suffer from increased Type I and II errors, but only with much more extreme departures from normality.  For example, some simulation studies find inflated Type I and II errors when excess kurtosis is as high as 12, but I have not seen such results for excess kurtosis of 2.  See this previous post for a reference and more details.
Some caveats and other considerations:
1.  The traditional significance test of the Pearson correlation (the one you probably learned in intro stats) assumes that both variables are approximately normal.  In contrast, the typical significance tests for regression assume normal residuals (that is, that the datapoints' vertical distances relative to the regression line are normally distributed).
2.  The fact that you have very different results for the Pearson versus Spearman correlation suggests that you should examine a scatterplot carefully.  Ask yourself whether a single outlier is driving the pattern.  If so, the Spearman correlation might actually make more sense, as it is less sensitive to outliers.


text:
Q: Make Cache Images to appear in gallery while using Uinversal Image Loader in android I am using Universal Image Loader lib in my app and caching the images to my sd card. The images are being saved very well, and i can see them using any file explorer in my mobile.
But the images are not shown in gallery.
Is there anyway to make them appear in gallery images too.
EDITE :
File filePath = Environment.getExternalStorageDirectory();
String phNumber[] = Constacts.contactJID.split("@");
String dir = "/Image Messages/"+phNumber[0];
File myCacheDir = new File(filePath, dir);
if(!(myCacheDir .exists())){
    myCacheDir .mkdirs();
}

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getActivity())
.defaultDisplayImageOptions(defaultOptions)
.memoryCache(new WeakMemoryCache())
.diskCacheSize(100 * 1024 * 1024)
.diskCache(new UnlimitedDiscCache(myCacheDir , myCacheDir ,  new MyFileNameGenerator() ))
.build();

Edited (2nd):
    public class MyFileNameGenerator extends Md5FileNameGenerator {

    @Override
    public String generate(String imageUri) {
        return super.generate(imageUri)+".jpg";
    }
  }


text:
Q: AzureDevOps Build/Release Pipeline - get git commit message (Build title)? I have a webhook task that runs after a deploy on my release pipeline, currently it just pushes a message to say a new version has been deployed, but I'd like to include the git commit message in this as well to show exactly what has been deployed. I'm not quite sure how to retrieve this, but I'm hoping it's possible as the build is initially triggered from a git push and moreover the Build title is named with this message as per this screenshot:

A: This is somewhat tricky since the Release Pipeline typically does not
have Git access like the Build Pipeline does. To add to this, it is not
possible to share variables across pipelines, which would have been an
easy solution.
This is how I've done it:
First, Add a Bash script task to your Build Pipeline that exports your
last commit message to a file:
CHANGES=`git log -1 --pretty=%B`
mkdir -p $(Build.artifactStagingDirectory)/exported
echo "$CHANGES" > $(Build.artifactStagingDirectory)/exported/CHANGES

Make sure this folder is published as an artifact in your build using
the Publish build artifacts task:
Path to publish: $(Build.ArtifactStagingDirectory)/exported
Artifact name: exported
Second, add a Bash script task to your Release Pipeline that picks up
these changes from the file and stores them in a variable:
CHANGES=$(cat $(System.DefaultWorkingDirectory)/Development/exported/CHANGES)
echo "##vso[task.setvariable variable=commitComment]$CHANGES"

The last Git change is now available for use in your Build Pipeline as the variable $commitComment.
Note: your exact paths above may vary.

A: Ok, I've worked out a way, not sure if it's the best way so let me know if it can be done differently...
I've used a Powershell Task in the Release pipeline which queries the Azure REST API and calls into Git, as follows:
$webClient = New-Object Net.WebClient
$token = "Bearer $env:SYSTEM_ACCESSTOKEN"
$headers = @{ Authorization = $token }

$baseUrl = "https://dev.azure.com/<your company>/<your project>/_apis/git/repositories/<your repo Id>/commits"
$request = "$baseUrl/$env:RELEASE_ARTIFACTS_<your repo name>_SOURCEVERSION"
Write-Host "Request: $request"

$response = Invoke-WebRequest -Uri $request -Headers $headers
$json = ($response | ConvertFrom-Json)
$comment = $json.comment
Write-Host "Response: $comment"

Write-Host "##vso[task.setvariable variable=commitComment;]$comment"

To find out the values for the parameters I've tokenised above, follow this guide:
https://learn.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&tabs=powershell#view-the-current-values-of-all-variables
This writes to a custom pipeline variable I've created called "commitComment", which I then use in a marketplace task I found to generate a discord webhook request.
Alternatively, you could just call that directly from Powershell.
Hope this helps anyone wanting to do the same..

A: Updated version: The json response contains not only the last commit, but a collection of the last 100 commits. You would need to access the first commit in the collection (ordered by date DESC). Also, all <your_custom_values> can be retrieved dynamically, to improve reusability:
$webClient = New-Object Net.WebClient

$token = "Bearer $env:SYSTEM_ACCESSTOKEN"
$headers = @{ Authorization = $token }

$devOpsUrl = "$(System.TeamFoundationCollectionUri)"
$projectName = "$(System.TeamProject)"
$repoId = "$(Build.Repository.Id)"
$repoName = "$(Build.Repository.Name)"

$baseUrl = "$devOpsUrl$projectName/_apis/git/repositories/$repoId/commits"
$request = "$baseUrl/$env:RELEASE_ARTIFACTS_$repoName_SOURCEVERSION"

Write-Host "Request: $request"

$response = Invoke-WebRequest -Uri $request -Headers $headers

$json = ($response | ConvertFrom-Json)
$lastCommit = $json.value[0]

Write-Host "Last Commit: $lastCommit"

$comment = $lastCommit.comment
Write-Host "Comment: $comment"
Write-Host "##vso[task.setvariable variable=CommitMessage;]$comment"


text:
Q: Sign difference in eigenvectors taken form Matlab and Python Could you please explain why there is a sign difference in some of the eigenvectors (2-4)? Does this difference affect further calculation in further calculations, e.g dimensionality reduction?
Matlab:
N = 5000;
dataA = rand(N,5);
covA = cov(dataA);
%covA = dataA*dataA'/(length(dataA)-1);
covA = covA + eps.*eye(size(covA));
[~,pA] = chol(covA);
assert(pA==0,'A is not possitive definite')

dataB = rand(N,5);
covB = cov(dataB);
%covB = dataB*dataB'/(length(dataB)-1);
covB = covB + eps.*eye(size(covB));
[~,pB] = chol(covB);
assert(pB==0,'B is not possitive definite')

[V,D] = eig(covA, covB);

V =

   -0.4241   -1.0891    1.8175    2.4067   -1.3032
    1.4445   -1.8960   -1.4118   -0.6514   -2.0075
    0.1214   -2.5039    0.3332   -0.1705    2.3609
   -2.1235   -0.7007    1.1632   -2.1532   -1.0554
   -2.2599   -0.4405   -2.2236    1.2545    0.0760

Python:
from scipy.linalg import eigh
import scipy.io
import numpy as np

cov_mat = scipy.io.loadmat('cov.mat')
covA = cov_mat['covA']
covB = cov_mat['covB']
eigvals, eigvecs = eigh(covA, covB, eigvals_only=False)

np.savetxt('eigvals.txt', eigvals, fmt='%.4f')
np.savetxt('eigvecs.txt', eigvecs, fmt='%.4f')

eigvecs =

   0.4241 1.0891 -1.8175 -2.4067 -1.3032
  -1.4445 1.8960  1.4118  0.6514 -2.0075
  -0.1214 2.5039 -0.3332  0.1705  2.3609
   2.1235 0.7007 -1.1632  2.1532 -1.0554
   2.2599 0.4405  2.2236 -1.2545  0.0760

A: They are the same eigenvectors, as flipping the signs on eigenvectors does not change their formulation - they will have the same eigenvalue. It will not affect further calculations as a result.
Why are they calculated differently?
Most likely because the subroutines that are run vary based on the matrix that is being operated on, and don't care what 'sign' they return because eigenvalues don't have one.

A trivial mathematical proof:
If x is an eigenvector of matrix A with eigenvalue q, then by definition we have that Ax = qx.
It follows that A(-x) = -(Ax) = -(qx) = q(-x) such that -x is an eigenvector with the same eigenvalue.


text:
Q: How to grant access to role for the tables that are created today How to grant access to role for the tables that are created today :
grant select on ( select
       object_name as table_name
from sys.all_objects
where object_type = 'TABLE'
-- excluding some Oracle maintained schemas
and owner not in ('ANONYMOUS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS',
  'MDSYS', 'MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN',
  'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS',
  'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP',
  'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM', 'XS$NULL',
  'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'PUBLIC')
and created > sysdate -1
)  to  PSREAD_ROLE_W;

This query is not working. I am not sure how to pass the selected values in order to grant the access.

A: you will not run your sql successfully because you essentially need 'dynamic sql', you may need write a piece of block of pl/sql as below in SqlPlus.
begin
for tab in (select owner,object_name
    from sys.all_objects
    where object_type = 'TABLE'
    -- excluding some Oracle maintained schemas
    and owner not in ('ANONYMOUS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS',
      'MDSYS', 'MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN',
      'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS',
      'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP',
      'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM', 'XS$NULL',
      'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'PUBLIC')
loop
    execute immediate 'grant select on ' || tab.owner || '.' || tab.object_name || ' to PSREAD_ROLE_W';
end loop;
end;
/

try this code with sqlplus, if your need call it from jdbc, you still need create a named procedure and then call from java code.

A: you can run this SQL, generate the output and execute the SQL generated.
Or the other option is to USE dynamic SQL and execute immediate to run the SQL
    SELECT ' GRANT SELECT ON ' ||    object_name || ' to PSREAD_ROLE_W; '
from sys.all_objects obj   where object_type = 'TABLE'
and created > sysdate -1


text:
Q: Difference of regex in python and google app script (backend engine related?) I tried the same regular expression both in python (3.6, jupyter notebook) and Google app script, but it seems like "non-capturing group" is not working in the app script case.
# python script:
import re
text=''
regex='(?:)'
match=re.search(regex,text)
print(match.group(1))
# result is 'SOisAwesome@hello.edu'

// Google app script
function myFunction() {
  string=''
  regex=new RegExp('(?:)')
  Match=regex.exec(string)
  Logger.log(Match[1])
  // result is 'a class=""email"" href=""mailto:SOisAwesome@hello.edu'
}

If I am not mistaken, regular expression engine in Google app script should support non-capturing groups (referring to https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines, I suppose I should be looking at "JavaScript (ECMAScript)" and "Shy groups"?), can anyone explain what I'm missing here?
Thanks in advance!

A: First of all, you need to use \\ before . in the GAS regex declaration, as the literal backslash forms a regex escape sequence.
Now, it seems that GAS non-capturing group implementation is buggy.
If you run your regex in GAS and print the Match object, you will see
[18-01-26 08:49:07:198 CET] [,
a class=""email"" href=""mailto:SOisAwesome@hello.edu, "">]

That means, the non-capturing group got "merged" with the first capturing group skipping the first char.
Here are some more experiments:
Logger.log(new RegExp("(?:;\\w+):(\\d+)").exec(";er:34")); // = null, expected [;er:34, 34]
Logger.log(new RegExp("(?:e\\w+):(\\d+)").exec(";er:34")); // = null, expected [er:34, 34]
Logger.log(new RegExp("(?:\\w+):(\\d+)").exec(";er:34"));  // =  [er:34, 34], as expected

To fix the issue, you may remove the non-capturing parentheses, as \d = (?:\d).


text:
Q: expression "that would have been a monumental moment!", correct? A famous person in the field said to me "I met this popular guy xx in a conference" I wanted to respond by saying "you two gurus met? that would have been a monumental moment"
does this grammatically make sense?
Please advise. Thanks!

A: Not quite. There are two words that are frequently confused even by native speakers - momentous and monumental. You want the former here - a momentous occasion. (But please, not monumentous, not yet, anyway.


text:
Q: HTML5 and huge local storage of downloaded files I'm choosing a platform for distributed MP3 player. Its basic functionality will be:

*

*authenticate itself and query central server (through HTTP request to asmx web service)

*get list of approved MP3s in some JSON

*download those MP3s to local disc

*play downloaded files (not stream, player must work also without temporary connection to server)

I'm thinking about HTML5 based player. But I'm not sure about new HTML5's File object capatibilities. Is possible to download and store huge (GBs) amount of mp3 data to local disc and access it purely in HTML5/js?
Didn't I miss something? Are there some other gaps? Customer need as multi-platform player as possible, so quick work in WPF C# is last choice.

A: I would look into the HTML5 File API, or a chrome extension (Allows infinite store with Web SQL DBs).
The file API spec is here:
http://dev.w3.org/2009/dap/file-system/pub/FileSystem/
Basically all other storage mechanisms have a hard limit on most browsers, even though Web SQL is spec'd to allow you to specify max db size in your app.


text:
Q: jsonp multi callback calling error i have a problem with a JSONP calling,
i need to make several call to a javascript function
in the example the html page work only for the last function called not for all 3.
how i can resolve?
( the page work if i set a timeoutinterval, but i don't want that solution )
thanks
below the code
HTML PAGE
**


text:
Q: What does the split("[\t ]") from line I'm parsing a line from a file.
String tokens[] = line.split("[\t ]+");

I understand what it should do but I'm not getting the objective of the \t.
Can anyone explain me?

A: *

*[...] Character class - matches one character in between the brackets.

*

*\t The tab character

* A space

*+ Quantifier - match the previous token 1 or more times.

Examples:
"foo   bar qux"   => ["foo", "bar", "qux"]
"foo\t  bar\tqux" => ["foo", "bar", "qux"]

You might want to use the \s whitespace meta character, which is equivalent to [\r\n\t\f ].

A: \t is a tab space character...
it is used to add tab spaces in strings but do make sure to use \\ in Split function to escape the first \

A: \t is a tabulator character. So in this case you have a String line, that may contain \t characters and you split this String by tabulator into an array.

A: \t is a tab space escape character,but i think in your case you should use:
str.split("\\s+");

if you want to split between even a single white space

A: Try \\t instead of \t. Split function needs to see the escape character.


text:
Q: Авторизация в JSF Java EE Пишу авторизацию пользователей в моем Web приложении на JSF, возникла проблема в том, что когда мы используем теги h:inputText & h:inputSecret, а потом нажимаем на h:commandButton, то значения полей без всякого хеширования и шифрования отправляются на сервер post запросом.
<h:form>
   <h:inputText value="${authBean.login}"/>
   <h:inputSecret value="${authBean.password}" />
   <h:commandButton value="Войти" action="${authBean.login}"/>
</h:form>

Вопрос состоит в том, чтобы до отправки данных на сервер и при регистрации, и при авторизации, сначала хешировать пароль логин какой нибудь хеш функцией (SHA-256 например), а только потом отправлять их на сервер, чтобы там сравнивать хеши.
Таким образом, получается мы не посылаем в открытую логин и пароль, чтобы их нельзя было перехватить. Можно ли как-то это реализовать в JSF, или придётся с помощью JavaScript осуществлять хеширование на стороне клиента и потом отправлять это серверу?
И если да, то можно ссылки на подобную реализацию, т.к. в Java Script не разбираюсь, не знаю как из него посылать post запросы серверу и т.д.

A: В целях безопасности для входа и регистрации с использованием JAAS логин и пароль передается в открытом виде, а хэш не передается клиенту и клиент не может его передать на сервер. Если вы используете POST запрос, то эти данные не могут быть видны в URL. Для того, чтобы данные не были перехвачены надо использовать SSL.


text:
Q: Python: ID error when importing csv file with pandas I am trying to Import a csv file saved in a local Folder. When I use Anaconda Python Notebook I have no Problems, while using Zeppelin I do have issues.
The code I am using, that works fine in Anaconda, is:
#import csv data

frequency=pd.read_csv("C:\\Users\\L18938\\Desktop\\Vehicle_to_grid\\analysis\\Frequency_March_2018.csv", nrows=86401)

However, when running it on Zeppelin, I receive:
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 646, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 389, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 730, in __init__
    self._make_engine(self.engine)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 923, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 1390, in __init__
    self._reader = _parser.TextReader(src, **kwds)
  File "pandas/parser.pyx", line 373, in pandas.parser.TextReader.__cinit__ (pandas/parser.c:4025)
  File "pandas/parser.pyx", line 667, in pandas.parser.TextReader._setup_parser_source (pandas/parser.c:8031)
IOError: File C:\Users\L18938\Desktop\Vehicle_to_grid\analysis\Frequency_March_2018.csv does not exist

Obviously, the file exists and there are no Errors in the path spelling.

I have tryied / or double \, but nothing changes. Also
os.chdir("C:/Users/L18938/Desktop/Vehicle_to_grid/analysis")

or
os.listdir("C:/Users/L18938/Desktop/Vehicle_to_grid/analysis")

Any idea? thank you in advance

A: Your Traceback let show you that the python interpreter is running in Unix file path mode (/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py)
When you are under Anaconda, you are in pure windows and your traceback will be something like (C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py)
Anaconda will reach file with a Windows type file-path, and Zeppelin will reach file in a UNIX type file-path.
Your issue is definitely relative to how you specify your path in Zeppelin, you can't use Windows path, but you you may try something like that:
frequency=pd.read_csv("file:///C:/Users/L18938/Desktop/Vehicle_to_grid/analysis/Frequency_March_2018.csv", nrows=86401)


text:
Q: Storing mysql float values i'd like to store a number with double precision ([NSDate timeIntervalSinceReferenceDate] return value from objective-c)  in a mysql database.
The query seems to execute fine, but when i perform a select query, it returns 1.00000.
i have no clue why. i searched the web for clues, many came up but none solved my issue.
Can you guys help?
update query
update tblPurchased
set
    sync = '429568293.63687'
        and consumablecount = 0
where
    id = 2;

result from mysql workbench
22:52:09    update tblPurchased  set      sync = '429568293.63687'         and consumablecount = 0 where     id = 2 0 row(s) affected Rows matched: 1  Changed: 0  Warnings: 0  0.003 sec

or
22:58:25    update tblPurchased  set      sync = 429568293.63687         and consumablecount = 0 where     id = 2   0 row(s) affected Rows matched: 1  Changed: 0  Warnings: 0  0.003 sec

describe table
'sync', 'decimal(15,5)', 'NO', '', '0.00000', ''

result from select query
"id", "sync"
'2', '1.00000'

A: i need to learn how to write an update query ...
update tblPurchased
set
    sync = '429568293.63687'
        and consumablecount = 0
where
    id = 2;

should be
update tblPurchased
set
    sync = 429568293.63687,
    consumablecount = 0
where
    id = 2;


text:
Q: CORS issue in React js I am using React js in front end and webApi (c#) for service side. Initially i got issue with CORS while trying to get data from db and then i have added the below lines in web.config file then the issue got resolved. I am able to get data from web api.
<customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type,Origin,Accept" />
        <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>

But now i am trying to post data, that is sending data from react js to web api, it is throwing the same cors error. please find the below lines from react js
fetch(url, {
    method: 'POST',
    mode:'cors',
    // body: JSON.stringify(data),
    // headers :{
    //   'Content-Type': 'application/json',
    //   'Access-Control-Allow-Origin':'*'
    // },
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'Access-Control-Allow-Origin':'*',
      'Access-Control-Allow-Headers':'Origin,Content-Type,Accept',

    }
  });

Is there anything i am missing. I dont understand why it is working for getting data and not for posting data. Any one can help me on this?
Thanks in advance.

A: i have installed Microsoft.AspNet.WebApi.Cors dll and the cors issue got resolved. Thanks all.

A: I faced the smiler issue when I fetch the data from medium.com. In there the CROS issue happened by RSS feed. if you fetch the RES feed data from backend then use RSStoJSON api. To get https://rss2json.com/#rss_url=http%3A%2F%2Ffeeds.twit.tv%2Fbrickhouse.xml
To post use this dependency in your project https://www.npmjs.com/package/jsonfeed-to-rss
But I followed those mechanisms
I couldn't exactly say this problem is same as your problem. If you mentioned that error it's easy to answer for me


text:
Q: stdarg.h, new.h, float.h files missing in iOS 4.3 SDK (XCode 4) It seems files like stdarg.h, new.h, float.h are missing in iOS 4.3 SDK. These files however were available in the earlier versions of the SDK (and XCode).
Can somebody shed some light on this?
Thanks.


text:
Q: Can't save changes on INSERTed records I have Entity Framework application that has a model generated from Database (Database First approach).
My function adds new records to the DbSet. After I add them all I'm trying to save changes to the table in the Database through db.SaveChanges(). The same function is used for all tables in the Database. They all have the same format:
CREATE TABLE [dbo].[Table1](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Column1] [nvarchar](200) NULL,
    [Column2] [nvarchar](200) NULL,
    [Column3] [decimal](20, 10) NULL,
    [cs_Table1]  AS (checksum([Column1],[Column2])),
PRIMARY KEY CLUSTERED
(
    [Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Some tables have more or less columns. The problem is that importing new records works for most of the tables but for two it doesn't. I've checked many times. They don't differ in any significant way. When I try to save changes on those two tables I get no errors it executes. I've debugged it, it correctly passes new instances but on db.SaveChanges() it doesn't do anything.
I've read in other posts that sometimes you have some kind of copy of the Database and it copies there. How can I check this? And why it works on some of the tables and on some doesn't. It's the same Database.
Snippet where I save the changes:
using (FileStream stream = File.Open(excel, FileMode.Open))
{
    My_Model db = new My_Model ();
    var class = new ExcelExtractingClass(db);
    class.ImportFromExcel(stream);
    db.SaveChanges();
}

ImportFromExcel is a long function. But I'm sure it works. All it does in regards to my problem is using: DbSet.Add(entity). But it works for most of the tables. DbSet is defined in My_Model it was generated from Database.

A: After a thorough debugging I've found that my logic which skipped Adding new records was not working properly for those two tables.


text:
Q: Cast an Int32 NAN in a float I need to communicate 32-bits float values between different platforms (some are computers, some are electronic boards) for data acquisition.
In my communication protocol, I would like to communicate errors using NAN floats. The issue is, there are many NAN and I would like to use one in particular 0x7FA00000.
So, I would like to have a header in which I define:
#define DAQ_SYSTEM_ERROR  (0x7FA00000)

The issue is, this is a valid 32 bit integer and doing:
float value = DAQ_SYSTEM_ERROR;

does not yield the desired result.
Is there a way to dot this without too much code? In particulat, is there a way to use reinterpret cast directive to thell the compiler what I want? I feel it should be possible, but I can't manage it.
The code must work in C, C++, Objective-C and Swift.
EDIT
Thank you for your comments. I am indeed only interested in one value. The idea is to get the float, then check against NAN (defined as 0x7FA00000) to know if the value retrieved is a valid measurement (and should be recorded) or if an error occured somewhere, in which case the value should be discarded and a flag raised. On the "sending" platform, somewhere a float value is affected a 0x7FA00000 value. On the recieving platform, the bytes are first decoded, compared to 0x7FA00000, then stuffed in a float if everything went well.

A: There's no way to specify an exact bit pattern to be cast into a float at compile time. ((float)0x7FA00000) will just become 2141192192.0. The only way to get specific bits into a float value is through a pointer at runtime:
float fval;
uint32_t fbits = 0x7FA00000;

. . .

memmove(&fval, &fbits, sizeof float);

Most compilers would also accept:
*((uint32_t *)(& fval)) = fbits;

Though the memmove() is more portable.


text:
Q: Multiple instances of featherlight iframe - not triggering Fighting an issue on a kiosk project and using Featherlight iframe. It's a Hall of Fame project - if loaded on 1080px wide by 1920px tall (Chrome Developer Tools works great, but has to load fresh (clear cache), as we're creating a cookie for the resolution check to test against), then the project loads the kiosk version theme.
http://dev.demo38.com/owu/hall-of-fame/
We're listing the Hall of Fame members, pulled from a WordPress custom post type, and filtered with Isotope. The first time opening a Hall of Fame member's info in Featherlight lightbox from the Hall of Fame list, it works great, however, next attempts don't fire. Not getting any console errors.
Any thoughts on getting Featherlight to work with multiple instances?
This is the code from within the WordPress loop
<a class="anti-link-scroll" href="<?php the_permalink($post_object->ID); ?>" data-featherlight="iframe" data-featherlight-iframe-height="1080">

                    <?php the_field('last_name'); ?>, <?php the_field('first_name'); ?>

Thanks for any insight.

A: Featherlight handles multiple instances without a problem. The gallery example has two separate galleries, for example.
As always when trying to understand an issue, making a minimal example helps tremendously.


text:
Q: Carriage returns in XML comment: "The content of elements must consist of well-formed character data or markup" I have the following Ant build file:
<?xml version="1.0" encoding="UTF-8"?>
<project default="build" name="MyAntScript">

    <!--
    A comment explaining
    the ant file going over
    multiple lines
    like this
    quite poetic, huh?
    -->

    <import file="myant.xml" />
    ...
</project>

When viewing this file in Eclipse and when running my Ant script, it gives me the following error message
      c:\myant.xml:6: The content of elements must consist of well-formed
      character data or markup.

The error goes away if I turn the XML comment into a single line (edit: and comes back when I put the newline back in...). What gives??

Edit The problem was in the imported ant file..Eclipse had an issue where it marked line 6 in the main Ant build file rather than the imported build file.

A: Thanks to Jon Skeet's pointers, I tried shortening the Ant file until I figured out the problem was actually in line six of an imported Ant build file, not the main file itself. This had thrown me off since Eclipse was marking line six of the main Ant build file.
The imported Ant build file had a SVN conflict which obviously led to issues with XML well-formedness.
Sorry about that. I'll leave this open in case someone else encounters a similar silly mistake...


text:
Q: Admob banner ad display height is not coming correctly in android game made with andengine I have implemented admob | GoogleMobileAdSDK into my android game build with andengine. The ads are loading into the game but not displaying correctly for the first time after opening the app. But when I go out of app activity say by clicking an add or going to google play leaderboard and come back to the app then it starts displaying it correctly.
So basically when I open the app the ads are coming with full width but almost with half height. And if clicked on the ad, goes to the ad link and come back to my app by pressing back button the ad comes with full width full height. Stuck on this for 3 days :/
public static AdView adView;
@Override
protected void onSetContentView() {

    final FrameLayout frameLayout = new FrameLayout(this);
    final FrameLayout.LayoutParams frameLayoutLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
    adView = new AdView(this);
    new AdView(this);
    adView.setAdSize(AdSize.BANNER);
    adView.setAdUnitId("MY AD UNIT ID");
    final FrameLayout.LayoutParams adViewLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_HORIZONTAL);
    this.mRenderSurfaceView = new RenderSurfaceView(this);
    mRenderSurfaceView.setRenderer(this.mEngine, this);

    AdRequest adRequest = new AdRequest.Builder()
    .addTestDevice("MY EMULATOR ID")
    .addTestDevice("MY DEVICE ID")
    .build();

    final FrameLayout.LayoutParams surfaceViewLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
    frameLayout.addView(this.mRenderSurfaceView,surfaceViewLayoutParams);
    frameLayout.addView(adView,adViewLayoutParams);
    this.setContentView(frameLayout, frameLayoutLayoutParams);

    adView.loadAd(adRequest);
    Log.d("Ads","AdView banner size is "+adView.getWidth()+" and "+adView.getHeight());
    //Creating the banner view.

}

Also the log i feed into the code to see adview sizes. it always print this on the starting of the app

AdView banner size is 0 and 0

A: Try adding the adView to the frameLayout only after it finishes loading:
adView.setAdListener(new AdListener() {
    public void onAdLoaded(){
        frameLayout.addView(adView, adViewLayoutParams);
    }
});

If your ad is refreshing you may want to check first if the adView is already added to the frameLayout before adding it, or it will crash.


text:
Q: Disk full, du tells different. How to further investigate? I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown.
However, if I run a du -h -x / then du tells me that only 12G are used (I use -x because of some Samba mounts).
So my question is not about subtle differences between the du and df commands but about how I can find out what causes this huge difference?
I rebooted the machine for a fsck that went w/out errors. Should I run badblocks? lsof shows me no open deleted files, lost+found is empty and there is no obvious warn/err/fail statement in the messages file.
Feel free to ask for further details of the setup.

A: I agree with OldTroll's answer as the most probable cause for your "missing" space.
On Linux you can easily remount the whole root partition (or any other partition for that matter) to another place in you filesystem say, /mnt, for example, just issue a
mount -o bind / /mnt

then you can do a
du -h /mnt

and see what is using up your space.

A: Files that are open by a program do not actually go away (stop consuming disk space) when you delete them, they go away when the program closes them.  A program might have a huge temporary file that you (and du) can't see.  If it's a zombie program, you might need to reboot to clear those files.

A: For me, I needed to run sudo du as there were a large amount of docker files under /var/lib/docker that a non-sudo user doesn't have permission to read.

A: Try this to see if a dead/hung process is locked while still writing to the disk:
lsof | grep "/mnt"
Then try killing off any PIDs which are stuck (especially look for lines ending in "(deleted"))

A: This is the easiest method I have found to date to find large files!
Here is a example if your root mount is full / (mount /root)
Example:
cd / (so you are in root)
ls | xargs du -hs
Example Output:

 9.4M   bin
 63M    boot
 4.0K   cgroup
 680K   dev
 31M    etc
 6.3G   home
 313M   lib
 32M    lib64
 16K    lost+found
 61G    media
 4.0K   mnt
 113M   opt
 du: cannot access `proc/6102/task/6102/fd/4': No such file or directory
 0  proc
 19M    root
 840K   run
 19M    sbin
 4.0K   selinux
 4.0K   srv
 25G    store
 26M    tmp

then you would notice that store is large do a
cd /store
and run again
ls | xargs du -hs

Example output:
 109M   backup
 358M   fnb
 4.0G   iso
 8.0K   ks
 16K    lost+found
 47M    root
 11M    scripts
 79M    tmp
 21G    vms

in this case the vms directory is the space hog.

A: In my case this had to do with large deleted files. It was fairly painful to solve before I found this page, which set me on the correct path.
I finally solved the problem by using lsof | grep deleted, which showed me which program was holding two very large log files (totalling 5GB of my available 8GB root partition).

A: See what df -i says.  It could be that you are out of inodes, which might happen if there are a large number of small files in that filesystem, which uses up all the available inodes without consuming all the available space.

A: One more possibility to consider - you are almost guaranteed to see a big discrepancy if you are using docker, and you run df/du inside a container that is using volume mounts. In the case of a directory mounted to a volume on the docker host, df will report the HOST's df totals. This is obvious if you think about it, but when you get a report of a "runaway container filling the disk!", make sure you verify the container's filespace consumption with something like du -hs <dir>.

A: So I had this problem in Centos 7 as well and found a solution after trying a bunch of stuff like bleachbit and cleaning /usr and /var even though they only showed about 7G each.  Was still showing 50G of 50G used in the root partition but only showed 9G of file usage.  Ran a live ubuntu cd and unmounted the offending 50G partition, opened terminal and ran xfs_check and xfs_repair on the partition. I then remounted the partition and my lost+found directory had expanded to 40G.  Sorted the lost+found by size and found a 38G text log file for steam that eventualy just repeated a mp3 error.  Removed the large file and now have space and my disks usage agrees with my root partition size.  I would still like to know how to get the steam log to not grow so big again.

A: Just stumbled on this page when trying to track down an issue on a local server.
In my case the df -h and du -sh mismatched by about 50% of the hard disk size.
This was caused by apache (httpd) keeping large log files in memory which had been deleted from disk.
This was tracked down by running lsof | grep "/var" | grep deleted where /var was the partition I needed to clean up.
The output showed lines like this:
httpd     32617    nobody  106w      REG        9,4 1835222944     688166 /var/log/apache/awstats_log (deleted)
The situation was then resolved by restarting apache (service httpd restart), and cleared up 2gb of disk space, by allowing the locks on deleted files to be cleared.

A: Check for files on located under mount points.  Frequently if you mount a directory (say a sambafs) onto a filesystem that already had a file or directories under it, you lose the ability to see those files, but they're still consuming space on the underlying disk.  I've had file copies while in single user mode dump files into directories that I couldn't see except in single usermode (due to other directory systems being mounted on top of them).

A: A similar thing happened to us in production, disk usage went to 98%. Did the following investigation :
a) df -i for checking the inode usage, inode usage was 6% so not much smaller files
b) Mounting root and checking hidden files. Could not file any extra files. du results were same as before mount.
c) Finally, checked nginxlogs. It was configured to write to disk but a developer deleted the log file directly causing nginx to keep all the logs in-memory. As the file /var/log/nginx/access.log was deleted from disk using rm it was not visible using du but the file was getting accessed by nginx and hence it was still held open

A: if the mounted disk is a shared folder on a windows machine, then it seems that df will show the size and disk use of the entire windows disk, but du will show only the part of the disk that you have access too. (and is mounted). so in this case the problem must be fixed on the windows machine.

A: I had the same problem that is mentioned in this topic, but in one VPS.
So I have tested everything that is described in this topic but without success.
The solution was a contact for support with our VPS provider who performed a quota recalculation and corrected the space difference of df -h and du-sh /.

A: I ran into this problem on a FreeBSD box today. The issue was that it was an artifact of vi (not vim, not sure if vim would create this problem). The file was consuming space but hadn't fully been written to disk.
You can check that with:
$ fstat -f /path/to/mount/point |sort -nk8 |tail

This looks at all open files and sorts (numerically via -n) by the 8th column (key, -k8), showing the last ten items.
In my case, the final (largest) entry looked like this:
bob      vi         12345    4 /var      97267 -rwx------  1569454080 rw

This meant process (PID) 12345 was consuming 1.46G (the eighth column divided by 1024³) of disk despite the lack of du noticing it.  vi is horrible at viewing extremely large files; even 100MB is large for it. 1.5G (or however large that file actually was) is ridiculous.
The solution was to sudo kill -HUP 12345 (if that didn't work, I'd sudo kill 12345 and if that also fails, the dreaded kill -9 would come into play).
Avoid text editors on large files.  Sample workarounds for quick skimming:
Assuming reasonable line lengths:

*

*{ head -n1000 big.log; tail -n1000 big.log } |vim -R -

*wc -l big.log |awk -v n=2000 'NR==FNR{L=$1;next}FNR%int(L/n)==1' - big.log |vim -R -
Assuming unreasonably large line(s):

*

*{ head -c8000 big.log; tail -c8000 big.log } |vim -R -
These use vim -R in place of view because vim is nearly always better ... when it's installed. Feel free to pipe them into view or vi -R instead.
If you're opening such a large file to actually edit it, consider sed or awk or some other programmatic approach.

A: check if your server have ossec agent installed. Or some proccess is using the deleted log files. In my a time ago was ossec agent.

A: In my case lsof did not help. I was able to track this down because I had mounted disk images using losetup as loop devices. Even after unmounting these devices and deleting the corresponding images there were processes that maintained some sort of indirect reference to the disk images.
So in short, sudo ps -ef|grep loop then sudo losetup -d /dev/loopX. This is not a direct answer to why du and df disagree but it has come up often enough for me that I was able to finally figure out the reason why which was different from any answer I could find.

A: check the /lost+found, I had a system (centos 7) and some of file in the /lost+found ate up all the space.


text:
Q: Find rows common in more than two files using awk I have tab delimited text files in which common rows between them are to be found based on columns 1 and 2 as key columns.
Sample files:
file1.txt

aba 0 0
abc 0 1
abd 1 1
xxx 0 0

file2.txt

xyz 0 0
aba 0 0 0 0
xxx 0 0
abc 1 1

file3.txt

xyx 0 0
aba 0 0
aba 0 1 0
xxx 0 0 0 1
abc 1 1

I would like to get rows common in 2 files or 3 files using columns 1 and 2 as key to search. For the common rows based on column 1 and 2 reporting the first occurrence in any file would do the job.
Sample Output for rows common in 2 files:
abc 1 1

Sample output for rows common in 3 files:
 aba 0 0
 xxx 0 0

In real scenario I do have to specify different values for number of files. Can anybody suggest a generalized solution to pass the value for number of files in which it has to be common.
I have this piece of code which looks for rows common in all files.
awk '
FNR == NR {
    arr[$1,$2] = 1
    line[$1,$2] = line[$1,$2] ( line[$1,$2] ? SUBSEP : "" ) $0
    next
}
FNR == 1 { delete found }
{ if ( arr[$1,$2] && ! found[$1,$2] ) { arr[$1,$2]++; found[$1,$2] = 1 } }
END {
    num_files = ARGC -1
    for ( key in arr ) {
        if ( arr[key] < num_files ) { continue }
        split( line[ key ], line_arr, SUBSEP )
        for ( i = 1; i <= length( line_arr ); i++ ) {
            printf "%s\n", line_arr[ i ]
        }
    }
}
' *.txt  > commoninall.txt

A: This should work:
cat file[123].txt | sort | awk 'BEGIN{FS="\t"; V1=""; V2=""}
    {if (V1==$1 && V2==$2) { b=b+1 } else
    { print b":"$0; b=1; V1=$1; V2=$2} }' |grep "2:"|awk '
    BEGIN{FS=":"} {print $2}'

I cat all file in one stream, sort the lines, check if the first two tab seperated colums are equal (if they are then print the line) and then filter out all duplicated lines.
BTW: I took this nice file[123].txt globbing idea from the comment of William Pursell.

A: This should work too
I put all the lines in an array (b) with two first values and accumulate in a the number of repetitions. If number > 1 it will be printed from b which has the last line saved for this pair combination column1/column2
cat *.txt | awk -F" " '{a[$1$2]=a[$1$2]+1; b[$1$2]=$0} END{ for (i in a){if(a[i]>1){print b[i]}}}'
Is it ok too?
EDIT
To show all lines in all files, you need just a little more:
cat *.txt | awk -F" " '{a[$1$2]=a[$1$2]+1; c=a[$1$2]; b[$1$2c]=$0} END{ for (i in a){if(a[i]>1){for(c=1; c<=a[i];++c){print b[i c]}}}}'
Very thanks to  @PeterPaulKiefer for the cat *txt idea


text:
Q: Using Monolog and ReactPHP I'm trying to build my Symfony application on top of ReactPHP engine, and everything goes fine, but the logs.
I have my application configured with a regular file log under devel environment, and a simple syslog log with level=error under production. In both environments I have "debug" enabled, otherwise even without ReactPHP and using a simple Apache, I cannot see any error in syslog.
The problem comes when I use ReactPHP. Initializing the symfony kernel using devel environment, everything is logged BUT the exception. It seems that I'm doing something wrong because Monolog is not handling the exception and any error is being logged.

*

*Do you know any part of the Symfony application initialization where all this handlers are enabled (and I should add it as well in the kernel initialization in my ReactPHP file)?

*If not, then... Symfony should work the same way under ReactPHP, right? I mean, the kernel should always handle any error/exception and log it the way I configured in MonologBundle, and after that, throw the exception again, right?

A: This is just a guess, but maybe your error gets usually logged via PHP's  set_exception_handler(), while ReactPHP will catch uncaught exceptions inside its request handler to ensure the server stays up and running and doesn't die for every uncaught exception.


text:
Q: Cache one large object and read from cache fast for flask I tried flask-cache to cache an object(about 800MB) like this:
@cache.memoize(50000)
def get_nmf_result():
    return NMF_Recommendation(basis_path = app.config['BASIS_PATH'],
                              coef_path = app.config['COEF_PATH'],
                              mask_path = app.config['MASK_PATH'])

But I found that (1) It takes quite a long time to do the caching
(2) Even I cached it, it still need quite a while to read from the cache. Does that mean when I read the cache, actually I'm getting a copyinstead of reference of the cache?
Does anyone have ideas about quick storing and reading for cache? Thanks!

A: Flask-Cache uses the Werkzeug cache, which uses the pickling library to serialize any cache values to a binary blob, so the value can be saved in any backend. Pickling and unpickling a 800MB object could take quite some time, especially if it's not just one big string or something "simple" like that.
At this point, i think it's better to write your own cache, tailored to the backend you use and the type of data you store.


text:
Q: Why does localhost:5000 not work in Flask? I'm using flask app factory pattern like and have this run.py file:
from app import create_app

app = create_app()

if __name__ == '__main__':
    app.run(host='localhost', debug=True)

Then I run the app like this:
python run.py

But when I go to http://localhost:5000 it doesn't work.
It says:

Not Found
The requested URL was not found on the server. If you entered the URL
  manually please check your spelling and try again.

What could be wrong? it works well when I have 127.0.0.1 address...
I need to run on "localhost" because I'm integrating square payments and their sandbox setup requires I make requests to their API from a 'localhost'.
Also, when I make the request in the browser, on the terminal when flask responds there is this:
127.0.0.1 - - [09/Sep/2017 00:30:45] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2017 00:30:45] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2017 00:30:45] "GET /favicon.ico HTTP/1.1" 404 -

So it looks like request reaches flask but flask returns 404.
Here is part of my init.py file:
# from __future__ import print_function

# import flask
from flask import Flask, render_template, url_for, redirect, flash, request, \
    session, current_app, abort
import os
# flask sqlaclhemy
from sqlalchemy import func, desc, asc, or_, and_

from flask_admin import Admin, AdminIndexView
from flask_admin.contrib.sqla import ModelView

# Flask secrutiy
from flask_security import (Security, SQLAlchemyUserDatastore,
    login_required, current_user)
from flask_login import LoginManager
from flask_mail import Mail

# square connect setup
import uuid
import squareconnect
from squareconnect.rest import ApiException
# from squareconnect.apis.locations_api import LocationsApi
from squareconnect.apis.transactions_api import TransactionsApi

mail = Mail()

class CustomAdminIndexView(AdminIndexView):
    def is_accessible(self):
        return current_user.is_authenticated and current_user.has_role('admin')

def create_app():
    app = Flask(__name__)
    app.config.from_object(os.environ['APP_SETTINGS'])
    mail.init_app(app)
    from models import db, User, Role
    db.init_app(app)

    user_datastore = SQLAlchemyUserDatastore(db, User, Role)
    security = Security(app, user_datastore)

    @app.route('/')
    def home():
        return render_template('home.html')

    return app

A: the simple alternative solution is first to check if the port 5000 is avialable you can check that with this comand :
netstat -lat

find more about available port here :
if you are not obliged to use port 5000 you can try anything else you want ..
if every thing is ok that mean you have a problem with your home page , you don't have a route to '/' , that why you are getting the 404 error when you go to localhost:5000/ :
so to correct it you have 3 solution :

*

*add the app.route('/') in your init.py  file

*add it directly in your run.py after creating the app (not a good way)

*try to use blueprints
as you didn't provide your init.py code  let add it to your run.py ,
from app import create_app
app = create_app()
@app.route('/')
def homepage():
    return 'hello world'
if __name__ == '__main__':
    app.run(host='localhost', port=9874)

another solution as suggest in comment is to check if 127.0.0.1 resolve to localhost find the host file by typing this command and check if you have the same line as mine :
nano /etc/hosts

and open the file :
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

A: Just incase anyone on a mac runs into this issue and has trouble finding any answers (like me), I just discovered that it's because Apple Airplay Receiver runs on port 5000.  Disable airplay receiver and try again.

A: there will be no entry as localhost in your hosts file
example host file
127.0.0.1       localhost

you can check  your hosts file in following ways
for linux
sudo vi /etc/hosts

for windows
open this file C:\Windows\System32\Drivers\etc\hosts

if there is no localhost in your hosts file add and save it.

A: May be you need to install virtual enviroment

pip install virtualenv

does this. Hope this works

A: You should try switching out localhost for 0.0.0.0.
if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)

This has it serve on localhost for me.

A: from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
return "Hello"
if name == "main":
app.run(host='0.0.0.0', port=9874)


text:
Q: Extending a map to a well defined homomorphism Given a map $f: S \rightarrow H$, with $S$ some set of generators, when and how can $f$ be extended to a well defined homomorphism with $\phi : G \rightarrow H $ with $G$ a group generated by $S$ with $\lbrace r_i \rbrace$ a  finite set of relations.
Further what requirements are needed to show that $\phi[G] = H$ and that $\phi$ is an isomorphism.

A: $G$ is the quotient of $F(S)$ the free group generated by $S$ by its normal subgroup $N$ generated by the relation. $f$ induces a morphism $g:F(S)\rightarrow H$, it factors by $G$ if and only if its kernel contains $N$. This is equivalent to saying that  $g(r_i)=1$.


text:
Q: Order RSS feed 301 redirecting When I try visiting the New Order RSS feed, it returns a 301 redirect (url i'm trying is http://{SITE_NAME}.dev/rss/order/new/ - the redirect sends me straight back the root URL of the store http://{SITE_NAME}.dev/nz/
I've got the same thing happening with MageMonkey too (this uses a /monkey/ URL).
The .htaccess i'm using:
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

A: When enabling Add Store Code to Urls under System > Configuration the Admin section might have some issues with that.
I'd advice to turn the option off on the Default Config level only enabling it for the website levels. This way you should be able to call the RSS feed using just the base URL
http://{SITE_NAME}.dev/rss/order/new/

A: I had to add the store code to the URL, and i've updated the redirect to redirect the standard link to a store code URL. So http://{SITE_NAME}.dev/rss/order/new/ will redirect to http://{SITE_NAME}.dev/nz/rss/order/new/ and show the RSS page.


text:
Q: .NET - Project Won't Build I have a WPF/ASP.NET project which I haven't worked on for a while (ResourceBlender.NET - http://resourceblender.codeplex.com/). The project contains a DataLayer and a Core layer, these are both used by the WPF application and ASP.NET project in the solution.
If the WPF project is set as the startup project and I try to build the application, I get "The type or namespace name 'whatever' could not be found (are you missing a using directive or an assembly reference?)".
The error list shows these when I try to build, run or debug, but double clicking and going to the error shows no actual errors in the editor and everything is highlighted as normal.
The ASP.NET project builds fine. I'm absolutely clueless on this one, as there are no obvious errors to fix - could it be metadata somewhere?

A: This type of thing is really hard to debug without being able to see your solution setup, but here are the things I would try:

*

*Expand the references in your WPF project, make sure they are all resolving

*Double-check that none of your references have "specific version" set to True and point to an old/nonexistent version

*Do a "Clean" on your solution, close VS and delete your bin and obj directories, etc. to clear out potentially old copies of dlls that may be messing up your build

Good luck!

A: Try the following:

*

*Right-Click on the solution on do a "Clean Solution"

*Try to build each project separately

*Check the references on your projects for missing assembly references

A: Check that all assemblies does not target the 3.5/4.0 Client Profile (It is probably the WPF application that is the culprit). This will cause exactly the error message you're describing.

A: Compile issues like this can be overwhelming. It's usually best to troubleshoot one project at a time as suggested in these tips:
5 Debugging Tips for a Solution That Won't Compile

A: Actually read the Output window text.
often errors or warnings that are pertinent appear in there but aren't obvious when following the Error List window links.


text:
Q: datasource named different than default causes NPE in DataSourcePool I'm new to the play-framework (which I hope will simplify web-development compared to JSF/seam) and have a problem with a datasource (unfortunately the documentation is not really helpful for this problem):
I will need more than one datasource and therefore the datasource has a different name than "default".
Here is the application.conf:
db.monitoring.driver=org.postgresql.Driver
db.monitoring.url="jdbc:postgresql://localhost/skiline_monitoring"
db.monitoring.user=skiline
db.monitoring.password=skiline

ebean.monitoring="models.monitoring.*"

The model-classes for the monitoring-datasource are located in a package models.monitoring.
The model-class:
@Entity
public class SystemProperty extends Model {
    @Column(length=100)
    public String key;
    @Column(length=1000)
    public String value;

    public static Finder<SystemPropertyKey, SystemProperty> find() {
        return new Finder<SystemPropertyKey, SystemProperty>(SystemPropertyKey.class,
            SystemProperty.class);
    }
}

The first call to SystemProperty.find().all() produces the following exception:
play.api.Application$$anon$1: Execution exception[[RuntimeException: DataSource user is null?]]
    at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.2]
    at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$handle$1$1.apply(PlayDefaultUpstreamHandler.scala:143) [play_2.10.jar:2.1.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$handle$1$1.apply(PlayDefaultUpstreamHandler.scala:139) [play_2.10.jar:2.1.2]
    at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.2]
    at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.2]
java.lang.RuntimeException: DataSource user is null?
    at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.<init>(DataSourcePool.java:184) ~[avaje-ebeanorm-server.jar:na]
    at com.avaje.ebeaninternal.server.lib.sql.DataSourceManager.getDataSource(DataSourceManager.java:200) ~[avaje-ebeanorm-server.jar:na]
    at com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager.getDataSource(DataSourceGlobalManager.java:46) ~[avaje-ebeanorm-server.jar:na]
    at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:432) ~[avaje-ebeanorm-server.jar:na]
    at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:393) ~[avaje-ebeanorm-server.jar:na]
    at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:169) ~[avaje-ebeanorm-server.jar:na]

Adding a file ebean.properties to conf/ directory did not help. That conf/ebean.properties looks like this:
datasource.default=monitoring

datasource.monitoring.username=skiline
datasource.monitoring.password=skiline
datasource.monitoring.databaseUrl=jdbc:postgresql://localhost/skiline_monitoring
datasource.monitoring.databaseDriver=org.postgresql.Driver
datasource.monitoring.minConnections=1
datasource.monitoring.maxConnections=25
datasource.monitoring.heartbeatsql=select 1
datasource.monitoring.isolationlevel=read_committed

Any ideas, what I am missing here (I'm using the latest stable release 2.1.2)?

A: After some debugging I've found the problem:
In case the datasource has a different name than "default", you have to specify the server-name when creating a finder.
So
public static Finder<SystemPropertyKey, SystemProperty> find() {
    return new Finder<SystemPropertyKey, SystemProperty>(SystemPropertyKey.class,
        SystemProperty.class);
}

has to be changed to
public static Finder<SystemPropertyKey, SystemProperty> find() {
    return new Finder<SystemPropertyKey, SystemProperty>("monitoring",
        SystemPropertyKey.class, SystemProperty.class);
}


text:
Q: Why do I need to set a display type for displaying my image on a mobile viewport? I have an image contained within a div. When I used the code below for displaying the image on my desktop, it displayed fine. But when I used the same code for displaying it on a mobile device, the image would not display, unless I added display:block; to both the image and the container div. All the videos and articles I have read for displaying images do not tell me I need to use display:block; so I don't understand why I need to use it for displaying on a mobile. Why is it that I don't need to use display:block for a desktop but I do for a mobile phone?
CSS for desktop view:
.index-image{
width: 100%;
}
.index-image > img{
width:100%;
}

HTML for desktop view:

CSS for mobile view:
.index-image-mobile {
display:block;
width:100%;
}

.index-image-mobile > img{
display:block;
width:100%;
}

.index-image{
display:none;
}

HTML for mobile view:

Thank you


text:
Q: What are these hex characters and where could they have come from? Was helping someone on an app using a jQuery UI datepicker and while testing in different browsers, we noticed a problem in IE 11, at least our version.  For some reason, the date string I was feeding to the datepicker for a new javascript date object wasnt playing nice in IE, but worked fine in Chrome.
Finally after over an hour of restarting the debuggers and starring at the screen I started looking a little closer at the string itself.  Sure enough, I could hit the arrow keys in some positions and the cursor wouldnt move!  Ah Ha!  There were some non-printing characters in there somewhere.
I grabbed the Hex editor plugin for Notepad++ and can compare the "un-molested" string and the version with the "extra something" within it.
See screenshots below.
So can anyone comment on what exactly kind of characters these are and where they might have come from?
Here is the "un-molested" version

Here is the "goofy" version.  Note that when I look at the "displayed" version in a text editor, all I see is "10/14/2016"

Here is the code Im working with.  Its within this function that the variable "DateStart" has the extra characters in it. Note this happens when debugging with IE and Visual Studio 2015.  Now when I launch with Google Chrome and use its debugger, I get expected results - the date is fine and the datepicker opens to the correct date.
 function ConfigPicker() {

            var DateStart =    document.getElementById('FromDate').value;
            var DateEnd = document.getElementById('ToDate').value;

            $("#FromDate").datepicker({ dateFormat: 'mm/dd/yy', defaultDate: new Date(DateStart) });
            $("#ToDate").datepicker({ dateFormat: 'mm/dd/yy', defaultDate: new Date(DateEnd) });
    }

A: You must have copied it from a source that deals with right-to-left text.
The e2 80 8e are 200E  LEFT-TO-RIGHT MARK.
You can easily see that by pasting these hex codes to the UTF-8 code units field and click Convert.
See the symbol description at UniView.


text:
Q: Python implementation of Jenkins Hash? Does there exist a native Python implementation of the Jenkins hash algorithm(s)?
I need a hash algorithm that takes an arbitrary string and turns it into an 32-bit integer. For a given string, it must guarantee to return the same integer across platforms.
I have looked at the ELF hash algorithm, of which I have found a Python implementation. Could this be a suitable replacement given the above criteria? (http://www.partow.net/programming/hashfunctions/#ELFHashFunction)

A: You can just use the first 32 bits of an md5sum
>>> from hashlib import md5
>>> from struct import unpack
>>> unpack("<IIII",md5("thestring").digest())[0]
1515985217

A: Ended up implementing it on my own. Released according to the original copyright notice (see below). Use at your own risk and have fun :-)
'''Implements a straight Jenkins lookup hash - http://burtleburtle.net/bob/hash/doobs.html

Usage:
    from jhash import jhash
    print jhash('My hovercraft is full of eels')

Returns: unsigned 32 bit integer value

Prereqs: None

Tested with Python 2.6.
Version 1.00 - der@dod.no - 23.08.2010

Partly based on the Perl module Digest::JHash
http://search.cpan.org/~shlomif/Digest-JHash-0.06/lib/Digest/JHash.pm

Original copyright notice:
    By Bob Jenkins, 1996.  bob_jenkins@burtleburtle.net.  You may use this
    code any way you wish, private, educational, or commercial.  It's free.

    See http://burtleburtle.net/bob/hash/evahash.html
    Use for hash table lookup, or anything where one collision in 2^^32 is
    acceptable.  Do NOT use for cryptographic purposes.
'''

def mix(a, b, c):
    '''mix() -- mix 3 32-bit values reversibly.
For every delta with one or two bits set, and the deltas of all three
  high bits or all three low bits, whether the original value of a,b,c
  is almost all zero or is uniformly distributed,
* If mix() is run forward or backward, at least 32 bits in a,b,c
  have at least 1/4 probability of changing.
* If mix() is run forward, every bit of c will change between 1/3 and
  2/3 of the time.  (Well, 22/100 and 78/100 for some 2-bit deltas.)'''
    # Need to constrain U32 to only 32 bits using the & 0xffffffff
    # since Python has no native notion of integers limited to 32 bit
    # http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex
    a &= 0xffffffff; b &= 0xffffffff; c &= 0xffffffff
    a -= b; a -= c; a ^= (c>>13); a &= 0xffffffff
    b -= c; b -= a; b ^= (a<<8); b &= 0xffffffff
    c -= a; c -= b; c ^= (b>>13); c &= 0xffffffff
    a -= b; a -= c; a ^= (c>>12); a &= 0xffffffff
    b -= c; b -= a; b ^= (a<<16); b &= 0xffffffff
    c -= a; c -= b; c ^= (b>>5); c &= 0xffffffff
    a -= b; a -= c; a ^= (c>>3); a &= 0xffffffff
    b -= c; b -= a; b ^= (a<<10); b &= 0xffffffff
    c -= a; c -= b; c ^= (b>>15); c &= 0xffffffff
    return a, b, c

def jhash(data, initval = 0):
    '''hash() -- hash a variable-length key into a 32-bit value
  data    : the key (the unaligned variable-length array of bytes)
  initval : can be any 4-byte value, defaults to 0
Returns a 32-bit value.  Every bit of the key affects every bit of
the return value.  Every 1-bit and 2-bit delta achieves avalanche.'''
    length = lenpos = len(data)

    # empty string returns 0
    if length == 0:
        return 0

    # Set up the internal state
    a = b = 0x9e3779b9 # the golden ratio; an arbitrary value
    c = initval        # the previous hash value
    p = 0              # string offset

    # ------------------------- handle most of the key in 12 byte chunks
    while lenpos >= 12:
        a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24))
        b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24))
        c += (ord(data[p+8]) + (ord(data[p+9])<<8) + (ord(data[p+10])<<16) + (ord(data[p+11])<<24))
        a, b, c = mix(a, b, c)
        p += 12
        lenpos -= 12

    # ------------------------- handle the last 11 bytes
    c += length
    if lenpos >= 11: c += ord(data[p+10])<<24
    if lenpos >= 10: c += ord(data[p+9])<<16
    if lenpos >= 9:  c += ord(data[p+8])<<8
    # the first byte of c is reserved for the length
    if lenpos >= 8:  b += ord(data[p+7])<<24
    if lenpos >= 7:  b += ord(data[p+6])<<16
    if lenpos >= 6:  b += ord(data[p+5])<<8
    if lenpos >= 5:  b += ord(data[p+4])
    if lenpos >= 4:  a += ord(data[p+3])<<24
    if lenpos >= 3:  a += ord(data[p+2])<<16
    if lenpos >= 2:  a += ord(data[p+1])<<8
    if lenpos >= 1:  a += ord(data[p+0])
    a, b, c = mix(a, b, c)

    # ------------------------- report the result
    return c

if __name__ == "__main__":
    hashstr = 'My hovercraft is full of eels'
    myhash = jhash(hashstr)
    print 'jhash("%s"): %d' % (hashstr, myhash)

A: a simple implementation form the one_at_a_time hash given at wikipedia. Mind this algorithm has an avalanche behavior.
def getJenkinHash(ba : bytearray):
    hash : int = 0
    for i in range(len(ba)):
        hash += ba[i]
        hash &= 0xFFFFFFFF
        hash += hash << 10
        hash &= 0xFFFFFFFF
        hash ^= hash >> 6
        hash &= 0xFFFFFFFF
    hash += hash << 3
    hash &= 0xFFFFFFFF
    hash ^= hash >> 11
    hash &= 0xFFFFFFFF
    hash += hash << 15
    hash &= 0xFFFFFFFF
    return hash

A: This native python-code should give you the same hash as the original lookup3.c
# Need to constrain U32 to only 32 bits using the & 0xffffffff
# since Python has no native notion of integers limited to 32 bit
# http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex

'''Original copyright notice:
    By Bob Jenkins, 1996.  bob_jenkins@burtleburtle.net.  You may use this
    code any way you wish, private, educational, or commercial.  Its free.
'''

def rot(x,k):
    return (((x)<<(k)) | ((x)>>(32-(k))))

def mix(a, b, c):
    a &= 0xffffffff; b &= 0xffffffff; c &= 0xffffffff
    a -= c; a &= 0xffffffff; a ^= rot(c,4);  a &= 0xffffffff; c += b; c &= 0xffffffff
    b -= a; b &= 0xffffffff; b ^= rot(a,6);  b &= 0xffffffff; a += c; a &= 0xffffffff
    c -= b; c &= 0xffffffff; c ^= rot(b,8);  c &= 0xffffffff; b += a; b &= 0xffffffff
    a -= c; a &= 0xffffffff; a ^= rot(c,16); a &= 0xffffffff; c += b; c &= 0xffffffff
    b -= a; b &= 0xffffffff; b ^= rot(a,19); b &= 0xffffffff; a += c; a &= 0xffffffff
    c -= b; c &= 0xffffffff; c ^= rot(b,4);  c &= 0xffffffff; b += a; b &= 0xffffffff
    return a, b, c

def final(a, b, c):
    a &= 0xffffffff; b &= 0xffffffff; c &= 0xffffffff
    c ^= b; c &= 0xffffffff; c -= rot(b,14); c &= 0xffffffff
    a ^= c; a &= 0xffffffff; a -= rot(c,11); a &= 0xffffffff
    b ^= a; b &= 0xffffffff; b -= rot(a,25); b &= 0xffffffff
    c ^= b; c &= 0xffffffff; c -= rot(b,16); c &= 0xffffffff
    a ^= c; a &= 0xffffffff; a -= rot(c,4);  a &= 0xffffffff
    b ^= a; b &= 0xffffffff; b -= rot(a,14); b &= 0xffffffff
    c ^= b; c &= 0xffffffff; c -= rot(b,24); c &= 0xffffffff
    return a, b, c

def hashlittle2(data, initval = 0, initval2 = 0):
    length = lenpos = len(data)

    a = b = c = (0xdeadbeef + (length) + initval)

    c += initval2; c &= 0xffffffff

    p = 0  # string offset
    while lenpos > 12:
        a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24)); a &= 0xffffffff
        b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); b &= 0xffffffff
        c += (ord(data[p+8]) + (ord(data[p+9])<<8) + (ord(data[p+10])<<16) + (ord(data[p+11])<<24)); c &= 0xffffffff
        a, b, c = mix(a, b, c)
        p += 12
        lenpos -= 12

    if lenpos == 12: c += (ord(data[p+8]) + (ord(data[p+9])<<8) + (ord(data[p+10])<<16) + (ord(data[p+11])<<24)); b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 11: c += (ord(data[p+8]) + (ord(data[p+9])<<8) + (ord(data[p+10])<<16)); b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 10: c += (ord(data[p+8]) + (ord(data[p+9])<<8)); b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 9:  c += (ord(data[p+8])); b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 8:  b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16) + (ord(data[p+7])<<24)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 7:  b += (ord(data[p+4]) + (ord(data[p+5])<<8) + (ord(data[p+6])<<16)); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 6:  b += ((ord(data[p+5])<<8) + ord(data[p+4])); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24))
    if lenpos == 5:  b += (ord(data[p+4])); a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24));
    if lenpos == 4:  a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16) + (ord(data[p+3])<<24))
    if lenpos == 3:  a += (ord(data[p+0]) + (ord(data[p+1])<<8) + (ord(data[p+2])<<16))
    if lenpos == 2:  a += (ord(data[p+0]) + (ord(data[p+1])<<8))
    if lenpos == 1:  a += ord(data[p+0])
    a &= 0xffffffff; b &= 0xffffffff; c &= 0xffffffff
    if lenpos == 0: return c, b

    a, b, c = final(a, b, c)

    return c, b

def hashlittle(data, initval=0):
    c, b = hashlittle2(data, initval, 0)
    return c

if __name__ == "__main__":
    import sys
    hashstr = 'Four score and seven years ago'
    hash, hash2 = hashlittle2(hashstr, 0xdeadbeef, 0xdeadbeef)
    print '"%s": %x %x' % (hashstr, hash, hash2)

    hash = hashlittle(hashstr, 0)
    print '"%s": %x' % (hashstr, hash)

A: There is already a "jenkins" package on PyPi. But it is not "native" as the core implementation is in C.

A: Here a minimal implementation:
def hash(x):
    """ Jenkins Hash 32bits."""
    x = (x + int('7ed55d16', 16)) + (x << 12)
    x = (x ^ int('c761c23c', 16)) ^ (x >> 19)
    x = (x + int('165667b1', 16)) + (x << 5)
    x = (x + int('d3a2646c', 16)) ^ (x << 9)
    x = (x + int('fd7046c5', 16)) + (x << 3)
    x = (x ^ int('b55a4f09', 16)) ^ (x >> 16)
    return x


text:
Q: Is there an implicit mechanism in Newton Raphson method to ensure divide-by-zero never happens? This question is in relation to Newton's Method for optimization.

Is Newton's Method always applicable if the function f is twice
continuously differentiable? Argue with the help of the function
$f(x) = 2x^3 − 5x$ at $x = 0$

For the above question, I had computed the first-order and second-order derivative and set x=0, which triggers a divide-by-zero.
But, is this a case of bad initialization?. Or, is this case bound to happen even during optimization iterations?

A: No, there is nothing that prevents that a Newton step from some random position lands in a zero of the denominator.
Statements to the convergence of the Newton method make usually the assumption that the root is simple, that is, the derivative of the denominator is safely away from zero in a neighborhood of the root. Then division-by-zero is no concern for the convergence analysis.
In the scalar case, the Newton method at multiple roots tends to undershoot, reducing the distance to the root by a factor of $1-\frac1m$ in each step. This again means that the numerator goes faster to zero than the denominator. However, any measure for the acceleration of this process like Aitkens delta-squared process, or modifications of the step length, risk to land very close to the root where the root multiplicity makes the evaluation of the function and its derivatives rather random due to floating point errors.
Multiple roots in the multivariate case can lead to rather interesting patterns, as there will be sectors with linear convergence and others with quadratic convergence towards the sectors with linear convergence. Acceleration of the linear convergence then can land again in the quadratic sectors, leading to a periodic cycle, A. Griewank did some extensive analysis of that in the 1980ies.


text:
Q: How to solve this absolute value equation I have the following integral $$\int_0^{\pi/2} |\sin x-\cos x|dx. $$It's a simple integral but when I try to solve the module I get stuck. I took $\sin x-\cos x>0$ and squaring this I found that $\sin 2x<1$. When I apply $\arcsin$ it would mean $$2x<\frac\pi2 \implies x<\frac\pi4$$ but the interval is wrong from the one in my book. When I apply $\arcsin$ does the sign change? Why?

A: Hint for how to determine the sign of $\sin x - \cos x$:
$$\sin x -\cos  x = \sqrt2\left(\sin x \cos \frac\pi4 - \cos x \sin\frac\pi4\right) = \sqrt2 \sin\left(x-\frac\pi4\right)$$

A: $$
\begin{align}
\int_0^{\pi/2}|\sin(x)-\cos(x)|\,\mathrm{d}x
&=\int_0^{\pi/4}(\cos(x)-\sin(x))\,\mathrm{d}x
+\int_{\pi/4}^{\pi/2}(\sin(x)-\cos(x))\,\mathrm{d}x\tag{1}\\
&=2\int_0^{\pi/4}(\cos(x)-\sin(x))\,\mathrm{d}x\tag{2}\\
&=2\left[\vphantom{\int}\sin(x)+\cos(x)\right]_0^{\pi/4}\tag{3}\\[6pt]
&=2\sqrt2-2\tag{4}
\end{align}
$$
Explanation:
$(1)$: $\cos(x)\ge\sin(x)$ on $\left[0,\frac\pi4\right]$ and $\sin(x)\ge\cos(x)$ on $\left[\frac\pi4,\frac\pi2\right]$
$(2)$: $\cos(x)=\sin\left(\frac\pi2-x\right)$ and $\sin(x)=\cos\left(\frac\pi2-x\right)$
$(3)$: integrate
$(4)$: evaluate

A: The function $\;f(x)=\lvert \sin x-\cos x\rvert\;$ has a symmetry w.r.t. $\frac\pi 4$ since $\;f\bigl(\frac \pi2-x\bigr)=f(x)$, hence
$$\int_0^{\tfrac\pi 2} \lvert\sin x-\cos x\rvert \,\mathrm dx=2\int_0^{\tfrac\pi 4} (\cos x-\sin x) \,\mathrm dx=2(\sin x+\cos x)\biggl\rvert_0^{\tfrac\pi4}=2(\sqrt2-1).$$

A: \begin{align}
\int_0^{\pi/2} |\sin(x)-\cos(x)|dx &= \int_0^{\pi/4} |\sin(x)-\cos(x)|dx+\int^0_{\pi/4} |\sin(x)-\cos(x)|dx\\
&=-\int_0^{\pi/4} \sin(x)-\cos(x)dx+\int_{\pi/4}^{\pi/2} \sin(x)-\cos(x)dx\\
&=..
\end{align}

A: Well, we can use the relation:
$$\sin\left(x\right)-\cos\left(x\right)=-\sqrt{2}\cdot\sin\left(\frac{\pi}{4}-x\right)\tag1$$
So, for the integral we get:
$$\mathscr{I}:=\int_0^\frac{\pi}{2}\left|\sin\left(x\right)-\cos\left(x\right)\right|\space\text{d}x=\int_0^\frac{\pi}{2}\left|-\sqrt{2}\cdot\sin\left(\frac{\pi}{4}-x\right)\right|\space\text{d}x=$$
$$\int_0^\frac{\pi}{2}\left|-\sqrt{2}\right|\cdot\left|\sin\left(\frac{\pi}{4}-x\right)\right|\space\text{d}x=\sqrt{2}\int_0^\frac{\pi}{2}\left|\sin\left(\frac{\pi}{4}-x\right)\right|\space\text{d}x\tag2$$
Now, for the integral we can write:
$$\int_0^\frac{\pi}{2}\left|\sin\left(\frac{\pi}{4}-x\right)\right|\space\text{d}x=\int_0^\frac{\pi}{4}\sin\left(\frac{\pi}{4}-x\right)\space\text{d}x-\int_\frac{\pi}{4}^\frac{\pi}{2}\sin\left(\frac{\pi}{4}-x\right)\space\text{d}x\tag3$$

A: Note that $\sin x-\cos x=\cos x(\tan x-1)$.
$\sin x\le\cos x$ when $x\in[0,\frac{\pi}{4}]$.
$\sin x\ge\cos x$ when $x\in[\frac{\pi}{4},\frac{\pi}{2}]$.
$$\int_0^\frac{\pi}{2}|\sin x-\cos x|dx=\int_0^\frac{\pi}{4}(\cos x-\sin x)dx+\int_\frac{\pi}{4}^\frac{\pi}{2}(\sin x-\cos x)dx$$


text:
Q: How are Error Correcetion Levels Encrypted in QR Code? I'm trying to create my own QR Code Generator library and algorithms.
I made a little research about the steps of creating a QR Code, but got stuck with this ambiguous point.
Error Correction Level are listed as following:

*

*Level L (Low)     7% of data bytes can be restored.

*Level M (Medium)  15% of data bytes can be restored.

*Level Q (Quartile)    25% of data bytes can be restored.

*Level H (High)        30% of data bytes can be restored.

In QR Codes Black = 1 & White = 0

According to Wikipedia this how levels are coded

*

*L : 3 (11 binary) -> (2 Black squares)

*M : 2 (10 binary) -> (1 Black & 1 White)

*Q : 1 (01 binary) -> (1 White & 1 Black)

*H : 0 (00 binary) -> (2 White squares)

According to lots of other Websites & Tutorials this how levels are coded

*

*L : 1 (01 binary) -> (1 White & 1 Black)

*M : 0 (00 binary) -> (2 White squares)

*Q : 3 (11 binary) -> (2 Black squares)

*H : 2 (10 binary) -> (1 Black & 1 White)

Which one do I trust or I have missed a critical step or something to identify that

A: The Answer is BOTH, yes both are correct but are a different phases:

*

*The one in Wikipedia show how the Error Correction Level is displayed on a READY QR CODE (final preview)

*The others show how the Error Correction Level should look like Before MASK

In QR Codes not only Data and error correction are masked, also format strings (15 bits) are masked too but with a particular mask:

The 15 bits format string are XOR-ed with the following 15 bits 101010000010010

So as Error Correction Level is always represented in the first 2 bits it will always be masked (XOR-ed) with these 2 bits 10

So the final result would look like the following:

*

*L : 1 (01 binary) -> 01^10 = 11 -> Becomes 3 (11 binary)

*M : 0 (00 binary) -> 00^10 = 10 -> Becomes 2 (10 binary)

*Q : 3 (11 binary) -> 11^10 = 01 -> Becomes 1 (01 binary)

*H : 2 (10 binary) -> 10^10 = 00 -> Becomes 0 (00 binary)


text:
Q: How to extract sub strings of size 3 that starts with consonant in a string using regex in python? My regex is giving only one sub string. How it should be modified to get all possible sub strings.Regex i wrote is
print re.findall(r'([^aeiou]\w{2})+', 'banana')

o/p: ['ban']
Expected O/p: ['ban', 'nan']


text:
Q: convert an array into individual strings I have the following arrays and I would like to convert each one of them into individual strings. In other words, break the array into individual pieces.
  $formatsArray = $_POST['formats'];
      $topicsArray = $_POST['topics'];

This is because I would like to include the individual strings in the following query "
  $resources = "select * from resources where
                    stage LIKE '%".$stage."%'
                    AND format LIKE '%".$formats."%'";

      $run_query = mysqli_query($con, $resources);

This is because format expect an individual string for comparison, such as lets assume the array is ["video", "blogs", "articles"], it wouldn't work if format was to be compared with video,blogs,articles but rather video, blogs or articles.
I hope this is clear, and for any clarification, please advise.
All the best,
Update:
$formats = explode(',', $formatsArray);
      $topics = explode(',', $topicsArray);

      $resources = "select * from resources where
                    stage LIKE '%".$stage."%'
                    AND format LIKE '%".$formats."%' AND topic LIKE '%".$topics."%' ";

update:
$run_query = mysqli_query($con, $resources);

  while($row = mysqli_fetch_array($run_query)) {

    $data[] = array(
      'format' => $row['format'],
      'title' => $row['title'],
      'costs' => $row['cost'],
      'stage' => $row['stage'],
      'topic' => $row['topic'],
      'link' => $row['link']
    );
  }

Update
  include('db.php');

  $query = 'select * from resources where ';
  $query .= 'stage LIKE :stage and';
  $execute[':stage'] = '%' . $stage . '%';
  if(!empty($_POST['formats'])){
  foreach($_POST['formats'] as $key => $format) {
      $query .= 'format LIKE :format' . $key . ' and ';
      $execute[':format' . $key] = '%' . trim($format) . '%';
  }
  }
  if(!empty($_POST['topics'])){
  foreach($_POST['topics'] as $key => $topic) {
      $query .= 'topic LIKE :topic' . $key . ' and ';
      $execute[':topic' . $key] = '%' . trim($topic)  . '%';
  }
  }
  $query = rtrim($query, ' and ');
  if(!empty($execute)) {
      $stmt = $con->prepare($query);
      $stmt->execute($execute);
  } else {
      echo 'You must search for something';
  }

      while($row = mysqli_fetch_array($query)) {

        $data[] = array(
          'format' => $row['format'],
          'title' => $row['title'],
          'costs' => $row['cost'],
          'stage' => $row['stage'],
          'topic' => $row['topic'],
          'link' => $row['link']
        );
      }

A: Ignoring the necessity of prepared statements, you could do:
  $formats = implode('","', $formatsArray);
  $topics = implode('","', $topicsArray);

  $resources = "select * from resources where
                stage LIKE '%".$stage."%'
                AND format IN(".$formats.") AND topic IN(\"".$topics."\") ";

By adding the " before and after each , when you implode each array, your array would become e.g.
video","blogs","articles

So, we need to add the " to the beginning and end of each IN list. This will make the final query like:
select * from resources where
stage LIKE '%".$stage."%'
AND format IN("video","blogs","articles") AND ...

A: I think this would do it. This also will resolve the injection hole by using prepared statements.
$query = 'select * from resources where ';
if(!empty($_POST['formats'])){
foreach($_POST['formats'] as $key => $format) {
    $query .= 'stage LIKE :stage' . $key . ' or ';
    $execute[':stage' . $key] = '%' . trim($format) . '%';
}
}
if(!empty($_POST['topics'])){
foreach($_POST['topics'] as $key => $topic) {
    $query .= 'topic LIKE :topic' . $key . ' or ';
    $execute[':topic' . $key] = '%' . trim($topic)  . '%';
}
}
$query = rtrim($query, ' or ');
if(!empty($execute)) {
    echo $query;
    print_r($execute);
    //$stmt = $mysqli->prepare($query);
    //$stmt->execute($execute);
} else {
    echo 'You must search for something';
}

Gives you a query of

select * from resources where stage LIKE :stage0 or stage LIKE :stage1 or topic LIKE :topic0 or topic LIKE :topic1 or topic LIKE :topic2 or topic LIKE :topic3

and bound values of:
Array
(
    [:stage0] => %test%
    [:stage1] => %test1%
    [:topic0] => %value1%
    [:topic1] => %value2%
    [:topic2] => %value3%
    [:topic3] => %value4%
)

Here's the initial code I had for when I thought the data was paired..
foreach($formats as $key => $format) {
    $topic = $topics[$key];
    $query .= '(stage LIKE :stage' . $key . ' and topic LIKE :topic' . $key . ') or ';
    $execute[':stage' . $key] = '%' . trim($format) . '%';
    $execute[':topic' . $key] = '%' . trim($topic)  . '%';
}

A few links on prepared statements:
http://php.net/manual/en/mysqli.quickstart.prepared-statements.php
http://php.net/manual/en/mysqli.prepare.php
http://php.net/manual/en/mysqli-stmt.execute.php


text:
Q: Handling abstract action in a JTextField I have a JTextField that has an abstract action, which tests to see when I type in the enter key:
static Action action = new AbstractAction(){
    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("done");
        textWindow.append(textInput.getText());
        inputEarly = textInput.getText();
        hasInput = true;
        textInput.setText("");
    }
};

And I have a while loop which is waiting to see if the enter key has been pressed, by waiting until the variable hasInput = true, however every time the enter key is pressed and the action works, I know this because I have it print out "done" in the console, it never breaks from the while(true) loop that I have got running below it:
while(true) {
        textWindow.append("localhost " + getDateTime() + " > ");
        while(true) {
            if(hasInput) {
                System.out.println("works");
                input = inputEarly;
                hasInput = false;
                break;
            }
        }

hasInput is declared:
public class Main_Menu extends JFrame{

    static Boolean hasInput = false;

Is there a reason why it won't work?


text:
Q: Very weird error 401? I am receiving a 401 error I am not anticipating. I am 100% sure the password and usernamne is correct. When I try the it on postman it works, and I get the data I expect. But in this code, the .downloadstring() method returns a 401 error. I created a new harvest account and tried get to that one with the same code, just changed the password and username and I got the API data I wanted. Is there any other reason then wrong password or username error 401 can be cached?
public List<Project> GetAllProjects()
{
    uri = "https://bruh.harvestapp.com/projects";
    jsonPath = Path.Combine(HostingEnvironment.MapPath("~/App_Data"), "projects.json");

    using (WebClient webClient = new WebClient())
    {
        webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
        webClient.Headers[HttpRequestHeader.Accept] = "application/json";
        webClient.Headers[HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword));

        string response = webClient.DownloadString(uri);

        projectsList = JsonConvert.DeserializeObject<List<Wrapper>>(response).Select(p => p.project).ToList();
    }

    return projectsList;
}

A: According to this C# code sample from harvest, there are a few things that need to be changed:
static void Main(string[] args)
{
  HttpWebRequest request;
  HttpWebResponse response = null;
  StreamReader reader;
  StringBuilder sbSource;
  // 1. Set some variables specific to your account.
  string uri = "https://yoursubdomain.harvestapp.com/projects";
  string username="youremail@somewhere.com";
  string password="yourharvestpassword";
  string usernamePassword = username + ":" + password;

  ServicePointManager.ServerCertificateValidationCallback = Validator;

try
  {
     request = WebRequest.Create(uri) as HttpWebRequest;
     request.MaximumAutomaticRedirections = 1;
     request.AllowAutoRedirect = true;

     // 2. It's important that both the Accept and ContentType headers are
     // set in order for this to be interpreted as an API request.
     request.Accept = "application/xml";
     request.ContentType = "application/xml";
     request.UserAgent = "harvest_api_sample.cs";
     // 3. Add the Basic Authentication header with username/password string.
     request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword)));

     using (response = request.GetResponse() as HttpWebResponse)
     {
        if (request.HaveResponse == true && response != null)
        {
           reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
           sbSource = new StringBuilder(reader.ReadToEnd());
           // 4. Print out the XML of all projects for this account.
           Console.WriteLine(sbSource.ToString());
        }
     }
  }


text:
Q: How to properly deploy Ember.js App to Azure App Service using Azure CI/CD Pipeline? I have a simple Ember.js single page web application that was created using this Ember.js tutorial (finished part 1 & 2):
Ember.js Tutorial
I am now trying to get familiar with Azure CI/CD pipelines by first creating an Azure DevOps Git Repo for the application, then a Build pipeline that is triggered by a push to the Git Repo, and finally a Release pipeline to publish the site to an Azure App Service after the build has succeeded.
The build and release pipelines both succeed, but when I visit the site, it shows a blank node.js page:

Can someone help me figure out where I went wrong here? My guess is it has to do with something in the configuration of the build and/or the release pipeline. Just can't seem to find what specific part is not correct. Any help is much appreciated. I can provide more information if needed :)
Here are my configurations for the build pipeline

*

*YAML code for build pipeline

    # Build a general Node.js project with npm.
    # Add steps that analyze code, save build artifacts, deploy, and more:
    # https://learn.microsoft.com/azure/devops/pipelines/languages/javascript

    trigger:
    - master

    pool:
      vmImage: ubuntu-latest

    steps:
    - task: NodeTool@0
      inputs:
        versionSpec: '6.x'
        checkLatest: true

    - task: Npm@1
      inputs:
        command: 'install'
        workingDir: 'app/'

    - task: ArchiveFiles@2
      inputs:
        rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
        includeRootFolder: true
        archiveType: 'zip'
        archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
        replaceExistingArchive: true

    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'drop'
        publishLocation: 'Container'

Here is the configuration in the Release Pipeline

*Artifact Configuration

*Continuous deployment configuration

*Stage 1: Deployment Process

*Agent Job

*YAML for Deploying to Azure App Service

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Deploy Azure App Service'
  inputs:
    azureSubscription: '$(Parameters.ConnectedServiceName)'
    appType: '$(Parameters.WebAppKind)'
    WebAppName: '$(Parameters.WebAppName)'
    RuntimeStack: 'NODE|14-lts'
    StartupCommand: '$(Parameters.StartupCommand)'
    WebConfigParameters: '-Handler iisnode -NodeStartFile server.js -appType node'
    AppSettings: '-WEBSITE_NODE_DEFAULT_VERSION 6.9.1'

I would also like to mention that the Azure App Service stack setting is Node 14 and is running on linux.
Thanks!


text:
Q: How to put together two application.yml configs of two projects? I have two projects. One is just a client¹ that does http request to an external service. The other is a Rest API.
The client¹ reads an url configured in its own application.yml, but when I add a dependency (through pom.xml) to this client in the Rest API project, it no longer reads that property (it is null).
I want it to read from its own application.yml, so that I have a default value (that can be overridden later if necessary). How can I do that?

¹ The client is defined like this:
@Component
@ConfigurationProperties("app.client.notification")
public class NotificationClient {
    private String url; // comes from application.yml.
                        // Works fine in the client project,
                        // and DOESN'T in the Rest project
}

A: You need to explicitly define the location of that .yml file somewhere in the code a'la @PropertySource("classpath:/application.yml"). I don't know about naming conflicts though, you need to experiment with it yourself.


text:
Q: Avoiding binding in Render while maintaining context from Parent Component I currently have (TableHeader component) table headers being rendered with onClick handlers which, when fired, capture the value of the header and set state in the Parent component (Parent is a Table component, child is TableHeader).
I want to avoid binding the onClick function within TableHeader's render method while still maintaining access to the Parent component's context. Currently what I have:
render() {
  return (
  ...

      {columns.map(col => {col}	)}

  )
}

The function being passed to each th is just taking the value of the column and sorting accordingly.
In the parent component's constructor, that function is bound:
this.sortColumns = this.sortColumns.bind(this);

Then passed:
<TableHeader onClick={this.sortColumns} />

A: Change sortColumns() to take the col variable as a parameter. And then update render() to pass the variable.
render() {
  return (
   ...

     {columns.map(col => {col}	)}

   )
}


text:
Q: Swift Package Manager: Exclude from Release Let's say that I only wanted to link https://github.com/pmusolino/Wormholy to my iOS app on non-RELEASE configurations using SPM.
Is there a way to do this?

A: *

*Make Link optional

*Update the EXCLUDED_SOURCE_FILE_NAMES for Release to exclude the framework, e.g. Wormholy*