Posts

Showing posts from June 27, 2018

Deploying Qt QML Compiled Executable

So I have a simple app that uses QML for my graphical interface and c++ code for some of the logic. I was looking for a method to compile the QML into c++ code and link it into my binary and found this page over at the Qt home site: Basically it says use the resource system for all of my QML graphical interface files and add the QML compiler flag to my qmake config line in my .pro file and everything should be good to go. As far as I know everything compiles fine, but when I use the the Qt windeployqt.exe tool to get all of the dependency files and test it on a clean system, I get a small white screen as if my QML files were not loaded properly. I have one c++ reference to my main QML file using "qrc:/mainqml.qml" and that's it. Any idea what I am doing wrong? You're using the open source version of Qt. It didn't come with the Qt Quick compiler until Qt 5.11 where it is included - and after a rework, too. So it performs better than precompiled QML did in Qt 5.10 a...

Jackson format LocalDate on whole class as strings

I noticed jackson turns LocalDate s to [2018,06,01] which sucks I can annotate a specific variable/method for it to be properly formatted like so: Which is fine but I have several LocalDate s in my class, I'd rather have a single class level annotation, so: Is there an annotation I can use on my class to format them automatically? (I already tried googled but found nothing) Ideally I want something like: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Jet SQL, Order by. Order the column and respective data by keyword

I want to reorder a sheet in excel using an internal SQL query. I have 3 sections of data, say A2:D10, A:11:D20, A21:D30. and I want to order them such that A21:D30 goes first in my spreadsheet. For each of these 3 sections column A is different like so, Stack, Over, Flow . So I would want to change the order to flow, over, stack The logic would be like , but does not work for me. I want to order Column A this way. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

PHP generate rgb color to object based on unique value

Image
I know this has been asked before, but I need a little more help than the other answers on SO provide. I currently have a foreach loop that iterates over records in my DB. Each row contains a unique "id" primary attribute (1,2,3,4,5,etc.). In my loop, I need to generate a UNIQUE RGB value for each record based on its ID. The resulting RGB value will be applied to the HTML element's text bound to that record. The generated color must be unique to the record itself (via "id"), which is why I am not using the loop iterator. I have already created a working function to do this for me, but I need one more thing - I need the rgb value to have a contrast ratio greater than 4:5:1 on a white background. The function I have generates colors that are too bright, making the text hard to read. How can I modify my function to produce darker colors that contrast well on a white background? Maybe this isnt possible... but I'm hoping one of you Math geniuses can help me out ...

How to enable Advanced Google Services via new Cloud Projects?

Image
It seems that Google updated their projects console, and when you go to enable an advanced service in Apps Script it no longer directs you to the auto-generated project for your apps script project. the docs say that a project will be automatically created for apps script projects. Click Cloud Platform Project link here: Which takes you to https://console.developers.google.com/cloud-resource-manager where it asks you to create a project. There is no longer a selection or area to add APIs to the Apps Script project. If I follow that link with an existing Apps Script project that already has working advanced services, it errors out on the project Id. How can Advanced Services be enabled on new Apps Script projects? From the page you ended up on, click the "hamburger" icon/navigation menu, and then in the sidebar at the bottom, click "Google Cloud Platform." Then click the same navigation icon, and from the sidebar menu, choose "APIs and Services" That gets ...

Rank function in MySQL

I am not an expert in MySQL . I need to find out rank of customers. Here I am adding the corresponding ANSI standard SQL query for my requirement. Please help me to convert it to MySQL . Is there any function to find out rank in MySQL? One option is to use a ranking variable, such as the following: The (SELECT @curRank := 0) part allows the variable initialization without requiring a separate SET command. Test case: Result: Here is a generic solution that sorts a table based on a column and assigns rank; rows with ties are assigned same rank (uses an extra variable for this purpose): Note that there are two assignment statements in the second WHEN clause. Sample data: Output: SQL Fiddle While the most upvoted answer ranks, it doesn't partition, You can do a self Join to get the whole thing partitioned also: Use Case Answer : A tweak of Daniel's version to calculate percentile along with rank. Also two people with same marks will get the same rank. Results of the query for a...

How to use local video from the folder instead of a Youtube URL?

