Vote count: 0 I am working on a research project in which I have to parse large java files and have to extract component notations out of the code. The components are dependent on java expressions and conditions. So far the only option i can see is AST tree but it seems to be very complex. Can I extract or re write java code using AST plug in to store the code in a way that can map to components later? what other options are there to parse java and make the rule base to store the info in some format? i have explored Java cc but its purpose seems to define a language, what i want to do is to extract something in component notation rather than defining a language, still I need to define rules ...
ادامه مطلبVote count: 0 I m quiet new to springmvc. Today when I lea @ResponseBody, I have some questions about messageConverters: As above, we could declare a list of different converters. So it means we could choose one of them as response body converter. But how to choose the one to use? For example, in functionA() to retu JSON and then in functionB() to retu XML. My way is to force Content-Type of response, is it a correct way? Or does a better solution existing? public @ResponseBody User getUser(HttpServletResponse response) { response.setContentType("application/xml"); // SOME CODES HERE retu user; } asked 3 mins agoDONG Let's block ads! بخوانید...
ادامه مطلبVote count: -1 I have a table in a mySQL database titled 'xs' which holds a column titled 'result', which holds an array of xml values. I have converted this to json using: public function getResults(){ $xml_clean = stripslashes(trim($xs->result)); $xml = simplexml_load_string($xml_clean); if(isset($xml->Consumer)){ $result['consumer_name'] = json_encode($xml->Consumer->ConsumerName); $result['consumer_contact_no'] = json_encode($xml->Consumer->ConsumerTelephoneNo); } retu $result; } The $xml_clean variable was my attempt at removing special characters but it actually provides no use, the output is the same as without it. My output from the php view is: Name: {"0":"Jason Statham"} Contact Nu...
ادامه مطلبVote count: 0 I am dealing with a problem where I want to extract stock names from a text file to use in multiple python scripts, so that if I add one or more stocks I dont have to alter all the python files. My stocks.txt file is: AAPL GOOG TSLA If I import this the script saves A.txt, A.txt, P.txt, L.txt, G.txt etc. It takes every letter as seperate. How can I change my code so that it takes AAPL, GOOG and TSLA? Thank you! My reduced script: import urllib2 import time import datetime import os filePath = os.path.abspath('stocks.txt') openFile = open(filePath, 'r') stockToPull = str(openFile.read()) def pullData(stock): try: saveFileLine = "today_data\" +stock+".txt" except Exception, e: pr...
ادامه مطلبVote count: 0 So I have a Google Spreadsheet and want to create automated daily reports by emailing a portion of the range from my "Daily report" sheet as a HTML table using Google Spreadsheet triggers. I have some conditional formatting in the sheet to get it to paint all cells in column that have MAX(value) in said column. I've managed to create the code below which emails me the range but Gmail doesn't recognized it as a HTML table but plain text. I've tried using {htmlBody: htmltable} in the MailApp.sendEmail function but Gmail just errors out ([Ljava.lang.Object;@SOME_HASH. Question 1: How can I email the table as HTML and not plain text with all the HTML tags visible? Question 2: How c...
ادامه مطلبVote count: 0 I have something like a diagramming UWP application where each shape has an RichEditBox. The problem is, that I loose the formatting when the text is empty. For Example: Change the text to bold: EditBox.Document.Selection.CharacterFormat.Bold = FormatEffect.On. Delete all text Get the text via "EditBox.Document.Selection.GetText(GetTextFormat.FormatRtf, out text); => The result is just an empty string, not valid RTF document at all. This is a problem in my scenario. Is there an approach to solve it? I think RichEditBox should always provide a valid RTF document. asked 4 mins agoSebastianStehle Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Hi I have the following file +--------------------------+-----------------------+-----------------------+- + | col_name | data_type | comment | +--------------------------+-----------------------+-----------------------+--+ | id | string | | | name | string | | | filename | string | | | loaddate | string | | | recordid | string | | | | NULL | NULL | | # Partition Information | NULL | NULL | | # col_name | data_type | comment | | | NULL | NULL | | fname | string | | +--------------------------+-----------------------+-----------------------+--+ I would like to create this output id,name,filename,loaddate,recordid Basically column names with comma separated list except the header...
ادامه مطلبVote count: 0 The by function from base R has its own special output class, "by", which comes with a special print format. For ease of putting the results into tables, I'd really like to arrange the results of "by" as a data frame with columns indicating the levels of the factors used to subset: b...
ادامه مطلبVote count: 0 I want to use the fromat procedure in mit-scheme. (load-option 'format) in mit-scheme gives me the error "caot locate a load-option database" This is on a windows 10 machine, it works for me on my mac. from the manual under section 2.6.2 - Environment Variables for the Runtime System MITSCHEME_LOAD_OPTIONS Specifies the location of the options database file used by the load-option procedure. The default is optiondb.scm on the library path. optiondb.scm is located at C:Program Files (x86)MIT-GNU Schemeliboptiondb.scm in my machine on starting scheme (get-environment-variable "MITSCHEME_LOAD_OPTIONS") evaluates to #f. After setting with (set-environment-variable! "MITSCHEME_LOAD_...
ادامه مطلبVote count: 0 We are getting varieties of JSONs/XMLs as input whose schema is always evolving. I want to process them using ORC or Parquet format in Hadoop/Hive environment for performance gain. I know below common style of achieving same objective : Use JSONSerde or XMLSerde library, first create hive table using these serde. Later select * fields query will be fired on each xml/json hive table to save as orc or save as parquet into another table. Once done successful I can drop these Serde Table and XML/JSON data. What would be another good ways of doing same ? asked 3 mins agokartik Let's block ads! بخوانید...
ادامه مطلبVote count: 0 i am entering amount in text box then it should append commas in between the amount(ex: i entered 123500 it should convert like 1,23,500.00 automatically when on blur) using angular js. note: this should happen within the same input box. enter image description here please any body help me on this ASAP asked 1 min agoRamesh RS Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a cronjob set that runs 00:00 GMT everyday.This cronjob executes a shell script which calls a python script inteally.The python script generates a log file as output.The shell script and python script are located in the same directory in the unix box(/abc/logs/env/pqr/hvi/). They have 777 as permission.Now, when i run the shell script from this location(/abc/logs/env/pqr/hvi/) it executes fine and the python script inteally gets called & generates the log file.But when this is executed through the cronjob , the output file is not generated and I get a error message saying "AttributeError: 'str' object has no attribute 'format' " When I do a which python I get : somelocat...
ادامه مطلبVote count: 0 I have a MongoDB collection for chat messages. With every chat message, the user's id is stored. When I publish the collection to the client, I want to replace each user's id with their useame, but in the server's version of the collection I need to keep the user's id because I want to allow the user to change their name etc. My current solution is to publish the users collection to the client, and let the client replace ID with name using a registerHelper. While this works with smaller projects, I would not want to send 2000 users to the client just so they can replace ID with names. This is the data stored in each chat message when it is sent. chatroomMessages.insert({ text: ...
ادامه مطلبVote count: 0 i am currently editing my login page and i found that my bootstrap icon is not align as useame.it supposed to be center but now it is slightly up in the useame box field. how to edit to be center. secondly, how to set if the first time reload to the page, the icon not displayed until i start to type useame. Login to your account Useame my login picture asked 2 mins agosue Let's block ads! بخوانید...
ادامه مطلبVote count: 0 This is my first time working on JavaFx and I'm following this tutorial just as a template: http://code.makery.ch/library/javafx-8-tutorial/part3/. For my application, I'm working with 2 columns on the left side, telephone number and the call start date/time. I'm wanting to change the formatting of the data in the table as it's currently coming thorough as yyyy-MM-ddThh:mm. I can't seem to figure out where to place the formatting piece at. I have a date formatter function that you can find at the link above, but its retuing a string and its giving me errors. Thanks for any help you can give. Here are some code snippets of what I'm working with. Controller: @FXML private void in...
ادامه مطلبVote count: 0 Hey guys sorry that the title isn't the best. Basically there is a web service ruing at a particular url that retus a JSON array with a single object. Each object is an array containing name, longitude and latitude of people. How can I use this in the MapsActivity in Android Studio to display the user's locations on Google maps? I have already created several other activities for the rest of the application (welcome screens, etc.) but I'm a bit stuck on this part. Thanks in advance. asked 55 secs agoCypher236 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have vs2013 and ie11 on my system. I have created virtual directory for my web application. I have crystal report version "10.5.3700.0". But when i generated report paging,print btn not loading and report format is also not good.If i run same url in ie8 it works fine. Some crystal report css and js not loading properly asked 49 secs agoGanesh Gadekar Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Is there a standard way to make extra information available to handlers from the socketserver module? The following is about the simplest solution I could think of, but it is unconvincing that this is the best way to make sure that handlers get access to some resources that they can all share. #! /usr/bin/env python3 import socketserver def main(): address = 'localhost', 10000 history = [b'Hello, world!'] server = CustomUDPServer(address, UDPHandler, history) server.serve_forever() class CustomUDPServer(socketserver.UDPServer): def __init__(self, server_address, RequestHandlerClass, history): super().__init__(server_address, RequestHandlerClass) self.history = history class UDP...
ادامه مطلبVote count: 0 My requirement is I have to read a input xml which has the structure as below: 852 0001 H 20140105 20140111 001 UP 722868102237 VP F2N036-06 QS EA 92 008 1 018 1 027 1 044 -1 002 UP 722868127469 VP F2N025-10-GLD QA EA 92 007 1 010 1 017 1 020 1 021 1 022 1 025 1 028 2 048 1 EA 92 003 9...
ادامه مطلبVote count: 0 I created a fiddle for a drilldown highchart here https://jsfiddle.net/osneaj/2/. I need to format the tooltip with correct percentage in both the main chart and the drilldown ones too. Can someone please tell me how to do it. $(function () { $('#drillDown').highcharts({ chart: { type: 'column', renderTo: 'drillDown' }, title: { text: 'Healthcare Operations' }, subtitle: { text: 'Facility Revenue' }, plotOptions: { series: { dataLabels: { enabled: true, format: '{point.name}: ${point.y}' } } }, tooltip: { headerFormat: '{series.name}', pointFormat: '{point.name}: {point.y:.2f}% of total' }, series: [{ name: 'Facility', colorByPoint: true, data: [{ name: 'Taer Hospital System', ...
ادامه مطلب