texts
sequence
tags
sequence
[ "_mysql_exceptions.ProgrammingError: (1064, \"You have an error in your SQ L syntax; right syntax to use near ')' at line 1\")", "Python MySQL Statement returning Error\n\ndef _conditional_insert(self, tx, item):\n tx.execute('select * from table where text1 = %s', (item['text1'], ))\n result = tx.fetchone()\n if result:\n log.msg(\"Item already stored in db: %s\" % item, level=log.DEBUG)\n else:\n tx.execute(\\\n \"INSERT INTO table (text3 table, text1, text2) \"\n \"values (%s, %s, %s, %s)\",\n (item['text3'],\n item['table'],\n item['text1'],\n item['text2'],\n )\n )\n log.msg(\"Item stored in db: %s\" % item, level=log.DEBUG)\n\ndef handle_error(self, e):\n log.err(e)\n\n\nbut keep getting the following error :\n\n\n _mysql_exceptions.ProgrammingError: (1064, \"You have an error in your SQ\n L syntax; check the manual that corresponds to your MySQL server version for the\n right syntax to use near ')' at line 1\")\n\n\ncan someone tell where I ignored ) ?" ]
[ "python", "mysql" ]
[ "Erro loading schemes from Eclipse - Mule IDE", "i am attempting to create my first mule server but i get an error for any external scheme i try and include,\n\nmy Config file is as follows (working on Eclipse Indigo with mule standalone 3.2 installation):\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<mule xmlns=\"http://www.mulesoft.org/schema/mule/core\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:spring=\"http://www.springframework.org/schema/beans\"\n xmlns:http=\"http://www.mulesoft.org/schema/mule/http\"\n xmlns:vm=\"http://www.mulesoft.org/schema/mule/vm\"\n xmlns:quartz=\"http://www.mulesoft.org/schema/mule/quartz\"\n xsi:schemaLocation=\"\n http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\n http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd\n http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd\n http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd\n http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.2/mule-vm.xsd\">\n\n\n <flow name=\"ChatListener\">\n <quartz:inbound-endpoint jobName=\"eventTimer\" repeatInterval=\"2000\">\n <quartz:event-generator-job>\n <quartz:payload>Poll Chat DB</quartz:payload>\n </quartz:event-generator-job>\n </quartz:inbound-endpoint>\n <component>\n <singleton-object class=\"com.TimeLineListener.ChatListener\" />\n </component>\n <vm:outbound-endpoint path=\"ChatMsgs\" exchange-pattern=\"one-way\"/>\n </flow>\n\n <flow name=\"TimeLineMsgSender\">\n <composite-source>\n <!-- Incoming Chat Msgs -->\n <vm:inbound-endpoint path=\"ChatMsgs\" exchange-pattern=\"one-way\"/>\n\n <!-- Incoming SIEM Msgs -->\n <vm:inbound-endpoint path=\"SIEMMsgs\" exchange-pattern=\"one-way\"/>\n\n <!-- Incoming NMS Msgs -->\n <vm:inbound-endpoint path=\"NMSMsgs\" exchange-pattern=\"one-way\"/>\n </composite-source>\n\n <!-- Tested OutPut endpoint -->\n <stdio:outbound-endpoint system=\"OUT\"/>\n\n\n </flow>\n\n\n</mule>\n\nand the errors i recieve are:\n\n1.\nThe prefix \"stdio\" for element \"stdio:outbound-endpoint\" is not bound. mule-config.xml ‪/ChatTester‬ line 41 XML Problem\n\n2.\ncvc-complex-type.2.4.a: Invalid content was found starting with element 'vm:inbound-endpoint'. One of '{\"http://www.mulesoft.org/schema/mule/core\":abstract-inbound-endpoint}' is expected. mule-config.xml ‪/ChatTester‬ line 31 XML Problem\n\n3.\ncvc-complex-type.2.4.a: Invalid content was found starting with element 'quartz:inbound-endpoint'. One of '{\"http://www.mulesoft.org/schema/mule/core\":description, \"http://www.mulesoft.org/schema/mule/core\":composite-source, \"http://www.mulesoft.org/schema/mule/core\":abstract-inbound-endpoint, \"http://www.mulesoft.org/schema/mule/core\":abstract-message-processor, \"http://www.mulesoft.org/schema/mule/core\":abstract-outbound-endpoint, \"http://www.mulesoft.org/schema/mule/core\":response}' is expected. mule-config.xml ‪/ChatTester‬ line 17 XML Problem\n\n\nany idea what i\"m doing wrong?" ]
[ "esb", "mule" ]
[ "How to add data from table of one database into table of another database in SQLite", "Suppose I have two database files a.sqlite and other one is b.sqlite. suppose table1 is in a.sqlite and table2 in b.sqlite. I open a.sqlite in read-only mode and b.sqlite in read-write.Suppose both table table1 and table2 has same column name \"description\".table2 has description column with all null values and table1 has some values.So how can i add the data from table1 into table2.I know through query.But as these r in two different databse,so is there ant problem? Can any one suggest ?" ]
[ "android", "sqlite" ]
[ "Mapping child objects in fluent nhibernate to a read-only view", "Given that I am implementing a read-only UI, how do I create a ClassMap for Shop:\n\npublic class Shop {\n public int Id { get; set; }\n public City City { get; set; }\n}\n\npublic class City {\n public string Name { get; set; }\n public string CountryCode { get; set; }\n}\n\n\nThe DB interface for Shops is a View containing 3 columns (ShopId, CityName, CountryCode). I was hoping to do something like this:\n\npublic sealed class ShopMap : ClassMap<Shop> {\n public ShopMap()\n {\n Table(\"Shop\");\n Id(x => x.Id, \"ShopId\");\n Map(x => x.City.Name, \"CityName\");\n Map(x => x.City.CountryCode, \"CountryCode\");\n }\n}\n\n\nWill fluent auto-instantiate Shop.City?" ]
[ "c#", "fluent-nhibernate" ]
[ "Return content type not supported from Twilio SMS api", "Currently im working on a project which need SMS retrieve functionality added to the system. I have use spingboot to build the application.All the implementation done and i have followed the all necessary configurations on twillio to retrieve sms from client. When i send a sms to Twilio api, it state the Unsupported Media Type in the debugger. I am sending also the required content type to api. This happens when im sending an sms to number which is provided by twilio. But postman calls to the application working fine.\n\npackage com.crustykrabs.application.service;\n\nimport org.springframework.http.MediaType;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.ResponseBody;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport static spark.Spark.*;\nimport com.twilio.twiml.MessagingResponse;\nimport com.twilio.twiml.messaging.Body;\nimport com.twilio.twiml.messaging.Message;\n\n@RestController\npublic class TextMessageController {\n\n @PostMapping(path = \"/messages/textmessages/receive\", consumes = \"application/xml\", produces = \"application/xml\")\n public @ResponseBody ResponseEntity<String> receive() {\n Body body = new Body\n .Builder(\"The Robots are coming! Head for the hills!\")\n .build();\n Message sms = new Message\n .Builder()\n .body(body)\n .build();\n MessagingResponse twiml = new MessagingResponse\n .Builder()\n .message(sms)\n .build();\n return ResponseEntity.ok().contentType(MediaType.APPLICATION_XML).body(twiml.toXml());\n }\n}" ]
[ "java", "spring", "spring-boot", "twilio", "twilio-api" ]
[ "How to deploy outlook form to other user's folder in his mailbox?", "I'm a company's exchange administrator.\n\nI've met a problem that if I have a outlook form and I can publish it. But how can I deploy it to other user's folder in his mailbox? For example, I can use EWS API to create a specific folder in everyone's mailbox, like \"xxx folder\". How can I let this folder have this outlook form without people do it manually?\n\nThanks" ]
[ "outlook", "outlook-form" ]
[ "NullPointerException when trying to autowire configuration properties running with MockitoJUnitRunner", "I have been trying to use configuration properties in my test classes but couldn't find the way to do so as I always get NullPointerException.\n\napplication.yaml\n\naffix:\n lover: 'interests'\n social: 'social_media'\n\n\nYamlConfig.java\n\n@Configuration\n@EnableConfigurationProperties\n@ConfigurationProperties\n@EnableAutoConfiguration\n@Data\npublic class YamlConfig {\n private HashMap<String, String> affix;\n}\n\n\nService.java\n\n@Autowired\nprivate YamlConfig config;\n\n...\n\nsetFeatureName(config.getAffix().get(\"social\"));\n// supposed to return social_media\n\n\nThe code above is working fine in my service but when I tried to use configuration properties in my test classes, it didn't work.\n\nServiceTest.java\n\n@RunWith(MockitoJUnitRunner.class)\npublic class MetadataServiceTest {\n@Autowired\nprivate YamlConfig config;\n\n@Test\npublic void testPropertiesNotNull() {\n assertNotNull(config.getAffix().get(\"social\"));\n}\n\n\nI've also tried other annotations as well, but none of them seemed to work. Most of the example are running test using JUnitRunner, and I'm not sure if that's the reason why they didn't work on my test classes.\n\nIs there anyway to get configuration properties to use in test class using MockitoJUnitRunner without mocking the whole thing (the actual config is very large and would be hard to mock result for each one)?" ]
[ "java", "spring", "spring-boot", "mockito" ]
[ "Which scala mutable list to use?", "This is a followup question to No Scala mutable list \n\nI want to use a mutable list in Scala. I can chose from\n\n\nscala.collection.mutable.DoubleLinkedList\nscala.collection.mutable.LinkedList\nscala.collection.mutable.ListBuffer\nscala.collection.mutable.MutableList \n\n\nWhich is nice, but what is the \"standard\", recommended, idiomatic scala way? I just want to use a list that I can add things to on the back.\n\nIn my case, I am using a HashMap, where the \"lists\" (I am meaning it in general sense) will be on value side. Then, I am reading something from a file and for every line, I want to find the right list in the hashmap and append the value to the list." ]
[ "scala", "scala-collections" ]
[ "How to display Serial Numbers with mysql query result in codeigniter?", "I want to display serial numbers beside my mysql query result , example:\n\nSerial Number Name Country\n 1. John USA\n 2. Srijon UK\n\n\nI have tried something with PHP Loops, but I couldn't make it work. Would you please kindly help me?\nplease note that the serial numbers are not values retrieved from database.\n\nThanks in Advance :)\n\n <?php if(count($records) > 0) { ?>\n <table id=\"table1\" class=\"gtable sortable\">\n <thead>\n <tr>\n <th>Batch Name</th>\n <th>Class</th>\n <th>Batch Instructor</th>\n </tr>\n </thead>\n <tbody>\n <?php\n foreach ($records as $row){?>\n\n <tr>\n\n <td> <a href=\"<?php echo base_url(); ?>batch/<?php echo $row['batchid']; ?>\"><?php echo $row['batchname'];?></a> </td>\n <td><?php echo $row['class'];?></td>\n <td><?php echo $row['batchinstructor'];?></td>\n\n </tr>\n\n <?php } ?>\n\n </tbody>\n </table>\n <?php } ?>\n <div> <?php echo $this->pagination->create_links(); ?> </div>" ]
[ "codeigniter", "codeigniter-2" ]
[ "NumericUpDown Value turns to 0 when it is set as a float", "So resizeWidth and resizeHeight are numericUpDown controls in this following code.\nAlso, tempBitmapW and tempBitmapH are both floats.\n\nfloat rW = (float)resizeWidth.Value;\nfloat rH = (float)resizeHeight.Value;\nrH = (float)Math.Truncate(tempBitmapH * ((float)rW / tempBitmapW));\nint rsW = (int)rW;\nint rsH = (int)rH;\nresizeWidth.Value = rsW;\nresizeHeight.Value = rsH;\n\n\nNow when I debug this, rsW and rsH and rW and rH do not read as 0, none of them.\nBut for some reason the numericUpDown controls throw an error as the Value 0 is out side the Minimum/Maximum range (the minimum is set to 1), so basically it is reading it as 0.\n\nWhat have I done wrong?" ]
[ "c#", "floating-point", "int", "numeric" ]
[ "Is there a way to play a sound while loading other sounds in PyGame?", "I am playing a sound when the user clicks on a button to start loading a level.\nI firstly did this:\nif event_received:\n play_the_sound()\n load_the_files()\n\nBut, the sound playback stopped when the game loaded the files. I thought I needed to get the events, so I put load_the_files() into another thread while getting the events in the main thread. But it still did the same.\nI found nothing in the documentation.\nAfter a little bit of research, I found that because I load other sound files in load_the_files(), PyGame stops the playback of the sound played. Is there a way to avoid this split of the sound?" ]
[ "python", "pygame", "playback" ]
[ "Add timestamp to image files in Joomla", "My Joomla site updates often. How do I add timestamp to all image files automatically? so that user will get the latest image. I want to also set how often the timestamp will be updated.\n\nI see Gantry 5 has this function in one their plugin but it requires templates that uses gantry platform. I am using Joomlart's T3.\n\nhttp://docs.gantry.org/gantry5/faq/asset-timestamps" ]
[ "php", "css", "image", "joomla", "timestamp" ]
[ "Sort/filter a datatable by a column which is not included in the entity", "I have a datatable which has columns defined in my entity. I also added another column named total in index.xhtml:\n\n...\n<p:column headerText=\"total\">\n <h:outputText value=\"#{bean.total}\" />\n</p:column>\n...\n\n\nThis column calculates and returns the sum of columns in each row. Everything works fine except when I want to sort/filter by columns, the total column remains untouched.\n\nI guess I should add the total field in my entity too, but it doesn't seem practical.\nDoes primefaces has a better and more straight solution for such situations?" ]
[ "java", "primefaces" ]
[ "Seeding data to database using Strapi headless CMS", "I am fairly new to using Strapi the headless CMS. I am trying to populate some data into my database, just like using knex with node js, however, I am not sure about doing this. I have seen a tutorial where inside the config/functions/bootstrap.js, we would module.export an asynchronous function that will populate the data; I have defined my code like so:\n"use strict";\nconst data = [\n {\n title: "string",\n description:"string",\n director: "string",\n assistantDirector: "string",\n directorOfPhotography: "string",\n firstAc: "string",\n sound: "string",\n thumbnail: "",\n images: "",\n hairAndMakeUp: "string",\n productionAssistant: "string",\n writer: "string",\n cast: "string",\n video: "string",\n dateFilmed: 2020,\n }];\n\nmodule.exports = async () => {\n data.forEach(reel => {\n await strapi.services.reel.create({\n title: reel.title,\n description: reel.description,\n director: reel.director,\n assistantDirector: reel.assistantDirector,\n directorOfPhotography: reel.directorOfPhotography,\n firstAc: reel.firstAc,\n sound: reel.sound,\n hairAndMakeUp: reel.hairAndMakeUp,\n productionAssistant: reel.productionAssistant,\n writer: reel.writer,\n cast: reel.cast,\n video: reel.video,\n dateFilmed: reel.dateFilmed,\n });\n })\n};\n\nHowever, after running strapi develop I get a Error while running command develop: undefined error. What am I missing?\nThank you for your time." ]
[ "database", "content-management-system", "strapi" ]
[ "How to create a new function parameter dynamically", "I have a chat bot, that shows every function parameter, so the user can change it and then get the function result in chat.\n\nLet's say I have a function:\n\ndef func(a=0, b=0):\n return a+b\n\nfunc(*user_settings)\n\n\nBut I want it to be able to recognize the user. I can't just add a 'user' parameter because it will be shown in chat.\nCan I add a parameter to the function dynamically, so it becomes smth like:\n\ndef func(a=0, b=0):\n print(func.user)\n return a+b\n\n(add 'user' parameter)\nfunc(*user_settings)\n\n\nFunction is an object, right?\nI think that just hardcode not to show a specific parameter is too dumb.\np.s. the function is also decorated." ]
[ "python", "python-3.x", "function", "parameter-passing" ]
[ "XML detect debug mode", "I know that programatically I can use \n\nif (BuildConfig.DEBUG) {\n // do something for a debug build\n}\n\n\nHowever, what I'd like to do is show a watermark when in debug mode. Is there a way to do something similar to this in the XML files?" ]
[ "android", "xml", "android-layout", "debugging" ]
[ "Getting difference between counts of two subqueries", "I'm trying to determine the score of an entry by finding the difference between the number of upvotes and downvotes it has received in MYSQL by running SELECT (SELECT COUNT(vote_id) AS vote_up FROMvotesWHERE vote='UP'),(SELECT COUNT(vote_id) AS vote_down FROMvotesWHERE vote='DOWN'),(vote_up - vote_down AS vote_score). When I try to run this though, it tells me that I do not have proper syntax. What am I doing wrong? \n\nAlso, is there a better way to write this? \n\nAnd finally, what is the ideal way to find the item with the highest and lowest number of votes? Would I just ORDER BY [above query]?" ]
[ "mysql" ]
[ "iphone development: communicating with server and push to anotherview", "Well lets say I have two viewcontrollers \"ViewControllerA\" and \"ViewControllerB\". What I am doing is when a button pressed in the viewControllerA, my local server returns me a value and I store it in a variable \"user\". After that I pass this variable to viewControllerB.\n\nActually I can do both processes successfully but not at the same time. I mean I can receive the response from the server and store it in a string variable. I do it by using the delegate method:\n\n - (void)connectionDidFinishLoading:(NSURLConnection *)connection \n\n\nSo there is no problem at this side.\n\nOn the other hand I can also pass a variable to viewControllerB from viewControllerA by using:\n\n-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{\n if([segue.identifier isEqualToString:@\"vcSegue\"]){\n ViewControllerB *controller = (ViewControllerB *)segue.destinationViewController;\n controller.stringVariable = @\"content of the string\";\n }\n}\n\n\nThe think is when I want to pass the string variable which I have from the server to the viewControllerB I face with a problem that the variable comes null. so how can I control the push action? because what i understand is -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender should work after the - (void)connectionDidFinishLoading:(NSURLConnection *)connection I mean, I should have the response from the server successfully, then push action should be performed but I cant figure out how to do. thanks for any kind of help." ]
[ "iphone", "ios", "objective-c", "cocoa-touch", "connection" ]
[ "hibernate changes id when saving the object", "I've got an object with this parameters\n\n{\n \"id\" : \"36461dd3-2bdb-42de-8e3d-b44e28696b1e\",\n \"race\" : \"HUMAN\",\n \"age\" : \"18\",\n \"name\" : \"Alisa\"\n}\n\n\nI attempt to save it\n\nList<MainFemaleCharacter> batch = Arrays.asList(sampleMainCharacter());\ntry (Session session = sessionFactory.openSession()) {\n session.beginTransaction();\n batch.forEach(session::save);\n session.getTransaction().commit();\n}\n\n\nIn debug, before saving, it shows id with expected value. But when I retrieve object it shows another id for example dccaf5d0-5c2b-4336-a0f3-ff65f92bf5f1. Why? MainFemaleCharacter class looks like this\n\n@Entity\n@Table(name=\"main_female_character\")\n@EqualsAndHashCode(callSuper=true)\n@ToString(callSuper=true)\npublic @Data class MainFemaleCharacter extends BasicCharacter {\n}\n\n@MappedSuperclass\n@EqualsAndHashCode(callSuper=true)\n@ToString(callSuper=true)\npublic @Data class BasicCharacter extends UidNamedObject {\n @OneToOne\n private Race race;\n private int age;\n}\n\n@MappedSuperclass\npublic @Data class UidNamedObject {\n @Id\n @GeneratedValue\n private UUID id;\n @Column(unique=true)\n private String name;\n}" ]
[ "java", "hibernate-5.x" ]
[ "set tint color of an UIBarButtonItem for a specific view controller ios6", "Called from application:willFinishLaunchingWithOptions:\n\n+(void)styleNavbar {\n [[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:45/255.0 green:48/255.0 blue:53/255.0 alpha:1]];\n [[UIBarButtonItem appearance] setTitleTextAttributes:@{UITextAttributeTextColor:[UIColor whiteColor], UITextAttributeTextShadowColor:[UIColor blackColor], UITextAttributeTextShadowOffset: [NSValue valueWithCGSize:CGSizeMake(0,1.0)]} forState:UIControlStateNormal];\n [[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:22/255.0 green:24/255.0 blue:26/255.0 alpha:1]];\n}\n\n\nI am now trying to use a different color scheme in view controllers from one of my storyboards.\n\nI have been able to set tints for navigation bar and ordinary buttons.\n\nIn my -viewDidLoad:\n\n[self.navigationController.navigationBar setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n[self.navigationItem.rightBarButtonItem setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n\n\nBut I am struggling with doing the same thing to the back button which continues to use the global colorscheme unless I comment the +styleNavbar lines out. I have unsuccessfully tried:\n\n[self.navigationController.navigationBar.backItem.backBarButtonItem setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n[self.navigationItem.backBarButtonItem setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n[self.navigationItem.leftBarButtonItem setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n[[UIBarButtonItem appearanceWhenContainedIn:[MySpecificViewController class], nil] setTintColor:[MyColorScheme sharedInstance].lightBlueColor];\n\n\nRunning all of the above lines doesn't appear to override the tint for the back button even though I can style other navbar elements from the same method. Is it possible to style the back button after setting its color with the application wide appearance proxy?" ]
[ "ios", "uibarbuttonitem" ]
[ "Azure Data Factory - Extraction from Dynamics 365 - Type of column 'allparties' is not supported, The attribute type 'CalendarRules/PartyList'", "I am trying to extract 'Activities' entity from Dynamics 365 Online and for a field 'allparties' which seems to be the type of 'PartyList', I am getting an error importing the schema in ADF that it's not supported. I am able to extract the entity if I remove this field from the query. According to this article from Microsoft it seems not supported in ADF at this point of time - https://docs.microsoft.com/en-us/azure/data-factory/connector-dynamics-crm-office-365#data-type-mapping-for-dynamics. \n\nIs there any work around to pull the value of this field? I use XRMToolBox for the local testing and I see the values are getting pulled fine. Appreciate the pointers." ]
[ "azure", "azure-data-factory" ]
[ "xsd restriction allowing any lowercase or uppercase or numbers", "I have a following schema accepting only COM1-4.\n\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n <xs:schema\n xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n elementFormDefault=\"qualified\">\n\n <xs:complexType name=\"Component\">\n <xs:attribute name=\"type\" type=\"ComponentType\"/> \n </xs:complexType>\n\n <xs:simpleType name=\"ComponentType\">\n <xs:restriction base=\"xs:string\">\n <xs:enumeration value=\"COM1\"/>\n <xs:enumeration value=\"COM2\"/>\n <xs:enumeration value=\"COM3\"/>\n <xs:enumeration value=\"COM4\"/>\n </xs:restriction>\n </xs:simpleType>\n\n\nNow the requirement has changed. I need to allow any characters(lower or uppercase). I need to make it backward-compatible with the previous values which are already populated in the production env.\n\nI want to preserve 'ComponentType' name and enum types for ComponentType. I would like to minimize the code change. If possible, I would like to take care of it in the schema level. These COM[1-4] is just naming convention changed for this post. Actual values are different. \n\nIs there a way to change the schema which can accept the any characters(lower or uppercase) within the scope of schema without regenerating the java artifacts or make a change on java code?\n\nThanks." ]
[ "xsd", "schema" ]
[ "jQuery Selecting elements by dynamic name with square brackets (fiddle incl)", "How can I make this fiddle work:\nhttp://jsfiddle.net/gAHwW/\n\nfunction $escape(string) { \n return string.replace(/\\\\(\\[|\\]\\\\)/g,'\\\\\\\\$1');\n}\n\n$(function() {\n $('input[type=\"button\"]').click(function() {\n alert($escape( $(this).attr('id') )); // to show you what the escape does\n\n $('#' + $(this).attr('id')).hide(); // doesn't work\n $('#' + $escape( $(this).attr('id') )).hide(); // doesn't work\n $('#alsosquare[]').hide(); // doesn't work\n\n //$(this).hide(); // works\n //$('#alsosquare\\\\[\\\\]').hide(); // works\n });\n});​\n\n\nI need to select elements by their name/id dynamically, and their names/ids can have square brackets.\n\nThanks!" ]
[ "javascript", "jquery" ]
[ "Weird python literal indexing : ['False', 'True'][condition]", "This is what I understood:\n\n>>> ['False', 'True'][True]\n'True'\n>>> ['False', 'True'][False]\n'False'\n>>>\n\n\nAnd now i tried the following snippet and got TypeError:\n\n>>> c = 'a'\n>>> ['Invalid', ['x']*c][type(c) is int]\nTraceback (most recent call last): \n File \"<stdin>\", line 1, in <module>\nTypeError: can't multiply sequence by non-int of type 'str'\n>>>\n\n\nSo, when i change the ['x']*c into False, then it works:\n\n>>> ['Invalid', 'False'][type(c) is int]\n'Invalid'\n>>>\n\n\nAnd: i change c to 2:\n\n>>> c = 2\n>>> ['Invalid', ['x']*c][type(c) is int]\n['x', 'x']\n>>>\n\n\nNB: :I know if - else can do it, but thats not my point here." ]
[ "python" ]
[ "faster equivalent of mysql inner join with sum", "i have one really long select from mysql DB. It's working quite fast, till i added this INNER JOIN. Before i added this INNER JOIN select time was 2 seconds, now it is about 20 seconds...\n\nINNER JOIN \n (SELECT \n accomodation_id,\n SUM(accomodation_rooms.rooms) AS total_rooms,\n SUM(accomodation_rooms.beds * accomodation_rooms.rooms) AS total_persons \n\n FROM accomodation_rooms \n\n GROUP BY accomodation_id) accomodation_rooms\n\nON \n accomodation_rooms.accomodation_id = accomodation.id\n AND \n accomodation_rooms.total_persons >= '\".$persons.\"'\n\n\nCan somebody help me with some faster alternative??" ]
[ "mysql", "performance", "sum", "inner-join" ]
[ "Display the selected item, not the number", "Django python problem: The select drop down returns the numeric value of the item. I can't figure out how to get the text value of it.\n\nModels.py\n\nprofile_types = (('0', \"Yadda\"), ('1', \"Frank and beans\"), ('2', \"Type\"), ('3', \"Placeholder\"),\\\n ('4', \"Another\"), ('5', \"And another\"), ('6', \"aaand another\"),\\\n ('7', \"Another\"), ('8', \"Last Type\"))\n\nclass Profile(models.Model):\n user = models.ForeignKey(User, null=True, unique=True)\n profile_types = models.CharField(max_length=2, choices=profile_types)\n\n\nForms.py\n\nclass EditProfileForm(forms.Form):\n profile_types = (('0', \"Yadda\"), ('1', \"Frank and beans\"), ('2', \"Type\"), ('3', \"Placeholder\"),\\\n ('4', \"Another\"), ('5', \"And another\"), ('6', \"aaand another\"),\\\n ('7', \"Another\"), ('8', \"Last Type\"))\n name = forms.CharField(max_length=100, required=False, widget=forms.TextInput(attrs={'class':'input-text'}) )\n about = forms.CharField(widget=forms.Textarea(attrs={'class':'input-text'}), required=False)\n org_name = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'class':'input-text'}))\n org_type = forms.CharField(max_length=8, widget=forms.Select(choices=choices))\n profile_type = forms.CharField(max_length=4, widget=forms.Select(choices=choices))\n\n\nTemplate:\n\n<span>{{ profile.profile_type }}</span>\n\n\nWhich returns\n\n 1 <-- (I'm trying to display \"Frank and beans\") -->" ]
[ "python", "html", "django", "django-forms", "django-templates" ]
[ "How do I find the most recent event in sequence based on the timestamp of another event", "I have a table of app event data. Each row has a user_id, a timestamp, a page_id, an event_name, and other fields. The events I care about right now are the page_open and button_click events, but there are 10 other event types that could happen in between, like scrolling. The user might open the same page multiple times, but only click a button on the page every so often, like you see in the example below.\nuser_id timestamp page_id event_name\n------- ---------- ------- --------------\n 71 12:00:34 307 page_open\n 88 13:01:44 307 page_open\n 71 13:02:09 307 page_open\n 71 13:02:11 307 scroll\n 71 13:04:41 307 page_open\n 71 13:04:42 307 scroll\n 71 13:04:45 307 button_click_a\n 71 13:08:30 307 page_open\n 88 13:09:01 307 button_click_b\n\nFor each page_open event for each user, I want an additional column that tells me if a button was eventually clicked. I don't have a page "session" to use, so I have to look for the max page_open timestamp that occurred before the button_click timestamp. Said another way, I want to transform the above table into the following table\nuser_id timestamp page_id event_name button_event\n------- ---------- ------- ---------- --------------\n 71 12:00:34 307 page_open NULL\n 88 13:01:44 307 page_open button_click_b\n 71 13:02:09 307 page_open NULL\n 71 13:04:41 307 page_open button_click_a\n 71 13:08:30 307 page_open NULL\n\nI tried to separate the page_open and button_click events into two tables and do a LEFT JOIN on user_id and page_id like you see below, but of course that didn't work because it matched the button clicks to all page_opens with that page_id. I only want to match the button click to it's corresponding page_open event.\nSELECT\n a.user_id,\n a.timestamp,\n a.page_id,\n a.event_name,\n b.event_name AS button_event\nFROM\n (SELECT * FROM events WHERE event_name = 'page_open') a\nLEFT JOIN\n (SELECT * FROM events WHERE event_name = 'button_click_a' OR event_name = 'button_click_b') b\nON\n a.user_id = b.user_id AND\n a.page_id = b.page_id\n;\n\nI'm new to working with event data like this. Any help you can provide would be awesome. What is the correct way to approach this problem?" ]
[ "sql", "hive", "hql", "window-functions", "gaps-and-islands" ]
[ "Is accessing different key/value pairs in associative array simultaneously multi-cpu safe?", "From Brendan's post: DTrace variable types, I know accessing associative array simultaneously isn't multi-cpu safe.Is accessing different key/value pairs in associative array simultaneously multi-cpu safe? Or it is also not multi-cpu safe." ]
[ "dtrace" ]
[ "wordpress function custom field data convert to table", "I have numerous custom fields on my website that I want to be displayed in a table format, the custom field data looks like the following\n\nThiamin (as thiamin mononitrate);50 mg;3333% Vitamin B6 (as pyridoxine HCl);50 mg;2500% Magnesium (as magnesium bis-glycinate);150 mg;38% Manganese (as manganese citrate);5 mg;250% Malic Acid;600 mg;*\n\nInstead I want this in table format is there some css or wordpress filter I could use to convert this data to a neatly displayed table" ]
[ "php", "mysql", "wordpress" ]
[ "how to render the results from levelsetgrid?", "I had created a 2D dam break simulation by modifying mantaflow python script available here: dam_break\nIn this script I have the levelsetgrid copied in a NumPy array:\nl_ = np.zeros([1,resy,resx], dtype=np.float32)\ncopyGridToArrayLevelset(phi, l_)\n\nCurrently I am creating an image from the levelset array and saving it in png format like this:\nfrom PIL import Image\nl_img = np.mean(l_[:,::-1], axis=0)*255 # yx\nl_img = np.stack((l_img,l_img,l_img), axis=-1).astype(np.uint8)\nl_img = Image.fromarray(l_img)\nl_img.save(l_file_path)\n\nThese images look something like this:\nImage from mantaFlow's Levelsetgrid\nSo the question I want to ask: How to render these results that would look more like a pleasing fluid simulation?\nBy pleasing, I mean rendering with some light source and reflective properties of water. At the very least I would have to make the fluid edges smooth(rather than pixelated) and add some color.\nIs there any tool or library that I can use to accomplish this type of rendering?\nI know blender uses MantaFlow for fluid simulation but I was unable to find something that would render from this level set grid array." ]
[ "rendering", "simulation" ]
[ "How to detect mysql server down status quickly", "I have an application which connects a remote database server.\nIf mysql server stops for a reason and stars succesfully after that, my application cannot detect server status quickly. It takes nearly 20 seconds to reconnect to the database server. So my gui freezes. I do not want a gui freeze for 20 seconds\nSo far I tried\n\nmysql_ping\nmysql_real_connect\n\nfunctions\n\nMYSQL_OPT_RECONNECT\n\nMYSQL_OPT_CONNECT_TIMEOUT\noptions\n\n\nMy enviroment is not multi-threaded. So\nhow to do a faster detection?" ]
[ "c++", "mysql", "c", "api" ]
[ "What data type should I use to store an IP Address?", "I suddenly just thought of this and got stuck deciding which data type should I use to store an IP Address?\n\nI have thought of NSString; But if I would need the last digit for identifications, should I use float or double? And that is also another problem, since when can float or double have more than 1 decimal point?\n\nI am probably asking the question wrongly, because I really don't know how to ask this.\n\nThe IP Address comes from an XML format <IP>192.168.1.1</IP>. Any idea how I should do this?" ]
[ "iphone", "ip-address" ]
[ "How to add import-packages from a specific bundle version in OSGi", "My project has two OSGi bundles (A and B) which need to use different versions of javax.activation — A requires version 1.1.0, while B requires 1.1.1.\n\nBy default in AEM 5.6.1, there is a bundle already installed which exports version 1.1.1, which bundle A is using. In order to make it use 1.1.0 instaed, I used boot delegation to get the javax.activation from the JRE 7 for the system bundle which is 1.1.0. I am setting this using sling.properties file in AEM 5.6.1. \n\nIf I give a version for javax.activation greater than 1.1.1 in this sling.properties file, both A and B are using the system version (even though version of import-packages is specified in the manifest.mf file); but if I give a version less than 1.1.1, both bundles use the version provided by AEM.\n\nHow can I configure my bundles so as to use different versions of javax.activation for Bundle A from Bundle B?" ]
[ "java", "osgi", "aem", "sling" ]
[ "How to use path with spaces in shell with $*", "The following two .sh files are my code.\n\nIf I don't use $* everything works, but if I use $* it will prompt \"./test2.sh:line 8: C: / Program: No such file or directory\".\n\nI use cygwin on windows to run test.sh file.\n\ntest.sh\n\n#!/bin/sh\nUNITY_PATH=\"C:/Program Files/Unity/Hub/Editor/2018.4.14f1/Editor/Unity.exe\"\nBUILD_ANDROID_RES=./test2.sh\n\n${BUILD_ANDROID_RES} \\\n-UnityPath \"${UNITY_PATH}\" \\\n\n\ntest2.sh with $*\n\n#!/bin/sh\nparse_arguments() {\n UNITY_PATH=$2\n}\n\nbuild_android_assetbundle() {\n echo \"aaa ${UNITY_PATH}\"\n \"${UNITY_PATH}\" abc\n}\n\nparse_arguments $*\nbuild_android_assetbundle\n\n\ntest2.sh without $*\n\n#!/bin/sh\nbuild_android_assetbundle() {\n echo \"aaa ${UNITY_PATH}\"\n \"${UNITY_PATH}\" abc\n}\n\nUNITY_PATH=$2\nbuild_android_assetbundle\n\n\nI hope to be able to use $ *, who can solve this problem? Thank you." ]
[ "shell", "cygwin" ]
[ "configuring collectd to get custom metrics to azure monitor", "I need to configure collectd to get data from custom script into azure monitor from ubuntu server.I installed collectd and gave following configuration in collectd.conf to enable exec plugin\nLoadPlugin exec\n<Plugin exec>\n Exec root "/opt/monitoring/mount.sh"\n</Plugin>\n\nand as mentioned in https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-collectd\nran below commands -\nsudo cp /etc/opt/microsoft/omsagent/sysconf/omsagent.d/oms.conf /etc/collectd/collectd.conf.d/oms.conf\nsudo cp /etc/opt/microsoft/omsagent/sysconf/omsagent.d/collectd.conf /etc/opt/microsoft/omsagent//conf/omsagent.d/\nsudo chown omsagent:omiusers /etc/opt/microsoft/omsagent//conf/omsagent.d/collectd.conf\nsudo service collectd restart\nsudo /opt/microsoft/omsagent/bin/service_control restart\nBut i don't see any data in log analytics in the workspace\nbelow is my mount.sh script\nHOSTNAME="${COLLECTD_HOSTNAME:-localhost}"\nINTERVAL="${COLLECTD_INTERVAL:-60}"\nwhile sleep "$INTERVAL"; do\nINSTANCES=$(df -hT | grep /dev/sd | cut -d' ' -f 1 | wc -l)\necho "PUTVAL \\"$HOSTNAME/exec-magic/gauge-magic_level\\" interval=$INTERVAL N:$INSTANCES"\ndone\n```````````````\ncan anyone help me with what I am doing wrong why i don't see anything?" ]
[ "azure", "azure-monitoring", "collectd" ]
[ "wicked_pdf generate pdf without fields", "I need to generate PDF, ready to be printed as report.\nI use wicked_pdf gem.\n\nMy Controller:\n\nrender pdf: \"file_name\", # Excluding \".pdf\" extension.\n page_size: nil,\n page_width: 210,\n page_height: 297,\n orientation: 'Landscape'\n\n\nMy pdf.erb:\n\n<body onload='number_pages' bgcolor=\"#ff00FA\">\n<div style=\"height: 210mm\">\n <%= image_tag \"https://static.pexels.com/photos/160699/girl-dandelion-yellow-flowers-160699.jpeg\", width: \"300px\"%>\n</div>\n\n\nI made small sample to show my issue (see screenshot below).\n\nI can't figure out how to make pdf without white fields around, I need body to fill all document.\n\nThank you!" ]
[ "ruby-on-rails", "pdf-generation", "wicked-pdf" ]
[ "How to break paging and save the data in a single string object?", "I'm trying to fetch page post from the facebook.fb is giving data of likes based on paging concept so able get 1000 likes of a post and other likes data is in the next link.My code is working fine to get the post data but when I wanted to save the all likes of the of post in single string obj only first 1000 likes are stored in the String obj other likes not stored I Tried out with appending also but json formate is changing.I'm not having any idea how to work out for storing the all the likes of posts in one single string object. \n\npackage facebook;\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.URL;\nimport java.net.URLConnection;\nimport facebook4j.Facebook;\nimport facebook4j.FacebookException;\nimport facebook4j.FacebookFactory;\nimport facebook4j.RawAPIResponse;\nimport facebook4j.auth.AccessToken;\nimport facebook4j.internal.org.json.JSONArray;\nimport facebook4j.internal.org.json.JSONException;\nimport facebook4j.internal.org.json.JSONObject;\n\npublic class Facebookthe{\n\n\npublic static void main(String[] args) throws FacebookException,JSONException, IOException {\n\n// Generate facebook instance.\nFacebook facebook = new FacebookFactory().getInstance();\n// Use default values for oauth app id.\nfacebook.setOAuthAppId(\"XXXXXXXXXXX\", \"XXXXXXXXXXXXXX\");\nAccessToken accessTokenString = facebook.getOAuthAppAccessToken();\n String m =\"AnushkaShetty/?fields=posts.limit(1).since(2015).until(now){id,message,name,type,picture,link,caption,description,icon,application,shares,updated_time,source,comments.limit(500).summary(true){comment_count,message,can_remove,id,created_time,can_like,like_count,comments{comment_count,comments{comment_count}}},place,object_id,privacy,status_type,created_time,story,parent_id,story_tags,full_picture,likes.limit(9999).summary(true){id,name,username}},id,hometown,website,about,location,birthday,name,tagged{message_tags},category,category_list,talking_about_count,likes\";\nRawAPIResponse res1 = facebook.callGetAPI(m);\n JSONObject jsonObject55= res1.asJSONObject();\nSystem.out.println(jsonObject55); //609425942504811\n\n //z=sb.append(jsonObject55);\n\n JSONObject posts = jsonObject55.getJSONObject(\"posts\");\n\n JSONArray data = posts.getJSONArray(\"data\");\n\n JSONObject number = data.getJSONObject(0);\n\n JSONObject likes = number.getJSONObject(\"likes\");\n\n JSONObject paging = likes.getJSONObject(\"paging\");\n\n String s = paging.getString(\"next\");\n\n int count =1;\n\n while(s != null)\n {\n count++;\n System.out.println(\"go to this link\");\n\n URL oracle = new URL(s);\n URLConnection yc = oracle.openConnection();\n BufferedReader in = new BufferedReader(new InputStreamReader(\n yc.getInputStream()));\n String inputLine;\n /* String oldfile=\"\";\n String newfile=\"\";*/\n\n JSONObject obj = new JSONObject();\n\n while ((inputLine = in.readLine()) != null) \n {\n obj = new JSONObject(inputLine); \n }\n\n // z+=sb.append(obj);\n //System.out.println(obj);\n //System.out.println(count);\n\n JSONObject jo = obj.getJSONObject(\"paging\");\n\n try\n {\n s = jo.getString(\"next\");\n }\n catch(Exception e)\n {\n s=null;\n System.out.println(\"there is no next\");\n }\n\n in.close();\n\n }\n System.out.println(count);\n\n}}" ]
[ "java", "json", "facebook" ]
[ "JQuery Validate Dropdown list", "I'm using the validation plugin from here. I'm trying force the user to select an option in the drop down list so here's my html for the list:\n\nSelect the best option<br/>\n<select name=\"dd1\" id=\"dd1\">\n<option value=\"none\">None</option>\n<option value=\"o1\">option 1</option>\n<option value=\"o2\">option 2</option>\n<option value=\"o3\">option 3</option>\n</select> <br/><br/>​\n\n\nAnd here's the the jquery validation stuff:\n\n$(\"#everything\").validate({\n onsubmit: true,\n rules: {\n dd1: {\n required: {\n depends: function(element) {\n return $(\"#dd1\").val() == \"none\";\n }\n }\n },\n messages: {\n dd1: {\n required: \"Please select an option from the list, if none are appropriate please select 'Other'\",\n },\n }\n});\n\n\nI don't see any problems but even when the i select none from the drop down list and click submit, it won't validate it and so doesn't show any messages. Can anyone tell me what i'm doing wrong?" ]
[ "jquery", "html", "validation", "drop-down-menu", "jquery-validate" ]
[ "PHP array variables being assigned values", "I am fairly new to PHP and Codeigniter so im sure this will be simple.\n\nI have contact details stored in this format where type is either (1,2,3,4) mapping to (facebook, mobile, bbm, msn, twitter):\n\nID | USERID | TYPE | VALUE\n1 | 8 | 2 | 076773635\n\n\nI have set up a model to access these contact details, there may be none, or at best one of each type;\n\nfunction getContactDetails($userid) {\n $query = $this->db->query(\"SELECT * FROM who_user_contact_info WHERE userid=\".$userid);\n\n foreach ($query->result() as $row)\n {\n switch ($row->type) {\n case 1:\n $contact['facebook'] = $row->value; \n case 2:\n $contact['mobile'] = $row->value; \n case 3:\n $contact['bbm'] = $row->value; \n case 4:\n $contact['msn'] = $row->value; \n case 5:\n $contact['twitter'] = $row->value; \n }\n\n }\n\n\n return $contact;\n}\n\n\nMy controller then passed this data to my view;\n\n<h3>Contact Info</h2>\n<?php \n echo \"Facebook: \". $facebook .\"<br />\";\n echo \"mobile:\". $mobile .\" <br />\";\n echo \"bbm:\". $bbm .\" <br />\";\n echo \"msn:\". $msn .\" <br />\";\n echo \"Twitter:\". $twitter .\" <br />\";\n?>\n\n\nThis seems to nearly work, but there must be a mistake, as for example say type 3 and 5 didn't exist, mobile and twitter shouldn't have been assigned anything! yet on my output it gives the value from the one before, eg bbm=mobile and twitter=msn.\n\nHow is it possible for these array to be there when the case has not set them? or is my logic wrong?" ]
[ "php", "codeigniter" ]
[ "How to show an ionic-icon (fa icon) with ng-click function?", "I need to show an ionic-icon only when the button is clicked. \n\nI tried to put a class on that icon an did it:\n\n .icn { visibility: visible; }\n\n\nBut it didn't work, does someone know another way?" ]
[ "javascript", "css", "ionic-framework", "icons" ]
[ "\"terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc\" But it is strange, I have a lot of available memory", "I wrote a class, and than I used this to create another one and used both in a test program. My second class uses dynamic allocation so I followed the recommendations and create The Big Three, a creator, a copy creator and a destructor. But when I try to use a class friend operator the program stops and return the message above. Let me show some code:\n\nclass matrix\n{\npublic:\n int n;\n complex **M;\n matrix(int dim); //construtor\n matrix(int dim, double a);//construtor\n matrix(const matrix &obj);//construtor de copia (necessario para passar objetos para funções)\n ~matrix(); //destrutor\n friend matrix operator *(matrix a, matrix b);\n};\n\nmatrix::matrix(int dim) \n{\n int i = 0;\n n = dim;\n M = new complex*[dim];\n cout << \"criando objeto \\n\";\n\n for(i=0;i<n;i++)\n {\n M[i] = new complex [dim];\n }\n}\n\nmatrix::matrix(int dim, double a) \n{\n int i = 0, j = 0; \n n = dim;\n M = new complex*[dim];\n cout << \"criando objeto \\n\";\n\n for(i=0;i<n;i++)\n {\n M[i] = new complex [dim];\n }\n\n for(i=0;i <dim; i++){\n for(j=0; j<dim; j++){\n M[i][j] = complex(a,0); \n }\n }\n}\n\nmatrix::matrix(const matrix &obj)\n{\n int i = 0, j = 0;\n M = new complex*[n];\n cout << \"criando copia de objeto \\n\";\n\n for(i=0;i<n;i++)\n {\n M[i] = new complex [n];\n }\n\n for(i=0;i <n; i++){\n for(j=0; j<n; j++){\n M[i][j] = obj.M[i][j]; \n }\n }\n n = obj.n;\n}\n\nmatrix::~matrix()\n{\n int i;\n cout << \"destruindo obejto \\n\";\n for(i=0;i<n;i++)\n delete [] M[i];\n delete M;\n}\n\nmatrix operator *(matrix a, matrix b)\n{\n int i,j,k;\n matrix mult(a.n, 0);\n bool dim;\n if(a.n == b.n) dim = true;\n else dim = false;\n if(dim == true) \n { \n for(i=0; i < a.n; i++){ \n for(j=0; j < a.n; j++){\n for(k=0; k < a.n; k++){ \n mult.M[i][j] = mult.M[i][j] + a.M[i][k]*b.M[k][j];\n }\n }\n }\n return mult;\n }\n else return zeros(a.n);\n}\n\n\nWell, I really don't know why I'm getting this error message, I would be grateful if anyone could help me to solve this out." ]
[ "c++", "pointers", "runtime-error", "delete-operator" ]
[ "Activerecord syntax of where clause on joins", "I want to select all Line items that have an order that has been created between two dates (order has the column date)\n\nHere's what im trying to do\n\nLineItem.where(:product_id => self.id).joins(:order).where(:orders => {\"date > ? and date < ?\", date_start, date_end}).all\n\n\nI cant figure out the syntax of the last condition...\nI know this kind of where do work:\n\n.where(\"date > ? and date < ?\", date_start, date_end)\n\n\nand this kind of where too:\n\n.where(:orders => {:id => 23043})\n\n\nbut how can i do a mix of the two kinds so i can get something like the first request?" ]
[ "ruby-on-rails", "ruby", "activerecord" ]
[ "Android - Cron String and Cron Job with Quartz", "I am working on a Android project that needs to run cron jobs by parsing cron strings.\n\nI am using Quartz library. But I get exception below\nCan you help me on this subject? You can also suggest another api or solution?\n\n\n 09-04 14:36:44.050 4907-4907/? E/AndroidRuntime﹕ FATAL EXCEPTION:\n main\n java.lang.NoClassDefFoundError: java.beans.Introspector\n at org.quartz.impl.StdSchedulerFactory.setBeanProps(StdSchedulerFactory.java:1393)\n at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:849)\n at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1519)\n\n\nThanks for any help!" ]
[ "android", "cron", "quartz-scheduler", "crontrigger" ]
[ "spark-shell: strange behavior with import", "I am working in a spark-shell (Spark version 2.1.0, Using Scala version 2.11.8, OpenJDK 64-Bit Server VM, 1.7.0_151).\n\nI import Column class:\n\nscala> import org.apache.spark.sql.Column\nimport org.apache.spark.sql.Column\n\n\nI can define a Column object:\n\nscala> val myCol: Column = col(\"blah\")\nmyCol: org.apache.spark.sql.Column = blah\n\n\nand use Column in a function definition:\n\nscala> def myFunc(c: Column) = ()\nmyFunc: (c: org.apache.spark.sql.Column)Unit\n\n\nSo far so good.\nBut when defining a class, Columnis not found:\n\nscala> case class myClass(c: Column)\n<console>:11: error: not found: type Column\n case class myClass(c: Column)\n\n\nHowever a one-liner works:\n\nscala> case class myClass(c: org.apache.spark.sql.Column)\ndefined class myClass\n\n\nor\n\nscala> import org.apache.spark.sql.Column; case class myClass(c: Column)\nimport org.apache.spark.sql.Column\ndefined class myClass" ]
[ "scala", "shell", "apache-spark", "scala-repl" ]
[ "One script that downloads OpenImage, ImageNet, COCO", "I need images and annotations for cell phones, and most public visual datasets have the class, such as OpenImage, ImageNet, COCO. I am using openimages, and manually downloads from cocodataset and imagenet.\nIs there any script that allows me to download specific images+annotations by class ID from these public visual repositories?" ]
[ "dataset", "object-detection", "yolo", "imagenet" ]
[ "Wireshark and T Shark DNS", "I’m creating a small script to take the output from tshark and print it out to terminal. I'm trying to to only filter by requests made through the browser address bar.\n\nSo when www.facebook.com is loaded, the terminal only prints out facebook.com, rather than fbstatic-a.akamaihd.net etc .. (other DNS requests made through the requested website)\n\nThis program loops forever repeating dns requests and writes to the terminal.\n\nAny ideas?" ]
[ "shell", "wireshark", "tshark" ]
[ "Python RBTools: get reviewers", "I have a RB root:\n\napi_client = RBClient(...)\nroot = api_client.get_root()\n\n\nI can get files associated with a review request via:\n\nfiles = root.get_files(review_request_id=1, diff_revision=1)\n\n\nI would like to get information about Reviewers(group, people) for this review request, id 1\n\nWhat can I do to get that information?\n\nsomething like root.get_reviewers(review_request_id=1)" ]
[ "python", "review-board", "rbtools" ]
[ "Buddy devops build fail: java11", "When I run my build with mvn clean install locally its all ok, I use java11.\n\nbut when my pipeline in Buddy wants to run it I get this error\n\n`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project web-testing: Fatal error compiling: invalid target release: 11 -> [Help 1]`\n\n\nIs there a way or something I have to run before so its java is set to 11?\n\nEdit:\nfound it in the environment select openjdk11" ]
[ "maven", "build", "continuous-deployment", "java-11", "maven-compiler-plugin" ]
[ "cant hide link with z-index", "I have a hyperlink positioned absolutely in the bottom right, but I don't want it visible when the view gets to the section it's linking to. My first thought was to use a Z-Index, but something is off.\n\nHTML:\n\n <div class=\"gallery\">\n </div> \n <a href=\"#info\">Details</a>\n <div name=\"info\" class=\"textblock\">\n </div>\n\n\n\n\ncss:\n\n #details{\n position: fixed;\n bottom: 00px;\n right: 0px;\n z-index:0;\n }\n\n .textblock{\n z-index:50;\n }\n\n\nIf you'd like to see it in real time, its right here. My stylesheet is at the bottom of the list I believe wordpress named it \"inline style sheet #11\" I'm fully aware the gallery is garbage, I haven't swapped out with the 'photo-gallery' nor updated the photos for that matter." ]
[ "html", "css", "hyperlink", "z-index" ]
[ "Replace an object completely", "I try to replace a complete object (property) in a Polymer element, and I tried several possibilities, but none actually works...\n\nHere is what I came up with so far:\n\nprefill: function() {\n randomChild(function(r) {\n\n // Does not work\n var t = Object.assign(this.child, r); // r is an existing Child-object\n this.set(\"child\", t);\n\n // Does not work\n this.child.firstName = r.firstName;\n\n // Works\n this.set(\"child.firstName\", r.firstName);\n\n // Also works\n this.child.lastName = r.lastName;\n this.notifyPath(\"child.lastName\");\n }.bind(this));\n}\n\n\nHow can I just replace this.child with r without calling this.notifyPath(\"...\") for each subproperty ?" ]
[ "javascript", "polymer", "polymer-1.0" ]
[ "What’s the best way to capitalise the first letter of each word in a string in SQL Server", "What’s the best way to capitalise the first letter of each word in a string in SQL Server." ]
[ "sql", "sql-server", "string" ]
[ "Why is initial value not set in Material UI Autocomplete using react-hook-form?", "I am using react-hook-form(https://react-hook-form.com/\n) in my demo.\n\nI am not able to set the default value of AutoComplete. I already tried defaultValue as mention in the documentation but it is not working.\nHere is my code:\n\nhttps://codesandbox.io/s/react-hook-form-get-started-v24jk\n\n const { register, handleSubmit, setValue } = useForm({\n defaultValues: {\n resolutionCode: 1993\n }\n });\n\n\nexpected output Schindler's List value should be selected" ]
[ "javascript", "reactjs", "react-hooks", "react-hook-form" ]
[ "How to pass a value to a class from another file or command prompt", "I have written a java program to merge multiple excel sheets into one excel and generated jar, and i run it using java -jar Merge_Excel.jar.\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.FileInputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.apache.poi.hssf.usermodel.HSSFRow;\nimport org.apache.poi.hssf.usermodel.HSSFCell;\nimport org.apache.poi.hssf.usermodel.HSSFSheet;\nimport org.apache.poi.hssf.usermodel.HSSFWorkbook;\n\npublic class Csv_Merge {\n public static void main(String[]args){\n try{\n\n File folder = new File(\"c:/test/\");\n File[] listOfFiles = folder.listFiles();\n HSSFWorkbook workbook=new HSSFWorkbook();\n\n for (File file : listOfFiles) {\n\n\n if (file.isFile()) {\n\n String thisline;\n ArrayList<String> al = null;\n ArrayList<ArrayList<String>> arlist = new ArrayList<ArrayList<String>>();\n\n HSSFSheet sheet = workbook.createSheet(file.getName());\n FileInputStream fis = new FileInputStream(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis));\n\n while ((thisline = br.readLine()) != null) {\n al = new ArrayList<String>();\n String strar[] = thisline.split(\",\");\n\n for (int j = 0; j < 5; j++) {\n for (int k = 1; k < arlist.size(); k++) {\n\n ArrayList<String> ardata = (ArrayList<String>) arlist.get(k);\n\n HSSFRow row = sheet.createRow((short) k);\n\n\n for (int p = 0; p < ardata.size(); p++) {\n\n HSSFCell cell = row.createCell((short) p);\n cell.setCellValue(ardata.get(p).toString());\n\n }\n }\n\n al.add(strar[j]);\n\n }\n\n arlist.add(al);\n }\n\n fis.close();\n FileOutputStream fileOut = new FileOutputStream(\"c:/test/new.xls\");\n workbook.write(fileOut);\n\n fileOut.flush();\n fileOut.close();\n br.close();\n }\n }\n\n System.out.println(\"Your excel file has been generated!\");\n\n } catch ( Exception ex ) {\n System.out.println(ex);\n\n }\n }\n}\n\n\nI need to pass the location of excel path File folder = new File(\"c:/test/\"); and the new merged file path FileOutputStream fileOut = new FileOutputStream(\"c:/test/new.xls\"); from command prompt or from different file ,just the path. \n\nIs there any way to do it \n\nThanks" ]
[ "java", "apache-poi" ]
[ "Java JPA: adding further objects (products) to a already saved entity (store)", "I have a many-to-many relationship between Stores and Products, represented by the following code (mostly based in this answer):\n\n@Entity\n@Table(name = \"Store\")\npublic class Store {\n private long idStore;\n // ...\n private Collection<StoreHasProduct> storeHasProducts = new ArrayList<>();\n\n @OneToMany(mappedBy = \"store\", cascade = {CascadeType.MERGE, CascadeType.PERSIST}, fetch = FetchType.EAGER)\n public Collection<StoreHasProduct> getStoreHasProducts() {\n return storeHasProducts;\n }\n\n public void setStoreHasProducts(Collection<StoreHasProduct> storeHasProducts) {\n this.storeHasProducts = storeHasProducts;\n }\n}\n\n@Entity\n@Table(name=\"Product\")\npublic class Product {\n private long idProduct;\n // ...\n private Collection<StoreHasProduct> storeHasProducts = new ArrayList<>();\n\n @OneToMany(mappedBy = \"product\", fetch = FetchType.LAZY)\n public Collection<StoreHasProduct> getStoreHasProducts() {\n return storeHasProducts;\n }\n\n public void setStoreHasProducts(Collection<StoreHasProduct> storeHasProducts) {\n this.storeHasProducts = storeHasProducts;\n }\n}\n\n@Entity\n@Table(name = \"Store_has_Product\")\n@IdClass(StoreHasProductPK.class)\npublic class StoreHasProduct implements java.io.Serializable {\n\n @Id\n @ManyToOne\n @JoinColumn(name = \"Store_idStore\",updatable = true)\n private Store store;\n\n @Id\n @ManyToOne\n @JoinColumn(name = \"Product_idProduct\", updatable = true)\n private Product product;\n}\n\npublic class StoreHasProductPK implements java.io.Serializable {\n private Long store;\n private Long product;\n}\n\n\nAll basic insertion are working fine. However, when I try to add new Products to a existing Store I'm having a PersistentObjectException: detached entity passed to persist exception. This happens, for example, in the following test:\n\n@Test\n public void testAssignProductToAnExistingStore() throws Exception {\n //Create a store\n Store store = getStore();\n //Create and save a product\n Product product = getProduct();\n StoreHasProduct storeHasProduct = getStoreHasProduct(store, product);\n store.getStoreHasProducts().add(storeHasProduct);\n storeRepository.save(store);\n\n //Create and save a second product\n Product productTwo = getProduct();\n Store s = storeRepository.findOne(store.getIdStore());\n\n product.getStoreHasProducts().add(getStoreHasProduct(s, productTwo));\n productRepository.save(product);\n// s.getStoreHasProducts().add(getStoreHasProduct(s, productTwo));\n// storeRepository.save(s);\n\n }\n\n\nIf I try to persist the product, I get detached entity passed to persist: Product. If instead I try to persist the store (commented code) I get the same exception but for store.\n\nWhat should I do? I'm trying to use the CASCADE.DETACH, but I'm not sure if this is the appropriate path to follow.\n\nThanks" ]
[ "java", "entity-framework", "hibernate", "jpa" ]
[ "Socket HTTP request returning invalid GZIP", "I am teaching myself more about HTTP requests and such, so I wrote a simple POST request using Java's HttpURLConnection class and it returns compressed data which is easily decompress. I decided to go a lower level and send the HTTP request with sockets (for practice). I figured it out after a series of google searches, but there is one issue. When the server respondes with compressed data it isn't valid. Here is an image of a bit of debugging.\nhttp://i.imgur.com/KfAcero.png\n\nThe portion below the \"=\" separator line is the response when using a HttpURLConnection instance, but the portion above it is the response when using sockets. I'm not too sure what is going on here. The bottom part is valid, while the top is not.\n\nThe HttpParameter and header classes simply store a key and value.\n\npublic String sendPost(String host, String path, List<HttpParameter> parameters, List<HttpHeader> headers) throws UnknownHostException, IOException {\n String data = this.encodeParameters(parameters);\n Socket socket = new Socket(host, 80);\n PrintWriter writer = new PrintWriter(socket.getOutputStream());\n BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n writer.println(\"POST \" + path + \" HTTP/1.1\");\n for(HttpHeader header : headers) {\n writer.println(header.getField() + \": \" + header.getValue());\n }\n writer.println();\n writer.println(data);\n writer.flush();\n StringBuilder contentBuilder = new StringBuilder();\n for(String line; (line = reader.readLine()) != null;) {\n contentBuilder.append(line + \"\\n\");\n }\n reader.close();\n writer.close();\n return contentBuilder.toString();\n}" ]
[ "java", "sockets", "http", "gzip" ]
[ "how to call this function which requires self parameter", "I'm trying to test one function which returns the CLD features..\nit only requires use numpy library.. I'm testing it but it always says that requires a self parameter. I don't know why it is happening because the function only is receiving one image which I'm loading with opencv.\n\nHere is the class that I'm trying to use:\ncolorlayoutdescriptor.py\n\nimport numpy as np\n\nclass ColorLayoutDescriptor:\n def __init__(self):\n self.rows = 8\n self.cols = 8\n self.prefix = \"CLD\"\n\n def compute(self, img):\n averages = np.zeros((self.rows,self.cols,3))\n\n\nI expect to send one image to the method called compute and get one feature vector, now I'm getting this problem::\n\nimage = cv2.imread(\"test.jpg\")\nvector = ColorLayoutDescriptor.compute(image)\n\n\n\n TypeError: compute() missing 1 required positional argument: 'img'\n\n\nthanks so much." ]
[ "python", "function", "parameters", "self" ]
[ "Jitsi server hardware requirements on test environment", "We are implementing secure videoconferencing/chat using Jitsi. We could not find any hardware requirements for a Jitsi server. Could you please share your thoughts regarding the hardware requirements for a Jitsi server in test as well as production environment?\n\nThanks,\nSyed" ]
[ "server", "hardware", "video-conferencing", "jitsi" ]
[ "Location path security not working", "I have the following setup, but when I access the ManageContacts.aspx (from IIS express), it does not point me to the login.aspx, did I do anything wrong ? Simple password are for illustration purpose only.\n\n<location path=\"~/ManageContacts.aspx\">\n <system.web>\n <authorization>\n <deny users=\"?\"/>\n <allow users=\"admin\"/>\n </authorization>\n\n <authentication mode=\"Forms\">\n <forms loginUrl=\"~/Account/Login\">\n <credentials>\n <user name=\"admin\" password=\"123456\"/>\n </credentials>\n </forms>\n </authentication>\n\n </system.web>\n </location>" ]
[ "asp.net", "security" ]
[ "Show an image next to a result from MySQL in PHP?", "I'm pulling a table from a MySQL database, using PHP.\n\nThis is roughly the code I'm using, obviously I've got more columns, but this is the demo version of the code.\n\nAs you can see, the code is ordered by the Sales Name. Now what I want to do is, show a little icon next to the top ten sellers based on the Sales Count.\nSo, if a Sales Count is one of the top ten figures, it must show a little image next to it's name. \n\nCan this be done?\n\n<?php\n // Get all the data from the \"sales\" table\n $result = mysql_query(\"SELECT * FROM sales ORDER BY SalesName\") or die(mysql_error()); \n echo \"<table border='1'>\";\n echo \"<tr> <th>Sales Name</th> <th>Sales Count</th> </tr>\";\n while($row = mysql_fetch_array( $result )) {\n echo \"<tr><td>\"; \n echo $row['SalesName'];\n echo \"</td><td>\"; \n echo $row['SalesCount'];\n echo \"</td></tr>\"; \n } \n echo \"</table>\";\n?>" ]
[ "php", "mysql" ]
[ "Chrome not rendering math properly", "I use Chrome, (Version 63.0.3239.84 (Official Build) (64-bit)), and lately I have been getting what I believe are math rendering errors like this:\n\n\n\nWhat do I to remedy this? Thanks!" ]
[ "web", "webpage", "mathjax" ]
[ "Handling duplicate keys with ConfigParser", "Possible Duplicate:\n Python Config Parser (Duplicate Key Support) \n\n\n\n\nI'm trying to read an INI format project file in Python. The file contains duplicate keys (having unique values) within a section. For example, one of the sections looks like this:\n\n\n\n[Source Files]\nSource=\"file1.c\"\nSource=\"file2.c\"\nSource=\"file3.c\"\n\n\nIf I read this using the following code\n\nconfig = configparser.ConfigParser( strict=False )\nconfig.read( \"project/file/name\" )\nprint( config.get( \"Source Files\", \"Source\" ) )\n\n\nthe result is\n\n\"file3.c\"\n\n\nIs there any way to get a list of all the values for the key Source instead? I'm open to using some other method to parse the file.\n\nNote that I cannot change the file format." ]
[ "python", "python-3.x", "configparser" ]
[ "Calling C printf from assembly", "I would like to call the printf function from C with two integers.\nMy format string is:\n\nLC0:\n db \"odd bits: %d, even bits: %d\", 10, 0\n\n\nI have the integer ob and eb:\n\nob: DD 0\neb: DD 0\n\n\nand then I do at the end:\n\npush dword [ob]\npush dword [eb]\npush LC0\ncall printf\nadd esp,8\n\n\nHowever, this gives me the result Odd bits: [ob], Even bits: [ob, repeated] then gives me a segmentation fault.\nAm I calling the printf function wrong?\n\nEDIT:\nI added LC1 as db \"even bits: %d\", 10 0, then redid:\n\npush dword [ob]\npush LC0\ncall printf\npush dword [eb]\npush LC1\ncall printf\nadd esp, 8\n\n\nThis gives me a REVERSED result, giving the eb to the LC0 string, and ob to the LC1 string, and, it gives a segmentation fault at the end.\nAny clue?" ]
[ "c", "nasm" ]
[ "need help in understanding the code", "class Problem:\n\n \"\"\"\n This class outlines the structure of a search problem, but doesn't implement\n any of the methods (in object-oriented terminology: an abstract class).\n \"\"\"\n\n def getStartState(self):\n\n \"\"\"Returns the start state for the search problem\"\"\"\n\n sahan.raiseNotDefined()\n\n\nNow I want to know the meaning of above code? can I use the functions defined in the class in some other class functions as it is?\n\nWhat does the class doc string mean?" ]
[ "python", "oop" ]
[ "Can I delete missing associations using accepts_nested_attributes_for in rails?", "TL;DR\n\nThis seems like it should be really simple. I want to set up #accepts_nested_attributes_for such that when I save the parent class with any non-empty params set for the the child class, it deletes any other children that aren't directly referenced by their id in the params.\n\nFor some reason I'm really struggling to find a sensible way of doing this.\n\nThat's really it.\n\nLonger version\n\nI have a model, Pledge:\n\nclass Pledge < ActiveRecord::Base\n has_many :companies, dependent: :destroy\n accepts_nested_attributes_for :companies\n\n # Other stuff\nend\n\n\nAnd a corresponding Company model:\n\nclass Company < ActiveRecord::Base\n belongs_to :pledge\nend\n\n\nSuppose I have company_1 (id: 1, name: company_1) already saved on pledge_a, and I then call pledge_.update(params), where params either doesn't reference a company id, thus:\n\n{ \n \"someotherval\"=>\"5\",\n \"id\"=>\"10\",\n \"companies_attributes\"=>\n { \n \"0\"=>\n { \n \"name\"=>\"company_2\" \n }\n }\n}\n\n\nor (exactly as above, but) with a different id for the companies in question:\n\n{ \n \"someotherval\"=>\"5\",\n \"id\"=>\"10\",\n \"companies_attributes\"=>\n { \n \"0\"=>\n { \n \"id\"=>\"2\"\n \"name\"=>\"company_2\" \n }\n }\n}\n\n\nWhat's the simplest way to instruct Rails delete any companies that aren't included in the params, ie to create a fresh set every time I call #update with any present company in the nested params?\n\nI've tried quite a few things:\n\nUsing a before_save hook on Pledge to delete companies \n- this seemed to delete them after the companies were saved, so that I always ended up with a companyless-pledge\n\nBuilding up an array of companies by adding a :reject_if block to the accepts_nested_attributes_for a line and then using it for a destroy_all_companies after_save hook\n- this didn't work because at some point Rails seemed to re-initialize the pledge, so that by the time we hit the hook, the array had vanished\n\nWriting some code in the controller before I call #update to delete the companies\n- this is the hack I've been reduced to, but it's horrible. Firstly I don't always want to delete the companies if I'm passing in params that don't include any nested company params. Secondly I have to go through the params and delete any non-empty company #id values, otherwise Rails explodes when it can't find the company in question. Thirdly if the validations fail and the Pledge doesn't update, I've now deleted all the companies when I didn't want to.\n\nThere must be a saner way to do this... right?" ]
[ "ruby-on-rails", "accepts-nested-attributes" ]
[ "My leaflet Map just stopped Loading properly", "My map has been working well, but just recently, only the markers are showing but the rest of the map is not showing. \nImage 1: Map View\nMap view with only markers showing || Image 2: Console error\nConsole error from the map page" ]
[ "javascript", "leaflet" ]
[ "How to respond to an alternate URI in a RESTful web service", "I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send an HTTP 3xx redirect to the canonical URI? Is HTTP 303 (see also) the most appropriate redirect?\n\nClarification: the HTTP specification makes it clear that the choice of redirect depends on which URI future requests should use. In my application, the 'canonical' URI is the most stable of the alternatives; an alternative URI will always direct to same canonical URI, or become invalid." ]
[ "language-agnostic", "http", "rest" ]
[ "Member function with const modifier.", "I have a class with two member functions which are differ only by const modifier. \n\nclass CFoo\n{\nprivate:\n int x;\n int y;\npublic:\n static int a;\n void dosmth() const {\n a = 99;\n }\n void dosmth(){\n x++;\n y++;\n }\n};\n\nint CFoo::a = 100;\n\nint main(){\n CFoo foo;\n cout << CFoo::a << endl;\n foo.dosmth();\n cout << CFoo::a << endl;\n}\n\n\nThe following code prints 100, 100. Why is non-const dosmth being called? How can I call const version explicitly?" ]
[ "c++", "overloading" ]
[ "AJAX correctly handle special symbol 'enter key' | It is rendered as an empty string but not handled as empty", "I use laravel/php.\n\nI use AJAX to retrieve some data form a database.\n\nI noticed the following issue:\n\nIf a user presses the enter key and submits the form, the database saves these presses and they look like this in the response:\n\ndescription: \"↵↵\"\n\n\nThe problem is that for me it looks like an empty string in my input field:\n\n\n\nI actually filter all empty strings like this when I get the object:\n\n$result = DB::connection('mysql_live')->table('users')\n->where('description', '!=', '')->where('descriptionCheck', 'No')->first();\n\n\nI return is like this:\n\nreturn ['success' => true, 'result' => $result];\n\n\nWhats the correct way to handle this? It seems that other special symbols usually work." ]
[ "php", "json", "ajax", "laravel", "response" ]
[ "How to stop Vim from opening a new window when opening file in readonly window?", "I'm using the MiniBufExplorer plugin to display a list of open buffers at the top of my Vim window. I'm also using the FuzzyFinder plugin to open files, in case that matters.\n\nThe problem is that, if I have the -MiniBufExplorer- window focused, and I open a file, the window will split:\n\nMMMMMM MMMMMM\nAAAAAA AAAAAA M = -MiniBufExplorer-\nAAAAAA --> AAAAAA A = some open file\nAAAAAA BBBBBB B = the file I just opened\nAAAAAA BBBBBB\n\n\nMy guess is that Vim determines that the -MiniBufExplorer- window should not be used to open a file in, and decides to create a new window to hold the new buffer.\n\nInstead, I want file B simply to be opened in the window previously occupied by A. If A's window has focus, this happens the way I want it to; it's just when -MiniBufExplorer- is focused that I get the unwanted split.\n\nI'm not proficient at Vim scripting, and not very familiar with the windowing/buffers model, so I don't know how difficult it is to accomplish this. Any ideas?" ]
[ "vim" ]
[ "Add firebase cloud function in existing project", "I have a project which contains Firebase and already runs. Today I need to add cloud functions inside. But I don't know how to add it in a running project. I didn't find proper documents for my case.\nWhat would happened if I tried init firebase and checked cloud functions only in my current project. Will it delete my previous setup (i have installed Firestore, storage,etc)?" ]
[ "firebase", "google-cloud-functions" ]
[ "titanium disable device rotation & fix so only one mode ever shown", "how do i fix the device rotation in a titanium app across all mobile platforms? Any references to official doco would be super useful!\n\nso i don't want to so much \"disable rotation\" as \"only ever let the app run in a particular orientation\" (which in my case is portrait mode)\n\ncheers" ]
[ "titanium" ]
[ "can't find my file after file upload in php", "I was using the following php script to upload a file:\n\n<?php\n$dest_dir=\"C:\\Users\\Maria\\Documents\\IT-learning\";\nforeach ($_FILES as $file_name => $file_array) { \n echo \"path: \".$file_array['tmp_name'].\"<br/>\\n\"; //output is \"C:\\Windows\\Temp\\phpB4C9.tmp\" instead\n echo \"name: \".$file_array['name'].\"<br/>\\n\";\n echo \"type: \".$file_array['type'].\"<br/>\\n\";\n echo \"size: \".$file_array['size'].\"<br/>\\n\";\n\n if (is_uploaded_file($file_array['tmp_name'])) {\n move_uploaded_file($file_array['tmp_name'], $dest_dir.$file_array['name'])\n or die (\"file exists but can't be moved\");\n echo \"File uploaded successfully.\";\n } else {\n echo \"File does not exist.\";\n }\n} //single file is fine. opened single file is \n?>\n\n\nThe output is like this:\n\npath: C:\\Windows\\Temp\\phpB4C9.tmp\nname: test2.xml\ntype: text/xml\nsize: 4523\nFile uploaded successfully.\n\n\nMy problem is I don't see the test2.xml file on my computer except in the original directory. From my understanding, I should see it moved to C:\\Users\\Maria\\Documents\\IT-learning. But I don't see it either in C:\\Users\\Maria\\Documents\\IT-learning or in C:\\Windows\\Temp\\phpB4C9.tmp. \n\nDo I miss-understand anything?" ]
[ "php", "html", "windows" ]
[ "HQL Query fails in Hibernate MySQL", "I want to recuperate all rows from user table.\n\nString queryS = \"select u from user u\";\n System.out.println(\"entityManager: \"+(entityManager == null));\n Query query = entityManager.createQuery(queryS);\n//staff\n\n\nThe line that throws the exception is Query query = entityManager.createQuery(queryS);\n\nI don't know why even persistance file is ok and the table exists\n\nThe stack is:\n\n10:36:06.693 [AWT-EventQueue-0] DEBUG org.hibernate.hql.ast.ErrorCounter - throwQueryException() : no errors\n10:36:06.693 [AWT-EventQueue-0] DEBUG o.h.hql.antlr.HqlSqlBaseWalker - select << begin [level=1, statement=select]" ]
[ "mysql", "hibernate", "hql" ]
[ "Why doesn't the directory I created appear in both Gallery and Google Photos?", "In my CameraFragment.java I have a library called nataro1 CameraView which basically allows me to open up the device's camera and take a photo. That photo is saved in a directory created by the app, called \"Feel\". Everything works fine, the directory is created and the photos are stored there. The problem is, whenever I try to see them in the Gallery or in Google Photos, I can't. There is no directory and no photos. If I want to see them I must go to \"Settings/Storage/InternalStorage/Explore/Pictures\". Why can't I see the directory in Gallery and in Google Photos?\nThis is the code I have:\n\n private void saveImage(Bitmap finalBitmap, String image_name) {\n\n final String appDirectoryName = \"/Feel\"; // Nome da pasta onde irão ser guardadas as fotos\n String root = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES).toString() + appDirectoryName; // Caminho do root da galeria do telemóvel\n File myDir = new File(root); // Declara um novo ficheiro com o nome do root + \"/Feel\"\n if(!myDir.exists()){ // Caso o diretório ainda não exista...\n myDir.mkdirs(); // ... cria um com esse nome\n }\n String fname = \"Image\" + image_name + \".jpg\"; // Concatena o nome da imagem com a extensão \".JPG\"\n File file = new File(myDir, fname); // Declara um novo ficheiro com o caminho e o nome da imagem\n Log.i(\"LOAD\", root + fname);\n try { // Caso dê erro...\n FileOutputStream out = new FileOutputStream(file); // Declara um OutputStream\n finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out); // Cria e comprime o ficheiro\n out.flush();\n out.close(); // Fecha o output\n } catch (Exception e) { // ... não dá crash\n e.printStackTrace();\n }\n\n}" ]
[ "java", "android" ]
[ "How to handle Azure's UTC time", "So Azure stores datetimes in UTC. What is the best way to handle it if my system need to have timestamps in, say, US Eastern Time? Do I store them in utc, but handle just displaying timestamps by formatting them? Do I format/offset timestamps before storing them in the database? What is the best practice for solving this issue?" ]
[ "azure" ]
[ "Calling Python through ssh in Python script causes \"Illegal instruction (core dumped)\"", "I have a Python script call.py to log in to another machine through ssh and execute another Python script saved on this machine, something like this\n# call.py\nimport os\n\n# log into user@host machine and execute python script\nos.system("sshpass -p password ssh user@host '( python3 my_script.py )'")\n\n\nbut when I try to run it I get this error\nIllegal instruction (core dumped) ( python3 my_script.py )\n\nI tried a few things:\n\nIf I log into ssh and launch python3 my_script.py through the terminal it works\nI also tried running the same call.py script without the ssh part, so trying to launch my_script.py on the same machine and it works\n\nIt seems that only the combination of ssh + python inside python that gives me this error. Any pointers on what could cause the error will be very much appreciated.\nEdit: I didn't realize it would play a role, but I'm adding now the important detail that the target machine is an Nvidia Jetson board." ]
[ "python", "python-3.x", "ssh", "nvidia-jetson" ]
[ "*.aclpolicy file not works - Auth using Active Directory", "Summarizing my environment:\n\nRunning Rundeck (3.3.11) at Kuberenetes Cluster\nDedicated Database MariaDB connected via JDBC Connector.\nConfigured Active Directory via JAAS using the variables RUNDECK_JAAS_LDAP_ * and auth working, I can logon using my AD user.\nConfigured ACL Policy template using K8s Secret like in this Zoo sample:\n\n volumeMounts:\n - name: aclpolicy\n mountPath: /home/rundeck/etc/rundeck-adm.aclpolicy\n subPath: rundeck-adm.aclpolicy\n volumes:\n - name: aclpolicy\n secret:\n secretName: rundeck-adm-policy\n items:\n - key: rundeck-admin-role.yaml\n path: rundeck-adm.aclpolicy\n\nVariables exported to Rundeck Pod:\nRUNDECK_JAAS_MODULES_0=JettyCombinedLdapLoginModule\nRUNDECK_JAAS_LDAP_USERBASEDN=OU=Users,OU=MYBRAND,DC=corp,DC=MYDOMAIN\nRUNDECK_JAAS_LDAP_ROLEBASEDN=OU=RundeckRoles,OU=Users,OU=MYBRAND,DC=corp,DC=MYDOMAIN\nRUNDECK_JAAS_LDAP_FLAG=sufficient\[email protected]\nRUNDECK_JAAS_LDAP_BINDPASSWORD=foo\n\nIn my MS Active Directory the structure is:\n-mybrand.mydomain\n - MYBRAND\n - Users\n - RundeckRoles\n - rundeck-adm (group with my user associated)\n\n\nAfter I login returns this screen:\n\nEDIT1:\nMy rundeck-admin-role.yaml:\ndescription: Admin project level access control. Applies to resources within a specific project.\ncontext:\n project: '.*' # all projects\nfor:\n resource:\n - equals:\n kind: job\n allow: [create] # allow create jobs\n - equals:\n kind: node\n allow: [read,create,update,refresh] # allow refresh node sources\n - equals:\n kind: event\n allow: [read,create] # allow read/create events\n adhoc:\n - allow: [read,run,runAs,kill,killAs] # allow running/killing adhoc jobs\n job:\n - allow: [create,read,update,delete,run,runAs,kill,killAs] # allow create/read/write/delete/run/kill of all jobs\n node:\n - allow: [read,run] # allow read/run for nodes\nby:\n group: rundeck-adm\n\n---\n\ndescription: Admin Application level access control, applies to creating/deleting projects, admin of user profiles, viewing projects and reading system information.\ncontext:\n application: 'rundeck'\nfor:\n resource:\n - equals:\n kind: project\n allow: [create] # allow create of projects\n - equals:\n kind: system\n allow: [read,enable_executions,disable_executions,admin] # allow read of system info, enable/disable all executions\n - equals:\n kind: system_acl\n allow: [read,create,update,delete,admin] # allow modifying system ACL files\n - equals:\n kind: user\n allow: [admin] # allow modify user profiles\n project:\n - match:\n name: '.*'\n allow: [read,import,export,configure,delete,admin] # allow full access of all projects or use 'admin'\n project_acl:\n - match:\n name: '.*'\n allow: [read,create,update,delete,admin] # allow modifying project-specific ACL files\n storage:\n - allow: [read,create,update,delete] # allow access for /ssh-key/* storage content\n\nby:\n group: rundeck-adm\n\n\nSomeone can help me to find my mistake?" ]
[ "authentication", "rundeck" ]
[ "AlarmManager inconsistency", "I'm using an AlarmManager to send a broadcast while the screen is off. This works fine on most devices, but on some (e.g. Samsung Galaxy S4), it takes 30, 40, or even 120 seconds instead of the specified 20s until the broadcast is received. I don't have access to the devices on which this is happening so I can't check the logcat.\n\nThis is how I'm setting up the AlarmManager:\n\nAlarmManager mAlarmManager=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);\nlong mInterval = 20 * 1000;\nIntent i = new Intent();\ni.setAction(MY_ACTION);\nmPendingIntent = PendingIntent.getBroadcast(mContext, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);\nmAlarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + mInterval, mPendingIntent);\n\n\nAnd this is the receiver, registered in the manifest:\n\nprivate class MyIntentReceiver extends BroadcastReceiver {\n\n private static final String TAG = \"MyIntentReceiver\";\n\n @Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(MY_ACTION)) {\n\n PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\n PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, \"\");\n wl.acquire();\n\n Log.e(TAG, \"onReceive\");\n\n //Carry out my action...\n\n\n wl.release();\n\n }\n }\n\n}" ]
[ "android", "broadcastreceiver", "alarmmanager" ]
[ "How to wait until a function which contains an AJAX request is done?", "I tried something like this :\n\n// ...\nSaveSomething: function () {\n var item1 = \"\" //something;\n MyTools.Ajax(\"SaveSomething\", {\n item: item1\n }).done(function (res) {\n return res.list;\n });\n},\n// ...\n\n\nAnd there is the function that calls this SaveSomething function (part of a singleton)\n\n// This is not working at all...\nfunction SaveSomethingProcess() {\n $.when(MyObject.SaveSomething()).done(function (res) {\n console.log(res);\n });\n}\n\n\nI want to be able from somewhere else to call var k = SaveSomethingProcess();, wait the inner's AJAX call SaveSomething to be done and take the res object to the k variable.\n\nIs it possible with promises or something?" ]
[ "javascript", "jquery", "ajax" ]
[ "google maps native ionic 2 marker pixelated", "When I put a marker with a large icon, I can not resize it, and when I put a small image it gets pixelated\n\n let icon = 'www/assets/images/car3.png';\n let position: GoogleMapsLatLng = new GoogleMapsLatLng(0,0);\n let markerOptions: GoogleMapsMarkerOptions = {\n position: position,\n icon:icon\n };" ]
[ "cordova", "google-maps", "ionic2" ]
[ "JQuery and geolocation not sending any data", "Good day,\n\nI am trying to create a script that loads my Browser Geolocation and following sends it to a file that saves it.\n\nThe problem is. The data does not get send.\nAnd an even bigger problem is that I have tried many things but I am quite clueless.\n\nI added several alerts but the alerts do not show up.\n\nWhat should the script do?\nRun once every five seconds and requesting your GeoLocation.\nWhen you click accept on your phone and accept for all from this source you will have an active GPS alike tracking.\n\nThe code :\n\n <script type=\"text/javascript\">\n function success(position) {\n ///SaveActiveGeoLocation();\n }\n\n function error(msg) {\n var s = document.querySelector('#status');\n s.innerHTML = typeof msg == 'string' ? msg : \"failed\";\n s.className = 'fail';\n\n // console.log(arguments);\n }\n\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(success, error);\n }\n else{\n error('not supported');\n }\n\n\n function SaveGeoLocation(){\n var Lat = position.coords.latitude;\n var Lon = position.coords.longitude;\n var Accuracy = position.coords.accuracy;\n\n ///######## SENDING THE INFORMATION BY AJAX\n $.ajax({\n type : \"POST\", /// **** SEND TYPE\n url : \"savegeo.php\", /// **** TARGET FILE TO FETCH THE DATA\n data : { \n 'Lat' : Lat,\n 'Lon' : Lon,\n 'GeoAccuracy' : Accuracy\n },\n ///######## IN CASE OF SUCCESS\n success:function(response){\n if( response == \"ok\" ){\n alert('SEND!');\n }\n else{\n alert( \"Response = \" + response );\n }\n }\n }\n );\n }\n\n\n\n $(document).ready(function() {\n $.ajaxSetup({\n cache: false\n }); // This part addresses an IE bug. without it, IE will only load the first number and will never refresh\n setInterval(function() {\n ///alert('HOI!');\n SaveGeoLocation();\n }, 5000);\n\n // the \"10000\" here refers to the time to refresh the div. it is in milliseconds.\n\n /// **** DEFAULT LOADING\n ///SaveGeoLocation();\n });\n </script>\n\n\nThe file that saves the send POST data :\n\n<?php\ninclude('function.geolocation.class.php');\n\n$geo = new GeoLocation();\n\n$Lat = $_POST['Lat'];\n$Lon = $_POST['Lon'];\n$GeoAccuracy = $_POST['GeoAccuracy'];\n$IP = $geo->GetIP();\n$file = 'location.txt';\n$address = $geo->getAddress($Lat, $Lon);\n\n$contents = $Lat.'|'.$Lon.'|'.$IP.'|'.$GeoAccuracy.'|'.date('Y-m-d H:i:s').'|'.$address.PHP_EOL;\n$handle = fopen($file, 'a');\nfwrite($handle, $contents);\nfclose($handle);\n\necho 'ok';\n?>" ]
[ "php", "jquery", "geolocation" ]
[ "How to query multiple databases using sequelize(orm) in node.js", "I use the Express node.js. With sequelize(mariadb).\n\nshow databases;\nDatabase\n> user\n> board\n\n\nI would like to use to create two database connections from a single website.\n\nDirectory Structure\n\nmodels\n|- user\n |- user.js \n|- board\n |- board.js\n |- comment.js\n\n\nconfig.json\n\n{\n \"development\": {\n \"username\": \"root\",\n \"password\": \"test1234\",\n \"database\": \"testDB\",\n \"host\": \"127.0.0.1\",\n \"port\": 3306,\n \"dialect\": \"mariadb\",\n \"define\": {\n \"charset\": \"utf8\",\n \"collate\": \"utf8_general_ci\"\n },\n \"pool\": {\n \"max\": 5,\n \"min\": 0,\n \"idle\": 10000\n }\n }\n}\n\n\nIn the directory structure above, I need how to set sequelize connection.\n\nOne database connection has implemented a reporting api.\nhttp://docs.sequelizejs.com/en/1.7.0/articles/express/\n\nI have a lot of beginners. This little detail is required. ( ex. directory structure, config.json, index.js and so on )\n\nSorry, Do not speak English well.\n\nHave a nice day!" ]
[ "node.js", "orm", "connection", "sequelize.js", "mariadb" ]
[ "How to access child function from parent class", "class hydra {\n var $dbcon;\n\n function __construct($ezSQL){\n $this -> dbcon=$ezSQL;\n }\n\n }\n class user extends hydra{\n function foo(){\n echo \"bar is: \".$this->dbcon;\n }\n }\n\n\nI then call:\n\n$hydra = new hydra($ezSQL);\n\n\nHowever, at this point I get the following error:\n\nFatal error: Cannot instantiate abstract class hydra\n\n\nHow do set up a class that will inherit all of it's children's functions so I can do something like this:\n\n$hydra = new hydra(\"foobar\");\n$hydra -> foo();\n\n\noutput:\n\n\n bar is: foobar" ]
[ "php", "oop", "abstract-class" ]
[ "Java - Don't know how to call a public enum class", "I'am a little bit new in Java ...\n\nHere is the Java sources that I want to implement.\n\nFirst I define a public enum class like that :\n\npublic enum Day {\nSUNDAY, MONDAY, TUESDAY, WEDNESDAY,\nTHURSDAY, FRIDAY, SATURDAY \n}\n\n\nNow I create a class like that :\n\nimport java.time.*;\n\npublic class EnumTest {\nDay day;\n\npublic EnumTest(Day day) {\n this.day = day;\n}\n\npublic void tellItLikeItIs() {\n switch (day) {\n case MONDAY:\n System.out.println(\"Mondays are bad.\");\n break;\n\n case FRIDAY:\n System.out.println(\"Fridays are better.\");\n break;\n\n case SATURDAY: case SUNDAY:\n System.out.println(\"Weekends are best.\");\n break;\n\n default:\n System.out.println(\"Midweek days are so-so.\");\n break;\n }\n}\n\npublic static void main(String[] args) {\n EnumTest firstDay = new EnumTest(Day.MONDAY);\n firstDay.tellItLikeItIs();\n EnumTest thirdDay = new EnumTest(Day.WEDNESDAY);\n thirdDay.tellItLikeItIs();\n EnumTest fifthDay = new EnumTest(Day.FRIDAY);\n fifthDay.tellItLikeItIs();\n EnumTest sixthDay = new EnumTest(Day.SATURDAY);\n sixthDay.tellItLikeItIs();\n EnumTest seventhDay = new EnumTest(Day.SUNDAY);\n seventhDay.tellItLikeItIs();\n}\n}\n\n\nWhen I compile the EnumTest class' I get this error :\n\nC:\\java>javac EnumTest.java\nEnumTest.java:4: error: class Day is public, should be declared in a file named\nDay.java\npublic enum Day {\n ^\n1 error\n\n\nCould you help me ?\nThank you\nMeir" ]
[ "java" ]
[ "ApiAxle: Modifying timeout parameter if backend server is slow to respond", "I am following the instructions at: and am getting the error: http://apiaxle.com/docs/try-it-now/\n\n{\"meta\":{\"version\":1,\"status_code\":504},\n\"results\":{\"error\":{\"type\":\"EndpointTimeoutError\",\n\"message\":\"API endpoint timed out.\"}}}\n\n\nI'm searching on google but have not yet found how to set a larger timeout." ]
[ "timeout", "apiaxle" ]
[ "formatting content in easygui mesage box and adding scrollbar", "After this code runs, I would like the results to appear in a message box as separate lines of text, and not as tuples (which is what is happening now). Essentially I would like to see the results in the message box just as they would if I printed the line in pyscripter:\n\nprint ext_str+ext,cnt_str,len(sz),max_str,max(sz),min_str,min(sz), avg_str,calc_avg(sz)\n\n\ngives a result that looks like this in the message box (but the lines can wrap):\n\nfile type:.mxd count: 5 max. size: 3155968 min. size: 467968 avg. size: 1383014.0\nfile type:.3dd count: 1 max. size: 836608 min. size: 836608 avg. size: 836608.0\n\nI would also like to be able to add a vertical scrollbar to the message box, because right now if the contents are too long there is no way to close the dialog. I can't seem to figure out a way to do it with easygui - I know tkinter could be an option but I don't really know it too well. Can these two things be done? Here is my code:\n\nimport os, sys, easygui\nfrom collections import defaultdict\n\na_dir = easygui.enterbox(\"Type in directory path:\",title='Directory Stats')\nif a_dir is None or a_dir == '' :\n sys.exit()\nelse:\n os.chdir(a_dir)\n mydir = os.listdir(os.curdir)\n\nfiledict = {}\next_str = 'file type:'\ncnt_str = 'count:'\nmax_str = 'max. size:'\nmin_str = 'min. size:'\navg_str = 'avg. size:'\nsmmry_title = 'Summary of directory contents: '+ a_dir\nstats_lst = []\n\ndef calc_avg(num_list):\n return round(sum (num_list) / len(num_list))\n\nfor file in mydir:\n fileext = os.path.splitext(file)[1]\n filesz = os.path.getsize(file)\n filedict.setdefault(fileext,[]).append(filesz)\n\nfor ext, sz in filedict.items():\n stats = ext_str+ext,cnt_str,len(sz),max_str,max(sz),min_str,min(sz), avg_str,calc_avg(sz)\n stats_lst.append(stats)\n stats_str = '\\n'.join(map(str, stats_lst))\nmsg = easygui.msgbox(msg=stats_str,title=smmry_title)" ]
[ "python", "formatting", "scrollbar", "easygui" ]
[ "BadZipFile Error during airflow initdb, issue with dag", "I wrote a dag, placed it in airflow/dags in a vm and when I run airflow initdb I get the following problem\n\n(env) (base) xxxx@XXXXXX:~/airflow/dags$ airflow initdb\n[2020-02-27 08:06:19,564] {settings.py:253} INFO - settings.configure_orm(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=105407\nDB: postgresql+psycopg2://bn_airflow%40XXXXXXX?sslmode=require\n[2020-02-27 08:06:20,236] {db.py:368} INFO - Creating tables\nINFO [alembic.runtime.migration] Context impl PostgresqlImpl.\nINFO [alembic.runtime.migration] Will assume transactional DDL.\nERROR [airflow.models.dagbag.DagBag] Bad magic number for central directory\nTraceback (most recent call last):\n File \"/home/pgkrdatahub/.local/lib/python3.6/site-packages/airflow/models/dagbag.py\", line 420, in collect_dags\n safe_mode=safe_mode)\n File \"/home/pgkrdatahub/.local/lib/python3.6/site-packages/airflow/models/dagbag.py\", line 251, in process_file\n zip_file = zipfile.ZipFile(filepath)\n File \"/usr/lib/python3.6/zipfile.py\", line 1131, in __init__\n self._RealGetContents()\n File \"/usr/lib/python3.6/zipfile.py\", line 1226, in _RealGetContents\n raise BadZipFile(\"Bad magic number for central directory\")\nzipfile.BadZipFile: Bad magic number for central directory\nERROR [airflow.models.dagbag.DagBag] Bad magic number for central directory\nTraceback (most recent call last):\n File \"/home/pgkrdatahub/.local/lib/python3.6/site-packages/airflow/models/dagbag.py\", line 420, in collect_dags\n safe_mode=safe_mode)\n File \"/home/pgkrdatahub/.local/lib/python3.6/site-packages/airflow/models/dagbag.py\", line 251, in process_file\n zip_file = zipfile.ZipFile(filepath)\n File \"/usr/lib/python3.6/zipfile.py\", line 1131, in __init__\n self._RealGetContents()\n File \"/usr/lib/python3.6/zipfile.py\", line 1226, in _RealGetContents\n raise BadZipFile(\"Bad magic number for central directory\")\nzipfile.BadZipFile: Bad magic number for central directory\nDone.\n\n\nIm not entirely sure what the issue is. I looked at the source code and I think its somehow expecting a zip file when there are none in the dags folder\n\ndags contains\n\nenv) (base) pgkrdatahub@xxx:~/airflow/dags$ ls -al\ntotal 32\ndrwxrwxr-x 5 pgkrdatahub pgkrdatahub 4096 Feb 27 08:06 .\ndrwxrwxr-x 4 pgkrdatahub pgkrdatahub 4096 Feb 27 04:36 ..\ndrwxrwxr-x 8 pgkrdatahub pgkrdatahub 4096 Feb 27 03:00 .git\n-rw-rw-r-- 1 pgkrdatahub pgkrdatahub 109 Feb 27 03:00 README.md\n-rw-rw-r-- 1 pgkrdatahub pgkrdatahub 5040 Feb 27 08:06 SomReviewDailyDag.py\ndrwxrwxr-x 2 pgkrdatahub pgkrdatahub 4096 Feb 27 08:06 __pycache__\ndrwxrwxr-x 8 pgkrdatahub pgkrdatahub 4096 Feb 27 06:44 sommers\n\n\nWhere SomReviewDailyDag imports scripts from these sommers folder.\n\nSomReviewDailyDag looks like this\n\nimport sys\nsys.path.insert(0, \"/home/pgkrdatahub/airflow/dags/sommers\")\n\nfrom builtins import range\nfrom airflow.operators.python_operator import PythonOperator\nfrom airflow.operators.postgres_operator import PostgresOperator\nfrom airflow.operators.bash_operator import BashOperator\nfrom airflow import DAG\nfrom datetime import datetime, timedelta\nimport airflow\nfrom sommers import SomReviewJob\n\nargs = {\n 'owner': 'airflow',\n 'start_date': datetime(2019, 2, 6, 0, 0),\n 'email': ['xxxxx'],\n 'email_on_failure': True,\n 'email_on_retry': False\n}\n\nwith DAG(dag_id = 'Sommers_Review_Daily', default_args = args, schedule_interval = '0 1 * * *', dagrun_timeout = timedelta(minutes=150)) as dag:\n\n activate_venv = BashOperator(\n task_id='Activate_Venv',\n bash_command='source /pgkrdatahub/airflow/dags/sommers/env/bin/activate',\n )\n\n run_somreview_daily = PythonOperator(\n task_id='SomReview_Daily',\n # provide_context=True,\n python_callable=SomReviewJob.main,\n )\n\n\nI googled and I couldn't find any reference to this issue in airflow.\n\nI found Bad magic number error with ZipFile module in Python\n\nwhich suggests that the header needs to be a certain string.\n\nBut I can't find anything else to figure out what the issue. Help would be greatly appreciated" ]
[ "python", "zip", "virtual-machine", "airflow", "directed-acyclic-graphs" ]
[ "Problem running 'cooccur' function in cooccur-package: undefindes columns selected", "I am trying to run the cooccur() function on a binary presence/absence dataframe, but gets the following error:\n\nr in [.data.frame(mat, spp, site_mask[spp, ] * site_mask[spp_next, :\nundefined columns selected\n\nand I can't figure out what the problem is.\nMy data looks like:\n\n\n\n\n\nsp1\nsp2\nsp3\nsp4\n\n\n\n\nA\n1\n0\n0\n1\n\n\nB\n0\n1\n1\n0\n\n\nC\n1\n1\n1\n0\n\n\nD\n0\n0\n0\n1\n\n\n\n\nand I use the call:\nlibrary(cooccur)\nco <- print(cooccur(data, type="site_spp", spp_names = TRUE)) \n\nbecause my input data is a dataframe with species in columns and sites in rows." ]
[ "r", "plot", "error-handling", "package", "undefined" ]
[ "MySQL on update CURRENT_TIMESTAMP save same value for all records", "I have a table named test_table like below:\nhttps://ibb.co/QN8f328\nI've set for the updated_dt column on update event is CURRENT_TIMESTAMP.\n\nBut when new rows insert in to table, the value of updated_dt column is not change and not CURRENT_TIMESTAMP value, like this \nhttps://ibb.co/Jvb7zcw\n\nWhat went wrong? Thanks for any help" ]
[ "mysql", "timestamp" ]
[ "uppercaseString of IBOutlet UITextField.text crash", "I'm running Xcode 6.3 beta 1 with iOS 8.3 beta 1 in the iOS Simulator. I have a UITextField @IBOutlet of which I'm trying to get the uppercaseString property of its text property, like this:\n\n@IBOutlet weak var field: UITextField!\n\n@IBAction func calledAfterUserAction(){\n let capitalized = field.text.uppercaseString\n}\n\n\nThe above workflow will cause a crash. After turning on Zombie Objects, I can see the following error:\n\n*** -[CFString release]: message sent to deallocated instance 0x7b689cd0\n\n\nHow can I fix this?" ]
[ "ios", "swift", "uitextfield", "iboutlet" ]
[ "java.lang.NullPointerException error with eclipse and testng", "am not able to run my first program using testNG and eclipse due following error logs.I am using eclipse and testNG for the first time.Thank you.\n\n java.lang.NullPointerException \n at \n org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider\n .getVMArgsFromPom(MavenTestNGLaunchConfigurationProvider.java:74)\n at \n org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.\n getVmArguments(MavenTestNGLaunchConfigurationProvider.java:39)\n at \n org.testng.eclipse.ui.util.ConfigurationHelper.\n getJvmArgs(ConfigurationHelper.java:166)\n at \n org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.\n getVMArguments(TestNGLaunchConfigurationDelegate.java:364)\n at\n org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.\n launchTypes(TestNGLaunchConfigurationDelegate.java:158)\n at \n org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.\n launch(TestNGLaunchConfigurationDelegate.java:90)\n at\n org.eclipse.debug.internal.core.LaunchConfiguration.\n launch(LaunchConfiguration.java:885)\n at \n org.eclipse.debug.internal.core.LaunchConfiguration.\n launch(LaunchConfiguration.java:739)\n at \n org.eclipse.debug.internal.ui.DebugUIPlugin.\n buildAndLaunch(DebugUIPlugin.java:1039)\n at \n org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)\n at \n org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)\n\n **Session data**\n eclipse.buildId=4.4.2.M20150204-1700\n java.version=1.8.0_65\n java.vendor=Oracle Corporation\n BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US\n Command-line arguments: -os win32 -ws win32 -arch x86_64" ]
[ "java", "eclipse", "testng-eclipse" ]
[ "sp_help with wildcards", "There is a command in SqlServer sp_help 'table_name' (table_name or other stuff)\n\nIs there a possibility to use it when you don't know the whole table name, with wildcards or something like this:\n\n\n sp_help admin_%\n\n\nEDIT: \n\nRun sp_help (SELECT * FROM INFORMATION_SCHEMA.Tables WHERE TABLE_NAME like '%admin_%') but had a strange result..." ]
[ "sql-server" ]
[ "How i can use intl-tel-input jQuery library within ionic 2", "How i can use this jQuery library https://github.com/jackocnr/intl-tel-input within ionic 2." ]
[ "jquery", "angular", "typescript", "ionic2" ]
[ "SwiftUI check if URL is reachable and switch to ContentView automaticly", "I tried this to check the status of connectivity :\nfunc checkConnection() {\nif let url = URL(string: "https://www.xxxxxxxxxxxxxxxxxxxxx") {\n var request = URLRequest(url: url)\n request.httpMethod = "HEAD"\n URLSession(configuration: .default)\n .dataTask(with: request) { (_, response, error) -> Void in\n guard error == nil else {\n print("Error:", error ?? "")\n return\n }\n\n guard (response as? HTTPURLResponse)?\n .statusCode == 200 else {\n print("down")\n\n return\n }\n\n print("up")\n\n \n \n }\n .resume()\n }\n}\n\nand it works fine. It shows "up" or "down" in console. I'm a beginner in Xcode and SwiftUI, so my question is:\nInstead of print("up") I want to go automaticly to the "ContentView" if URL is reachable. I tried ContentView() but it does not work.\nThanks for your help." ]
[ "swiftui", "connection", "func", "contentview" ]
[ "Retrieve value of a spinner after validation", "I have a problem to retrieve the value of a spinner when I want to validate my insertion.\n\nhere is how I fill my spinner :\n\nArrayList<HashMap<String, String>> myArrayList;\nmyArrayList= new ArrayList<HashMap<String, String>>();\nfor (int i = 0; i < studentList.length(); i++) {\nJSONObject c = studentList.getJSONObject(i);\nString id = c.getString(\"id\");\nString name = c.getString(\"name\");\nHashMap<String, String> map = new HashMap<String, String>();\nmap.put(\"id\", id);\nmap.put(\"name\", name);\nmyArrayList.add(map);\n}\n\n\nand after :\n\nSpinnerAdapter studentAdapter = new SimpleAdapter(\nMyActivity.this, myArrayList,\nR.layout.student, new String[] { \"id\", \"name\"},\nnew int[] { R.id.id, R.id.name });\nmySpinner.setAdapter(studentAdapter);\n\n\nWhen I click on my button \"OK\", and I get the value of the spinner with\n\nmySpinner.getSelectedItem().toString();\n\n\nI get : \n\n\n {id=2, name=Smith}\n\n\nBut i'm sure there is another method to retrieve only the name, but how? By getting the adapter with the spinner? It is my problem...\n\nThank you" ]
[ "android", "spinner", "adapter" ]
[ "ASMX (web service) is not working in VB.NET for Mexican characters input", "I am not able to pass the Mexican char through ASMX (web service), I tried with adding some logic's in the constructor to accept the Mexican char it is not working ..\n\nHere is the code \n\nPublic Class VNSoap\n Inherits System.Web.Services.WebService : Implements IXXXXX\nPublic Sub New()\n HttpContext.Current.Request.ContentType = \"text/xml; charset=UTF-8\"\n End Sub\nEnd Class\n\n\nI'm passing the char as 'Paul Pogbà' and getting the output as Paul Pogb??\n\nThe thing is my char is converted to ?? Any guesses?" ]
[ "c#", ".net", "vb.net", "web-services", "soap" ]
[ "how to fix { Cannot evaluate expression because a native frame is on top of the call stack.} in richtextbox", "I'm trying to show a large text file in richtextbox and I use backgroundworker in my program for escape from deadlock.\nWhen I run program value of this line\nthis.txtText.Text += text + \"\\r\\n\";\nis\n{Text = Cannot evaluate expression because a native frame is on top of the call stack.}\nI think that richtextbox can't load my file.\nWhat should i do?\n\nprivate void bgworker_DoWork(object sender, DoWorkEventArgs e)\n{\n lines = File.ReadAllLines(txtPath.Text);\n foreach (string line in lines)\n {\n this.SetText(line);\n }\n}\n\nprivate void SetText(string text)\n{\n if (this.txtText.InvokeRequired)\n {\n txtText.Invoke((ThreadStart)(() => SetText(text)));\n }\n else\n {\n this.txtText.Text += text + \"\\r\\n\";\n }\n}" ]
[ "c#" ]
[ "Cypress: using either or with expect", "I am using cypress and have an object with some properties for example:\nconst obj={\n a:1,\n b:2,\n c:3\n}\n\nI want to check there that this object:\n\neither should not have property myProp\nor should have property myProp as an empty string\nor should have a property myProp as undefined\n\nI tried firstly with the first two conditions but failed there itself, hence can't make it to all the 3 conditions.\nThis is what I tried:\nexpect(obj)\n .either.not.to.have.a.property('myProp')\n .or.to.have.a.property('myProp')\n .that.is.a('string').and.is.empty;\n\nAnd I get to see the error as:\n\nPlease help me:\n\nto use either/or\nto check all the 3 conditions." ]
[ "javascript", "unit-testing", "testing", "cypress", "chai" ]
[ "What minifier was used to generate the official JQuery \"minified\" version?", "I need to edit the current JQuery library 1.4.x (and completely rename the JQuery \"object/function\") in a high conflicting environment. \n\nMy question is, with what minifier has the official JQuery minified version been generated. Where can I find this minifier? (As I want to use it for minifing my version too).\n\nThank you!\nTim" ]
[ "jquery" ]
[ "Issue with the jcarousel", "I have an issue with the jcarousel items. The half on an image from the jcarousel dissapear when I resize the browser. You can check the template here. If you resize until you see only two images ( items ) in jcarousel, you will see my issue. I've tried everything, I can't simply solve this problem." ]
[ "jquery", "css", "html" ]