I am trying to have a full page video as my website landing page but currently it only allows me to use Youtube URL's and not local videos, this is okay most of the time but there are certain times when the video doesn't load for some reason. The code in the anchor tag below Help if you can please, I just want to use a video from the local folder only rather than a Youtube video as it should be more reliable. Use the <video> tag. Taken from the docs. Granted, the video must exist on the server if you are hosting it. If you have the file stored locally, you can just add a HTML video element: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Column alias instead of technical names

I am wondering if it is somehow possible to assign aliases/nicknames/common names to columns which have technical names rather than "easy to read"-names. Say I have a table, where the columnnames are something like "CD12xxx" and I want to translate that into something readable: Can this only be achieved by creating a view and "renaming" all columns with something like [CD12001] AS Customer_ID - or is there a nice way of doing this? In Teradata I have seen something similar at some point, just wondering if it is possible in SQL-Server? I believe it is SQL-Server 2016 my company is running. Thanks. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Greenplum's pg_dump cannot support lock statement

I'm using pg_dump to backup and recreate a database's structure. To that end I'm calling pg_dump -scf backup.sql for the backup. But it fails with the following error: I couldn't find reference this particular error anywhere. Is it possible to get around this? edit: for a little more context, I ran it in verbose mode, and this is what is displayed before the errors: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

R Segmentation fault (core dumped) on Ubuntu with CTSM

I have install R and the CTSM-R pakage if I try to run the fit command I get: How can I fix this? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Django ORM fastest query to join two models and get a list of paired tuples

Here is how my models.py look like: Now in my views.py I want to have a function like: what I want as output of index function is a list of tuple like [(bar_1, hat_1),(bar_2, hat_2), ...] where for each hat_i we have hat_i.bar == bar_i and if there is no Hat object associated with a bar_i I want it to be paired with None. What's the fastest way that I can build such list in Django? Try This finally, final_list should have required contents. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Docker container with redis runned as daemon doesn't run

I have simple Dockerfile And in my entrypoint I'm setting up some configurational keys and set some data to redis via node: Image builds succesfully, but when I running it - nothing happens. What's the problem? What should I do to run redis in container and make some configuration after? May be the trouble is in that I'm running redis as daemon? Answer from author TL:DR There is a pretty similiar question in Stackoverflow which help to fix my problem: The problem was in that a Docker ENTRYPOINT or CMD should "spawn single process". And I put Redis starting and node init.js execution as different programs into supervisord . Providing supervisord.conf for example: Why did I do that? The main trouble which I have with this issue was with misunderstanding what actually is a Docker container. And what does ENTRYPOINT or CMD in Docker. I thought that I should just "run some server into Docker and expose some port and Docker will do everything with itself...

Missing bean EmbeddedWebApplicationContext when running project

I'm trying to access a webservice from a portlet. I'm pretty new at Spring, so I used this tutorial --> http://spring.io/guides/gs/consuming-web-service/#initial. When I try to run my project following exception is thrown: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. My POM: My main method that I run: And My CustomerDaoConfiguration.class = A full stack trace: Any help would be greatly appreciated! Looks like you missed spring-boot-starter-web . From other side you have a lot of redundant deps in your POM, which can be addressed just with boot-starters. I had the same issue. I found that if I simply used the spring-boot-maven-plugin and started the project with mvn spring-boot:run the problem was solved. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the...

Putting calcuting result into another array

I've an array in object which has 5 elements. With help of for loop I want to select this elements which has less than 50 and multiply them by 0.2. At the end I want to push these results to my empty tipArray but it doesn't work. Can you format your code correctly? It's hard to read. You have to run the function tipValue at least once. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

unable to replace white space in R

I am pasting below output of my head command of a BSE stock data column which I use for R programming practice. I googled and tried almost every trick but I am not able to clear white spaces at the end of these values. It seems that all the strings have fixed width of 12 and after characters I see white space which I am unable to remove. not sure if this will paste in exact same way(e.g. i see a lot of white space after word HDFC in its double quotes) but no technique helped me get rid of those trailing whitespaces. Base R, without regex: trimws stands for "trim white space" . You should be able to fix this with sub and a regular expression. Details: So the sub statement will identify any string of whitespace characters at the end of the string and replace it with the empty string. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that ...

Airflow: what do `airflow webserver`, `airflow scheduler` and `airflow worker` exactly do?

I've been working with Airflow for a while now, which was set up by a colleague. Lately I run into several errors, which require me to more in dept know how to fix certain things within Airflow. I do understand what the 3 processes are, I just don't understand the underlying things that happen when I run them. What exactly happens when I run one of the commands? Can I somewhere see afterwards that they are running? And if I run one of these commands, does this overwrite older webservers/schedulers/workers or add a new one? Moreover, if I for example run airflow webserver , the screen shows some of the things that are happening. Can I simply get out of this by pressing CTRL + C? Because when I do this, it says things like Worker exiting and Shutting down: Master . Does this mean I'm shutting everything down? How else should I get out of the webserver screen then? Each process does what they are built to do while they are running (webserver procide a UI, scheduler determines...

JS/jQuery parentheses error that I can't find

Ok, so here's the function I'm working on, and the let line is giving me this error: SyntaxError: missing ) after argument list If I comment out the line, the code processes just fine, but I can't seem to figure out what the error is in that line. you're using await without the async keyword , The await operator is used to wait for a Promise. It can only be used inside an async function. You are using await without an async context. Try this: For further explanaiton please read this. Assuming that your env supports async/await, your click handler needs to be async to use await. Change To The error you are getting is exactly in await getTaskLogs and to solve it your code should be something like this: You can only have await inside async functions. Is this the line that's causing the error? If so, then there are two possible problems: 1) You're running in an environment that does not support async/await yet (it's a quite new feature to javascript) 2) Or...

Why does my python text search work correctly for some rows in my csv file but not for others?

I wrote a python script that opens and reads a CSV file that has the following structure It then writes a CSV file with the following structure I also have the following python code My script runs, the problem is that it only behaves like expected when reading certain lines of a CSV file. For some reason Python is only able to find the company name that I'm looking for in some of the rows of the CSV file. I'll give a sample input file. This is the output that I'm getting I should be getting a value in the Consolidated Company column for every row of the output file since 'Good Company' shows up in every row of the file. However, what I'm actually seeing is that I'm only getting a value in some of the rows. I haven't been able to figure out why my script works for some of the rows of my input file but fails for other rows of my input file. I would think that my script would either work for everything or fail for everything but it doesn't, why is that?...

New Alexa skill - remove blueprint

I've created one Alexa skill using the fact skill blueprint, and it worked out just fine. However, I'm now trying to create a skill from scratch, and I'm somehow still in the same blueprint. I can't seem to find a way to remove this blueprint, and almost all the help I can find online is from before the 2018 update. Now that I'm in one blueprint, how to I change/remove it? Thanks! By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

wuauclt.exe /updatenow does not install important updates via command line

I am trying to update windows OS using command line - wuauclt.exe /updatenow. But I have to run this everytime after every reboot and it does not install important updates that windows is suggesting. Is their a way to update windows and reboot until it is fully updated via command line? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Unable to use the RouterTestingModule.withRoutes() in angular 2 for unit testing

Here is my app.routing.ts The <router-outlet></router-outlet> is in router.component.ts Please let me know how can I write the unit test for the above code. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

It is about counting no of times “CHEF” is seeing in the input string

Image
Eclipse compiler gives correct answer to a CodeChef's practice code mentioned below but CodeChef's says its a wrong answer. I don't get where the problem is. Please help me find error or mistake in my code. Codechef question's link Question snap: Below is my code: I tried this code in Codechef's Compiler. It gives correct answer, when I submit my code it shows me the below pic: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to find hidden or invisible characters when reading pdf by using PdfBox?

I am new to pdfBox and i am working on a problem trying to read pdf through line by line but i am finding hidden or invisible characters while reading the pdf. This is creating problems in my desired output as the characters visible in the pdf and the characters read as not exactly same with many invisible characters added .I tried the isEmbedded() method but it did not work as those characters were not embedded. If there is a way to find this hidden characters and eliminate them please let me know. (This is my first question on stack overflow ) By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How can I display which column has the latest date?

My employers often have me run reports directly off of our databases, and I seem to have run into a snag on one of them. I need to find out whether a claim is logged in or out of our system and we have 2 different columns (Log_In_Date and Log_MAIL_Date) in the table that tracks our claims (Claimlog) for part of a report that I am generating. I originally used a case statement: This worked for the most part, but I've run into some duplicate results with both "In" and "Out" returns. After doing some research, I adjusted the query to: to account for null values. Unfortunately, I'm still getting the return of both In and Out for the same entries: LOG_DEALER LOG_CLAIM LoggedInStatus 04839 239831 In 04839 239831 Out 01563-5 387468 Out I've tried replacing COALESCE with NOTNULL and rewriting the select statement as: Still no luck getting the results. Does anyone have any suggestions on how to properly query this?...

How to trigger a functionality after RabbitMQ retry max attempts are over? (Spring Integration - RabbitMQ Listener)

I want to trigger an email, after RabbitMQ Listener retrials are over and still if the process of handle failed. retry logic is working with below code. But how to trigger the functionality (email trigger) once the max retrial attempts are over. Adding with code of CustomeRecover That's exactly what a .recoverer() in that RetryInterceptorBuilder is for. You use there now a RejectAndDontRequeueRecoverer , but no body stops you to implement your own MessageRecoverer with the delegation to the RejectAndDontRequeueRecoverer and sending a message to some MessageChannel with a sending emails logic. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Redirect URL's from subfolder to root directory

All the files and subfolders that used to make up our old Flash website do not exist anymore and so the URL paths to all the pages are broken. We could use help writing a Redirect for specific URL's as well as catch all rewrite rule for subfolders to redirect to the base domain / URL. ex.) Specific URLs Any file path or image/asset or page url within these subfolders redirect to root domain New site is built with the latest version of Wordpress / Apache / PHP EDIT Current .htaccess code The below .htaccess rewrite rule will work for you The online working code for the same is at .htaccess tester The above code will Redirect specific url's like below to root domain Redirect particular subfolders like below to room domain You can use "https://wordpress.org/plugins/simple-301-redirects/" Simple 301 Redirects plugin for the same. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of se...

Speed up Delete rows between dates based on cells in another sheet

I have a routine that works but seems to take long. Basically I want to delete any row in the sheet "data" column C that does not fall in the range of the two dates I input in sheet "Dashboard" start date H13 and end date H14 Use an autofilter to identify the rows to remove. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Understanding Why Count on MongoDB View is So Slow

I am trying to understand why running a count on my MongoDB view takes so long to perform, and if there are things I can do to speed it up. It looks like this: I am passing filter params in as the param "search" within find() , and then running the count . The target collection of this view has about a half million docs, though the view matches to only about 8,000 of those. In the view I am matching on an indexed field from the targeted collection in stage 1 of my aggregation pipeline - that's what takes me down to 8,000 or so documents. Now, because the count on the much larger target collection uses meta data, it comes back really quickly - in about 240ms. But the count on the view takes over 6 seconds to return, on, as I say, a much smaller data set. Even with the find(search) segment taken out, it still takes over 6 seconds for the count to complete. By the way, I also tried: ... with the same result. And according to the docs, db.orders.count() is equivalent to db...

Google chrome: how to display full text when the mouse hovers over a table cell

Image
Expected behavior I have a table on my web page. In some table cells, it has long text and I set these css for td label. When the text is longer than the table cell's width, it will be hidden. I want when the mouse hovers over these table cells, the full text appears. Current behavior For safari , when the mouse hovers over the table cell who has long text, the full text appears. For google chrome , there is no reaction when the mouse hovers over it. Question How google chrome can display the full text like safari? Any suggestions or ideas will be welcomed. You could use title attribute: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Placing text in a particular shape using css

I am trying to make a website where there is text that sits over an image. I can get this to work so far but I need the text to be in a particular shape so that it doesn't go over the edge of the border This is like the shape that I will use By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

color in ggplot2 legend not matching figure [duplicate]

Image
This question already has an answer here: I have a problem getting the legend in ggplot2 to correspond to the color in the figure. And I have extra variables in the legend. I have read many posts on similar issues but unfortunately I have not been able to apply those to this situation - successfully at least. I tried using "fill" and "scale_fill_manual()", "theme()" and several others, but to no avail yet. Hopefully I am just missing something simple here, I appreciate any suggestions! I am making a map and my code right now is: The plot looks like this: This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

How does the Mapbox geocoder.reverseQuery work?

is there an example on how to use the Mapbox reverse query. I found an example on the geocoder.query, but I can't seem to find a working example for the reverse query. The following example converts an address to lat long, I want to learn how to use the reverse query to convert a lat long to an address. The reverse query takes an input [lon, lat], but I'm not sure how to get and display the result as an address. https://www.mapbox.com/mapbox.js/api/v3.1.1/l-mapbox-geocoder/ By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

React Select multiline labels

Is there a way to have a multiline label using react-select or to have two labels for one option? I pass the the select component options with a value and label I've tried inserting a line break, but the text remains on one line in the select input. I'm looking for a solution to have two lines for each option. You could keep the n line break and add white-space: pre-wrap to the label: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Javascript remove previous error message when formset is created

So I am creating a formset with Django and I do validation with clean_variable_name in my forms.py. My problem is when I add to create another form, it will give me the empty form with error message previous form generated. I would like to have reset error message .. I got JS file from the library,, I don't entirely understand the code. Can you also explain it to me if possible? forms.py HTML JavaScript This is the first picture on submit button it gives me the validation error message This is the second form when I add another form the error message comes along on the second added form instead of just blank form By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Swift - If Statement Won't Run

My if statement won't run. I don't know why it won't run. Expected: The Button will get the email and password and send a request to the url. If the email and password are valid, it will display the email. If the email is equal to the HTTP body, then it will redirect to the LoggedOn Storyboard. What's happening: The Button will get the email and password and send a request to the url. If the email and password are valid, it will display the email. If the email is equal to the HTTP body, it does nothing. The Storyboard is not connected to the LoggedOn Storyboard. I don't know if it needs to be or not. Could someone please help me figure out whats going on? This line: You say that LoggedOnViewController belongs to the LoggedOn storyboard, so you should have put: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continue...

How to save response data to CSV file that i am generating in Simple Data Writer in JMeter

Image
I am executing one Thread Group which have multiple Http Request. And I am capturing the the Error result into a CSV file using Simple Data Writer. But unable to add the response data to the same file. Can you guys please let me know how i can add the response data to this CSV file or is there any other way that we can use for this purpose? Use simple data writer but change the option to produce XML. Remove CSV and select "Save as XML". There is a option to "Save Response Data(XML)" that is what you require as shown below. Put the result file output format as ".jtl" and open it in the Excel to see the results. You don't even need to Simple Data Writer for this, it can be done by amending JMeter Results File Configuration: Add the next lines to user.properties file (lives in "bin" folder of your JMeter installation) Next time when you run JMeter in command-line non-GUI mode like response data for failed samplers will be added to the results.j...

ViewModel object type properties in a collection are null on POST

Image
I have a View that renders inputs for custom field types. These are dynamic and configured by admins, each custom field can be an int , DateTime , bool , etc. Because of this I store CustomField values as object and back them by a sql_variant column type in SQL Server. The ViewModel for this View contains a collection of CustomFields : These are rendered in my View using a for loop: These do get posted back to the controller action: But the Value property of each CustomField is null, all other properties are populated correctly. Edit: It appears to indeed be caused by binding to a property of type object . If I change the Value property in CustomFieldViewModel to string the property is set correctly in the controller action on Post. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these p...

Vba code to split cells based on parenthesis and spaces before and after parenthesis

Image
I have an excel file that has some cells with several text in parenthesis and outside parenthesis. I would like to split the cells. For example , I have some cells appearing like this (some text in) parenthesis and (others outside) I would to split the cells so that the some text in is in a different cell, parenthesis and also in a different cell and others outside also in a different cell. What I have so far only splits what's in parenthesis. Thanks in advance. Here's my code below I found a pattern that works. (I cheat, and use Replace() , but it seems to do the trick): By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Why can't a static initialization expression in C use an element of a constant array? [on hold]

The following (admittedly contrived) C program fails to compile: When compiling the above C source file with gcc (or Microsoft's CL.EXE), I get the following error: Such simple and intuitive syntax is certainly useful, so this seems like it should be legal, but clearly it is not. Surely I am not the only person frustrated with this apparently silly limitation. I don't understand why this is disallowed-- what problem is the C language trying to avoid by making this useful syntax illegal? It seems like it may have something to do with the way a compiler generates the assembly code for the initialization, because if you remove the "static" keyword (such that the variable "x" is on the stack), then it compiles fine. However, another strange thing is that it compiles fine in C++ (even with the static keyword), but not in C. So, the C++ compiler seems capable of generating the necessary assembly code to perform such an initialization. Edit: Credit to Davislor--...

JDBC DatabaseMetaData getProcedureColumns associated table names with columns

I am using JDBC DatabaseMetaData getProcedureColumns to get columns associated with the database stored procedures. Is there a way to augment the columns with their original source table as well? Here is the working code for the column information. Example Output By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How can I reset achievements from Google Game Services?

I'm testing my game using Google's new Games Services, and I'd like to reset my account's achievements for testing. I've found that you can reset achievements using google's APIs (https://developers.google.com/games/services/management/api/#Achievements) and I'm using the OAuth 2.0 playground to send the POST request, but it's not working :( Specifically, I'm a sending POST request for "https://www.googleapis.com/games/v1management/achievements/reset" as detailed in that link. AND, when I go to code.google com and check my Services, all the Play services are "ON". Here is the output. How can I reset my achievements for testing? Am I even close? Apparently my "access is not configured" How do I do that? What was the point of the whole first 2 steps of the OAuth2.0 playground if not to grant my access? This is how I got it to work: Open the Google Play Developer Console, go to Linked Apps under Game Services and click Link...

WebService response throwing SAXParser Exception

I am getting the following error.I am requesting some WebService and receiving response in the form of json. I get 300 json files in a single webresponse.Its difficult to figure out which particular json is creating problem.Error happens after There is no peculiar special Character with the input json. WebService is expecting XML and you are passing JSON. Read API documentation how to provide the request in JSON, not XML. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Implement Python tkinter zoom with turtle and single/double click

I am trying to draw turtle in canvas and I am also trying to implement zoom in zoom out feature with single click and double click event. When I am not trying to implement tkinter the code works absolutely fine but when I am trying to perform zoom in zoom out feature, I am unable to execute it. I would greatly appreciate any suggestions or help. Here is my code: Thank you. Your program seems incomplete and structured incorrectly. Below is my minimalist example of what I believe you're trying to do. It draws a circle and then lets you use the mouse wheel to zoom it in and out: Note that certain turtle elements, like dot() and text generated with write() won't zoom, they'll remain fixed. You'll need to read about the .scale() method, and go deeper into tkinter, to potentially work around this. Or manually scale your fonts yourself. By clicking "Post Your Answer", you acknowledge that you have read our updated te...

how do I create an HTML table with fixed/frozen left column and scrollable body?

How do I create an HTML table with fixed/frozen left column and scrollable body? I need a simple solution. I know it's similar to some other questions, like: But I need just a single left column to be frozen and I would prefer a simple and script-less solution. If you want a table where only the columns scroll horizontally, you can position: absolute the first column (and specify its width explicitly), and then wrap the entire table in an overflow-x: scroll block. Don't bother trying this in IE7, however... Relevant HTML & CSS: Fiddle This is an interesting jQuery plugin that creates fixed headers and/or columns . Toggle fixed column to be true on the demo page to see it in action. In case of fixed width left column the best solution is provided by Eamon Nerbonne. In case of variable width left column the best solution I found is to make two identical tables and push one above another. Demo: http://jsfiddle.net/xG5QH/6/. FWIW, here is a table that is scrollable with t...

Getting Hub Context for ASPNet.Core Signal-R (.NET Core 2.1) RC

I'm using ASP.NET Core 2.1 RC1. I'm also using Signal-R for it (found here): https://docs.microsoft.com/en-us/aspnet/core/signalr/javascript-client?view=aspnetcore-2.1 I'm creating a .NET Core console application that's hosting Kestrel and using Signal-R. I've pretty much set it up exactly as the getting started documentation states for setting up the Startup. This all works great. I'm able to connect to the it, get my HTML with signal-R script in it, receive messages I crafted with Clients.All.SendAsync. Works great. BUT I want to be able to send a message to clients, from outside the Hub. Where some event happens in my application, and a message is sent to clients. In full .NET, I'd use the GlobalHost and get the context. In ALL my searches on Stack Overflow, they reference something that no longer works, or used within an REST API controller that's passed in the IHubContext. I have an event listener in my program.cs, and when the event...

Unity3D: Freezes in simple 2D game [on hold]

I have simple 2D game on Unity3D. In Unity it's okay, but then I start it on smartphone, I have non-smooth motion and freezes. (objects do not fall smoothly, the bird does not move smoothly, text in left corner more smaller then in unity editor) Code (GitHub) P.S. My phone: Xiaomi Redmi 5 Plus 3/32 This question appears to be off-topic. The users who voted to close gave this specific reason:

How to use Collections.sort () in java? [on hold]

I have the simple class - Person. } I cread the list of person range from 10 to 20 years old. Now, I would like to sort the list using Collections.sort() method, but I don't understand how this works. Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. Your Comparator is wrong. Try this: or Think about the contract for Comparator. It returns an int, not boolean. Generally in your @Override implementation of the compare() function, you will want something that returns -1, 0, or 1 (generally an int). So, in this case you would want something like this: This will order Person a1 and Person a2 based on age. Depending on the order you want (ascending vs descending) you can do the comparison as a2.GetAge()...

SQL Concat Rows if duplicate ID

Is there a way to concat rows if there are duplicate IDs? For example If I were to GROUP BY ROOM_ID I would lose the information in Line 2. So is there a way to get the following results: Thanks If you have only a handful of lines, then conditional aggregation might be the easiest method: Note that this does not generalize very well, but it works quite effectively for two or three addresses. You can do something similar with left join : By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

jquery - mouseover/mouse leave - overlayer blink

I have a minor problem with blink overlayer under menu. jsfiddle what I want: after menu item is hover -> append overlayer with fade effect if is item change (link 1 -> link 2) - overlayer is still open without blink "effect" if mouse leave element, overlayer have been remove (ideally with fadeout, but this is my dream for today) I would be very grateful if any good soul can help me. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

I have been using following code but what does it mean in javascript?

I have been using these lines in my projects but i do not know what does it exactly means, can anyone please tell me what does it mean exactly. That declares myObject on the global scope. If it was existing before it takes the existing value, or if it is not existing it assigns it to a new empty object (Read on). This is a common technique if multiple scripts assign properties of the same object, so that it doesn't matter which script got executed first they will always end up with the same result. Thats an IIFE were the context gets myObject , that allows you to write to the object easily with The IIFE also makes sure that your variables that you declared inside the function, e.g.: are not part of the global scope, so they are not polluting the global namespace. Notice that inside the IIFE you can access myObject as you wish. See in the below snippet how the printed object is the one created with a key custom and a value associated value . ...

SQL Loop Count of people in program during specified duration

I'm not sure if there should be a loop for this or what the easiest approach would be. My data consists of a list of people participating in our program. They have various start and end dates, but the following equation is able to capture the number of people who participated on a specific date: Is there a way I can loop in different date values to get the number of program participants each day for an entire year? Multiple years? One simple way is to use a CTE to generate the dates and then a left join to bring in the data. For instance, the following gets the counts as of the first of the month for this year: Note that this will work best for a handful of dates. If you want more than 100, you need to add option (maxrecursion 0) to the end of the query. Also, count(people) is highly suspicious. Perhaps you mean sum(people) or something similar. By clicking "Post Your Answer", you acknowledge that you have read our update...

nText and String manipulation. SQL Server

Parent question- Thanks to Paul White and Tom V for the answer. I am making little modification's to Paul White's answer to suit my requirements. I would like to change the following to replace a string instead of inserting: Column value: Expected result: Current result: This is the closest to the solution I can get. But this is not working! This is the error I am getting: Incorrect syntax near '@length'. (Line 10) I have updated as given below to update all instances of the matching string Column value: Expected result: Current result: Please help with the following: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to add new elements to an array without overwriting the first one?

I'm trying to add new elements to an Array but it keeps overwriting it the first element, i'm not sure if i'm doing it correctly, but this is my code: push method is ok for you. It will add elements at the end of the array. If you have data already setted in your array, then remove this.nArray = because this is creating a new empty array, deleting all previous data stored in nArray variable. In any case, if you want to add elements at the beginning try unshift : this.nArray.unshift(this.data); . If you push data inside nArray you will get an array of array of objects. Maybe you are looking to add only the elements in data and not the whole array. Use concat method for that. this.nArray.push(this.nArray.concat(data)); Or a shorten syntax using spread operator ... : this.nArray.push(...data); NOTE : I'd recommend you to use const for your array definition and remove the blank assignment of in nArray . Also, instead of using concat , use the spread operators wit...

The definitive guide to form-based website authentication [closed]

We believe that Stack Overflow should not just be a resource for very specific technical questions, but also for general guidelines on how to solve variations on common problems. "Form based authentication for websites" should be a fine topic for such an experiment. Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. We'll assume you already know how to build a login+password HTML form which POSTs the values to a script on the server side for authentication. The sections below will deal with patterns for sound practical auth, and how to avoid the most common security pitfalls. To HTTPS or not to HTTPS? Unless the connection is already secure (that is, tunneled through HTTPS using SSL/TLS), your login form values ...