texts
sequence | tags
sequence |
---|---|
[
"Android phone is disconnected when adb is started",
"I am trying to debug the android phone with adb tool. When I run the adb command on the command prompt, the connected phone get disconnected from the system. I want to use adb logcat on the phone. I am using following command:\n\nadb -s <device_id> logcat\n\n\nAfter entering the command on command line, it says: adb server out of date. Killing... and after that phone gets disconnected and command line shows waiting for device...\n\nAny idea how to solve the problem? I just want to run logcat on the android device. I am using HTC Wildfire phone.\n\nThanks"
] | [
"android",
"adb"
] |
[
"Situations where CakePHP 2 might not populate `created` or `modified` fields on a table",
"I have a legacy application in CakePHP 2.4.4\n\nI have added a new database table and added created and modified fields to it, both of which are DATETIME. Database is MySQL.\n\nI've done a lot of work with Cake (2 and 3) before and always found that these fields will be updated automatically when records are created/modified. It even mentions this in the documentation for Cake 2: https://book.cakephp.org/2.0/en/models/saving-your-data.html#using-created-and-modified\n\nWhen I save or edit a record, created (or modified if editing) is populated with 0000-00-00 00:00:00\n\nWhy could this be? I don't even know where to begin to look for this as I've never known it to occur.\n\nI am not doing anything in my Controller or Model to \"unset\" these fields either.\n\nStructure of my table is as follows. I've also tried changing Null to NO on created and modified - same result.\n\nmysql> DESCRIBE tags;\n+----------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+----------+--------------+------+-----+---------+----------------+\n| id | int(10) | NO | PRI | NULL | auto_increment |\n| title | varchar(255) | NO | | NULL | |\n| created | datetime | YES | | NULL | |\n| modified | datetime | YES | | NULL | |\n+----------+--------------+------+-----+---------+----------------+\n\n\nI am saving edited data as follows:\n\n$this->Tag->save( $this->request->data ) \n\n\nIf I var_dump($this->request->data) it looks like this:\n\narray(2) { [\"Save\"]=> string(6) \"Update\" [\"Tag\"]=> array(2) { [\"id\"]=> string(1) \"2\" [\"title\"]=> string(6) \"France\" } }\n\n\nModel (app/Model/Tag.php) - about as basic as you can get:\n\nclass Tag extends AppModel {\n}"
] | [
"php",
"cakephp",
"cakephp-2.0"
] |
[
"How to fix Android Databinding Error in API 28?",
"I have changed my target API from 27 to 28 and after that I replaced the Android.jar in Platforms/android-28 with unhiddenjar (to have some systems class for development). After changing from 27 to 28 I am facing an issue with Databinding using classes (around 35 errors) \n\nerror: cannot find symbol DataBindingComponent\n\nSample Error :\n\n18:23:39.878 [ERROR] [system.err] E:\\...\\app\\databinding\\FragmentInfoBinding.java:166: error: cannot find symbol\n18:23:39.878 [ERROR] [system.err] @Nullable DataBindingComponent component) {\n18:23:39.879 [ERROR] [system.err] ^\n18:23:39.879 [ERROR] [system.err] symbol: class DataBindingComponent\n18:23:39.879 [ERROR] [system.err] location: class FragmentInfoBinding\n\n\nTried using the migrate to android x option in android studio and I am already having below line in my gradle.\n\ndataBinding {\n enabled true\n }\n\n\nMy configuration below (ext variables) :\n\n androidBuildToolsVersion = \"28.0.3\"\n androidCompileSdkVersion = 28\n androidTargetSdkVersion = 28\n androidMinSdkVersion = 21\n gradleCoreVersion = \"4.4\"\n gradleAndroidPluginVersion = '3.3.1'\n\n\nGradlew Properties :\n\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.10.1-all.zip\n\n\nAndroid Studio : \n\nAndroid Studio 3.3.1\nBuild #AI-182.5107.16.33.5264788, built on January 29, 2019\nJRE: 1.8.0_152-release-1248-b01 amd64\nJVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o\nWindows 10 10.0"
] | [
"java",
"android",
"android-databinding",
"android-9.0-pie"
] |
[
"Disable mod_python error and traceback",
"I want to disable mode_python error, traceback, module cache details and any other warning notice !\n\nI am using simple mod_python module on ubuntu server with apache, without any framework (Django ect ...).\n\nI made lot of searchs on GOOGLE but no one speak about this :)\n\nI want alternative to error_reporting(0); on PHP or any config changes on the server side.\n\nThank you in advance."
] | [
"python",
"apache",
"ubuntu"
] |
[
"Elastic Beanstalk optionsettings file keep getting overwritten with default parameters",
"While trying to setup an elastic beanstalk worker application using the command line tools (eb tools), my configuration file (optionsettings.MyApp-env) gets overwritten when I start/update/stop the environment.\n\nThese are the steps to reproduce:\n\n\nUsing the CLI tools' command eb init I've created a new application in Elastic Beanstalk. \nThe config file in the .elasticbeanstalk folder had the following line:\nOptionSettingFile=/Users/doron/projects/workers/my-worker/.elasticbeanstalk/optionsettings.MyWorkerName-dev\nAfter running eb start for the first time, that file was created with some values. \nI went ahead and changed its contents according to http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html so it'll be configured as I want (environment parameters, autoscaling servers amount, etc...).\nTo apply the changes I've tried the following:\n\n\nUpdate the existing environment with eb update.\nTerminate the existing environment with eb stop and build it from scratch with eb start.\n \n\n\nIn both cases the optionsettings file get changed after running the command (update or start). \n\nThe new content of the file looks more like the vanilla version I got after calling the first eb start with all sorts of configuration parameters that I added - removed completely.\n\n\nIs there another way of configuring the environment (not the software on the machine, but the configuration that exists in the console - instance type, regions, autoscaling, rotating updates, etc...) ?"
] | [
"amazon-web-services",
"config",
"amazon-elastic-beanstalk"
] |
[
"Simple Gmail login via non-webview / browser HTTPS POST",
"I am trying to build a very simple app, but it's turning out to be a much more difficult task\nthan one could imagine.\n\nI need to use a simple User Interface , with the basic two text fields, \nUserName & PassWord (done), and once the login button is depressed, it logs into gmail\n(or any corporate Gmail account) via an https POST (I think all gmail access is now done through 'https' only) and the simple UI closes, and Safari opens up \nat the Inbox, (not at the Login window).\n\nIs there no way to pass a socket handle or some cookie data to Safari?\nOr even write a temp file that can be given as parameter to Safari, to open up..?\n\nI've spent about three solid days trying to build other open-source libraries, that I probably don't even need, only to get a stack of build errors...\n\nI am actually not even sure if the correct data is being sent to the server...\n\nHere's basically what I've got... anybody with any ideas...?\n\nNSString *urlString = @\"https://www.google.com/LoginAction2?service=mail\";\n\n// setting up the request object now\nNSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];\n[request setURL:[NSURL URLWithString:urlString]];\n[request setHTTPMethod:@\"POST\"];\n\nNSString *contentType = [NSString stringWithFormat:@\"application/x-www-form-urlencoded\"];\n[request addValue:contentType forHTTPHeaderField: @\"Content-Type\"];\n\nNSMutableData *body = [NSMutableData data];\n[body appendData:[[NSString stringWithFormat:@\"action=https://www.google.com/LoginAction2?service=mail&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"Email=\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:userName] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"Passwd=\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:passWord] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"continue=https://mail.google.com/&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"PersistentCookie=yes&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"signIn=\\\"Sign in\\\"&\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithFormat:@\"media=\"] dataUsingEncoding:NSUTF8StringEncoding]];\n\n[request setHTTPBody:body];\nNSString *msgLength = [NSString stringWithFormat:@\"%d\", [body length]];\n[request addValue: msgLength forHTTPHeaderField:@\"Content-Length\"];\n\nNSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];\nNSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];\n\n[pool release];\n\nURLWithString:@\"https://mail.google.com/\"]];\n[[UIApplication sharedApplication] openURL:[NSURL URLWithString: returnString]];"
] | [
"post",
"login",
"https",
"gmail"
] |
[
"Multiple Solr One Application Server (Jboss 7.1)",
"Is it possibile to have multiple Solrs in the same application server?\n\nIf yes, how can I do it?\n\nIm in need of 3 Solr instance and I want them running at the same application server.\n\nIm using Solr 3.6 and Jboss 7.1\n\nThanks in advance!"
] | [
"solr",
"jboss7.x"
] |
[
"LINQ adding to list object in loop",
"I have a situation where I need to populate a list object by looping through a loop of objects, check against a condition, and if the condition is met, add the item to my list. Currently I cannot find an example of the syntax required to add to the list rather than clear it and repopulate it each time the loop iterates to the next item. Can somebody help?\n\nList<ProfileRightsJSON> prf = new List<ProfileRightsJSON>();\n\ntry\n{\n for (int i = 0; i < lstProfiles.Count; i++)\n {\n prf = (from p in _database.tblProfileRights\n where p.fkProfileID ==\n lstProfiles[i].ProfileID\n select new ProfileRightsJSON\n {\n FunctionID = p.fkFunctionID,\n UserTypeID = p.fkUserTypeID,\n RecursiveRights = p.RecursiveRights\n }).ToList();\n }"
] | [
"c#",
".net",
"linq"
] |
[
"Does Python create a new list when a sliced list is a parameter in a recursive function?",
"For the purposes of understanding recursion and its performance in Python I wrote a recursive function that returns the maximum in the list:\ndef max_list(A):\n print(id(A)) # debugging purposes\n if len(A) > 1:\n max_list_tail = max_list(A[:-1])\n else:\n max_list_tail = A[0]\n if A[-1] > max_list_tail:\n return A[-1]\n else:\n return max_list_tail\n\nThe idea behind this function is that if the last element of the current list is greater than the maximum among the 'tail' of the list, which is, all the elements, except for the last one, that the last one is the maximum, otherwise the maximum of the tail is the maximum.\nAs you can see, I pass a sliced list A[:-1] as a parameter.\nQuestions:\n\nAm I right saying the following: Each time I pass A[:-1] a new list is created, which is a copy of my old list except for the last element? For debugging purposes I print the id of each sliced list and the ids are different which prompts me to think I'm right but I want confirmation from the expert community.\n\nIf 1. is yes, that's true, what is the time complexity of my function? Can I say that it is O(n^2) because it takes O(n) to find the maximum in the initial list and O(n) to create a copy of the current list each time I recursively call the function?"
] | [
"python",
"recursion",
"big-o"
] |
[
"How to invoke a 'click' when user clicks on href",
"I'm trying to fire an alert when a user clicks on an anchor tag, but the alert is not being fired. The code I am trying is below.\n\nhttp://jsfiddle.net/NLdTJ/\n\n<a id=\"collapse\"> Collapse</a>\n\n$(function(){\n $('#collapse').click(function(){\n alert('here');\n });\n});"
] | [
"javascript",
"jquery"
] |
[
"How to authorize one solr user to one core for solr 7",
"I want to create multiple user each user can access one or multiple core, I have two cores [Solr_sample and name core]I tried to create the below file, but it didn't work\n "authentication":{\n "class":"solr.BasicAuthPlugin",\n "blockUnknown": true,\n "credentials":{\n "solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c=",\n "devuser":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="\n }\n },\n "authorization":{\n "class":"solr.RuleBasedAuthorizationPlugin",\n \n "permissions":[\n {\n "name":"core-admin-read",\n "path": "/admin/cores/Solr_sample/select?q=*:*",\n "role":"admin"\n }\n \n ],\n "user-role":{\n "solr":"admin",\n "devuser":"dev"\n }\n }\n}"
] | [
"solr",
"solrj",
"solrcloud",
"solrnet"
] |
[
"Doctrine ORM and factories with abstract classes strategy",
"So I've stumbled upon this hurdle where I have to create an abstract class and a factory to create objects of more specific classes that extend the abstract class and implement more specific object methods.\n\nSimply said, I got a SocialMediaAbstract class. Extending classes are Facebook, Instagram, and they implement a SocialMediaInterface. Facebook, Instagram etc are all saved in the db, with an id, a name and several more properties that are all used among the extending classes, hence an abstract class.\n\nBecause I want to be able to query several things from the SocialMedia Objects, and every social media platform have their own APIs for it, I made the interface and created the different classes so they can all have their own implementations of those methods.\n\nNow, the problem is of course with my abstract class and Doctrine. Doctrine says this on their website regarding inheritance:\n\n\n A mapped superclass cannot be an entity, it is not query-able [...]\n\n\nNow if I had a SocialMediaFactory and threw in an ID, I would like to get the respective Object of, for example, class Facebook or Instagram back. I don't want to know exactly which SocialMedia it is when I collect them. Now that is a problem with doctrine, at least that's what I think it is.\n\nAm I overlooking something, is the factory pattern still possible? Or should I really just remove the abstract class, and create a factory that searches in every table of a SocialMediaInterface implementing class, which seems highly inefficient and unmaintable when an application gets bigger.\n\nAny insight or pointers would be appreciated, since I'm sure this problem must've come up more often. I tried googling and searching on Stackoverflow itself, but I couldn't get any relevant questions or answers.\n\nThank you very much in advance.\n\nEDIT:\nI came across this interesting possibility: Class Table Inheritance. This would mean adding:\n\n * @ORM\\InheritanceType(\"JOINED\")\n * @ORM\\DiscriminatorColumn(name=\"discr\", type=\"string\")\n * @ORM\\DiscriminatorMap({\"facebook\" = \"Facebook\", \"instagram\" = \"Instagram\"})\n\n\nto my code. I had high hopes, but sadly enough the validator gave me this error:\n\n\n [Doctrine\\ORM\\Mapping\\MappingException]\n It is not supported to define inheritance information on a mapped superclas\n s 'Portal\\SocialMedia\\Entity\\SocialMediaAbstract'.\n\n\nA shame mapper superclasses are not supported.\n\nEDIT 2/CONCLUSION:\nI've decided to go with Class Table Inheritance (just like the answer below suggested). Removing the abstract from the class made it possible to still use my factory.\n\nI am using a concrete class as an abstract class now however, which feels wrong. I've documented in docblock that no objects should be instantiated from this class.\n\nOne little sidenote: Doctrine's Entity Manager more or less already provides the Factory:\n\n$socialMedia = $entityManager->find('Portal\\SocialMedia\\Entity\\SocialMedia', 2);\n\n\nThis returns an Instagram object. I still suggest you build your own factory above it for maintainability later as the SocialMedia entity might change later on."
] | [
"php",
"orm",
"doctrine-orm",
"doctrine",
"factory"
] |
[
"Converting XML file into a specific JSON format",
"I have an XML file that looks like this\n<?xml version="1.0" encoding="utf-8"?>\n<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="application" xmlns="http://schemas.microsoft.com/2011/01/fabric">\n <Parameters>\n <Parameter Name="Parameter1" Value="test1" />\n <Parameter Name="parameter2" Value="test2" />\n <Parameter Name="parameter3" Value="test3" />\n <Parameter Name="parameter4" Value="test4" />\n </Parameters>\n</Application>\n\nI am using a hashtable to convert this to JSON but when I do, I only get the Parameters portion:\n{\n "PARAMETER_1": "Test",\n "parameter2" : "test2" \n\nI'm Reading the xml file like so because if i try to read it as $appParametersXml then I get an error.\n$appParametersHashTable = Read-XmlElementAsHashtable $appParametersXml.Application.Parameters\n\n$appParametersHashTable |ConvertTo-Json |Out-File "C:\\Workspaces\\ARMTemplates\\GhostDraftApplication\\ARMTemplate\\CloudAXF.json"\n#$appParametersHashTable|ConvertFrom-Xml|Out-File "C:\\Workspaces\\ARMTemplates\\GhostDraftApplication\\ARMTemplate\\CloudTest.xml"\n\n$appParametersXml | ConvertFrom-Xml | ConvertTo-Json -Depth 4 | Out-File "C:\\Workspaces\\ARMTemplates\\GhostDraftApplication\\ARMTemplate\\CloudAXF.json"\n\n$xmlObject = $appParametersXml | ConvertTo-Xml\n\n\n###############################################################################\nfunction Read-XmlElementAsHashtable\n{\n Param (\n [System.Xml.XmlElement]\n $Element\n )\n\n $hashtable = @{}\n if ($Element.ChildNodes)\n {\n $Element.ChildNodes | \n ForEach-Object {\n $hashtable["Name" + $_.Name] = "Value" + $_.Value\n }\n }\n\n return $hashtable\n}\n\nIs there a way to read the all the tags and attributes from the xml file and convert them to JSON so it looks like this?\n"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",\n"contentVersion": "1.0.0.0",\n"parameters": {\n "PARAMETER_1": {\n "value": "Test"\n },\n\nI've just been spinning my wheels."
] | [
"json",
"xml",
"powershell"
] |
[
"Mark the Mark Scheme",
"I have successfully completed an AQA Computing exam (June 2011) in Delphi. Out of curiosity, I read the mark scheme for it. One thing I can't get over is that the C language mark scheme seems to be wrong on many aspects. Luckily (ha!) I did it in Delphi.\n\nFor example, this small snippet:\n\nchar* Names[5];\n...\nvoid main(void)\n{\n Names[1] = \"Ben\";\n Names[2] = \"Thor\";\n Names[3] = \"Zoe\";\n Names[4] = \"Kate\";\n ...\n}\n\n\nFor one, it's not possible to assign strings to an array. A function like strcpy must be used. Also, why do the arrays start at 1, even though 5 entries have been allocated? Most programming languages, including C, start at 0.\n\nThere are other problems, for example they use printf(\"%s\", \"message\"); to print strings; puts would be fine. And if you can be certain no unescaped percent signs would show up in the message, so would printf alone, with no arguments. \n\nAm I right in my criticism of this?\n\nNote: For those unfamiliar with mark schemes, they are what is used to mark the exams. I am questioning whether it is correct."
] | [
"c"
] |
[
"NEO4j Cypher query returning distinct value",
"hello guys I am new to cypher query and I want to restrict duplicate values in my result \n\nthe query is\n\nmatch (ee:Personal {id:\"id\"})-[:Friend]->(fr),\n (fr)-[:Friend]->(fr2),\n (fr2)-[:Friend]->(friend:Personal),\n (friend)-[:Works]->(comp:Company) \n\nwhere comp.name=~\".*name.*\" \nand not friend.id=\"id\" \nand not (friend)-[:Friend]-(fr) \nand not (friend)-[:Friend]-(ee) \nand not (fr2)-[:Friend]-(ee) \n\noptional match (comp)-[:Position]->(pos), \n (friend)-[:Position]->(pos) \noptional match (friend)-[:Location]->(loc) \n\nreturn distinct friend.name, comp.name\n\n\nbut i get duplicate values as there are multiple node properties in return statemnt. If I return only one property then its fine. but i want distinct friends"
] | [
"neo4j",
"cypher"
] |
[
"How can my API keys stay hidden from the public",
"Im quite a beginner so if this is obvious please bear with me. I have done some research but nothing i could find for my specific question. I'm done creating my website using html/css/js and its ready for deployment. I’m using firebase as a backend to store some data. I have a firebase config function in one of my js files which contains my API key. I have seen some guides on using .env file but they all say its for source control. My question is: If i deploy my site as it is, is my API visible to the public? And if so, what are the best practices to follow to ensure my secret keys remain secret?"
] | [
"javascript",
"html",
"css",
"firebase",
"google-cloud-firestore"
] |
[
"css box model does not stretch using padding",
"I have a project title as a header in my webpage. This project title is within a div called \"pagetitle\". After the project title, i have two words which one has to be on the left and another on the right. I want a white background everything within the \"pagetitle\" div leaving alittle space at the bottom after the two words. I have tried \"padding-bottom:10px\" for the two words. However, the white background does not stretch to cover that 10px included. May I know how should i do it?\n\nCheers,\nZhengHong\n\n<div class =\"pagetitle\" style=\"background-color:black;\">\n <center style=\"padding: 10px 0 0 0\">Executive Summary Dashboard<center>\n <br><left style=\"float:left; padding:0 0 10px 10px;\">Subject Selected:</left><right style=\"float:right;padding:0 10px 10px 0; background-color:green; margin-bottom:10px;\">Time frame:</right></br>\n </div>"
] | [
"html",
"css",
"layout",
"css-float"
] |
[
"SolrJ Embedded Server Spring Config No longer working",
"I have this spring config that I used in my tests:\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:solr=\"http://www.springframework.org/schema/data/solr\"\n xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n http://www.springframework.org/schema/beans/spring-beans.xsd\n http://www.springframework.org/schema/data/solr\n http://www.springframework.org/schema/data/solr/spring-solr-1.0.xsd\">\n\n <solr:embedded-solr-server id=\"tgySolrServer\" solrHome=\"target/test-classes\" />\n</beans> \n\n\nthrowing now this exception\n\nCaused by: java.lang.NoSuchMethodError: org.apache.solr.core.CoreContainer.<init>(Ljava/lang/String;Ljava/io/File;)V\n at org.springframework.data.solr.server.support.EmbeddedSolrServerFactory.createPathConfiguredSolrServer(EmbeddedSolrServerFactory.java:101)\n at org.springframework.data.solr.server.support.EmbeddedSolrServerFactory.initSolrServer(EmbeddedSolrServerFactory.java:77)\n at org.springframework.data.solr.server.support.EmbeddedSolrServerFactoryBean.afterPropertiesSet(EmbeddedSolrServerFactoryBean.java:36)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)\n ... 40 more\n\n\nI currently have Solr 4.5.0 and spring-data-solr 1.0.0-RELEASE. What should I do to use the embedded server in my tests?"
] | [
"spring",
"spring-data",
"solrj"
] |
[
"Adding an arrow and marker on a map in R",
"I have made a map using ggplot2 package of R and also a geom_path visualized on it. Now, I want to add a few markers and just one arrow in order to show the direction of the path. For arrows there is a package called grid which has arrow() function, but if I use this function in my geom_path aesthetics, it will draw arrows for each point of my path. So, I just want to draw an arrow (just one arrow) in order to visualize the direction of the path. \nThe second issue is how to add few markers on my map. I've read there is a nice package RGoogleMaps, which allows that, but the problem is that I am using ggplot2. \nAny idea how can I add an arrow and markers to my map?\nThanks in advance!\n\nhere is my code:\n\nrequire(move)\nrequire(ggmap)\nrequire(mapproj)\ngps <- move(x=temp$GPS_x, y=temp$GPS_y,time=as.POSIXct(temp$GPS_timeDate, format=\"%d/%m/%Y %H:%M:%S\", tz=\"UTC\"), proj=CRS(\"+proj=longlat +ellps=WGS84\"), animal='unknown', sensor='NoName')\ngps_df <- as(gps, \"data.frame\")\nm <- get_map(bbox(extent(gps)*1.1), source=\"osm\", zoom=14)\nggmap(m)+geom_path(data=gps_df[1:nrow(soc_long),], aes(x=temp$GPS_x[1:nrow(soc_long)], y=temp$GPS_y[1:nrow(soc_long)],colour=soc_long$dsoc),size=1.5,lineend=\"round\")+scale_color_gradient(low='green',high='red')\n\n\nThe output is the following: \n\n\nThis is the part of temp data set: \n\nGPS_timeDate GPS_x GPS_y\n13/11/13 14:54:15 10.17936802 54.33073984\n13/11/13 14:54:16 10.17936768 54.33073967\n13/11/13 14:54:17 10.17936735 54.33073951\n13/11/13 14:54:18 10.17936702 54.33073934\n13/11/13 14:54:19 10.17936668 54.33073917\n13/11/13 14:54:20 10.17936635 54.33073901\n13/11/13 14:54:21 10.17936601 54.33073884\n13/11/13 14:54:22 10.17936568 54.33073867\n13/11/13 14:54:23 10.17936535 54.33073851\n13/11/13 14:54:24 10.17936501 54.33073834\n13/11/13 14:54:25 10.17936547 54.33073849\n13/11/13 14:54:26 10.17936597 54.33073866\n13/11/13 14:54:27 10.17936646 54.33073882\n13/11/13 14:54:28 10.17936696 54.33073899\n13/11/13 14:54:29 10.17936745 54.33073915\n13/11/13 14:54:30 10.17936794 54.33073931\n13/11/13 14:54:31 10.17936844 54.33073948\n13/11/13 14:54:32 10.17936893 54.33073964\n13/11/13 14:54:33 10.17936943 54.33073981\n13/11/13 14:54:34 10.17936992 54.33073997\n13/11/13 14:54:35 10.17936943 54.33074\n13/11/13 14:54:36 10.17936875 54.33074\n13/11/13 14:54:37 10.17936807 54.33074\n13/11/13 14:54:38 10.17936739 54.33074\n13/11/13 14:54:39 10.17936671 54.33074\n13/11/13 14:54:40 10.17936603 54.33074\n13/11/13 14:54:41 10.17936535 54.33074\n13/11/13 14:54:42 10.17936467 54.33074\n13/11/13 14:54:43 10.17936399 54.33074\n\n\nsoc_long data set's values are used for color gradient:\n\n dsoc\n1 0.348334562\n2 0.348334562\n3 0.348334562\n4 0.348334562\n5 0.348334562\n6 0.348334562\n7 0.348334562\n8 0.348334562\n9 0.348334562\n10 0.348334562\n11 0.367477325\n12 0.367477325\n13 0.367477325\n14 0.367477325\n15 0.367477325\n16 0.367477325\n17 0.367477325\n18 0.367477325\n19 0.367477325\n20 0.367477325\n21 0.248041791\n22 0.248041791\n23 0.248041791\n24 0.248041791\n25 0.248041791\n26 0.248041791\n27 0.248041791\n28 0.248041791\n29 0.248041791\n30 0.248041791\n\n\nAnd finally, the following pints are the point that I want to add as markers to the path:\n\nlat lon\n54.31545667 10.168515\n54.30135833 10.14450333\n54.30305167 10.137645\n54.3072 10.13840667\n54.31827833 10.13377\n54.32098833 10.12690667\n54.32025833 10.12314\n54.31826833 10.12340333\n54.31540667 10.12799167\n54.31492167 10.13006833"
] | [
"r",
"ggplot2",
"rgooglemaps"
] |
[
"Java - Dekkers Algorithm implementation resulting in two threads in critical section",
"I am trying to implement Dekkers Algorithm for a scenario where there are two railroads and there is a point where they both use the same part of the track. Only one train should be allowed to enter this section at once and one train can go through as many times in a row as it would like unless it's both the other trains turn and it is ready to go through.\n\nBelow is the code for my implementation for the first railroad track.\n\nwhile (allowed) {\n choochoo();\n setWantToUseTrack(0,true);\n while (getWantToUseTrack(1)) {\n if (getTurn() != 0) {\n setWantToUseTrack(0,false);\n while (getTurn() != 0) {\n //wait loop\n }\n setWantToUseTrack(0, true);\n }\n }\n //critical section starts\n crossPass();\n //critical section ends\n setTurn(1);\n setWantToUseTrack(0,false);\n }\n}\n\n\nBelow is the code for my implementation of the second railroad track.\n\nwhile (allowed) {\n choochoo();\n setWantToUseTrack(1,true);\n while (getWantToUseTrack(0)) {\n if (getTurn() != 1) {\n setWantToUseTrack(1,false);\n while (getTurn() != 1) {\n //wait loop\n }\n setWantToUseTrack(1,true);\n }\n }\n //critical section starts\n crossPass();\n //critical section ends\n setTurn(0);\n setWantToUseTrack(1,false);\n }\n\n\nWhen this code runs sometimes both trains end up in the critical section at the same time. I cannot see the logical error. Am i missing something from my implementation?"
] | [
"java",
"multithreading",
"algorithm",
"jvm",
"java-threads"
] |
[
"migrateing from axis to cxf",
"I'm trying to migrate from axis to cxf and I have wsdl files which the plugin generates to java code. I have 2 questions:\n\n\nI have the following block in wsdl file: \n\n\n\n<xsd:element name=\"sendSms\" type=\"parlayx_sms_send_local_xsd:sendSms\"/>\n <xsd:complexType name=\"sendSms\">\n <xsd:sequence>\n <xsd:element maxOccurs=\"unbounded\" minOccurs=\"1\" name=\"addresses\" type=\"xsd:anyURI\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"senderName\" type=\"xsd:string\"/>\n <xsd:element name=\"message\" type=\"xsd:string\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"receiptRequest\" type=\"parlayx_common_xsd:SimpleReference\"/>\n </xsd:sequence>\n </xsd:complexType>\n\n\nand the anyURI is generated to String instead of URI, does anyone know why?\nThe axis creates service locator class and binding stub class which allows to add to the web service attributes such as user name, password, timeout etc. I need to add this attributes since the service is over secured connection and they are not parameters in the web service generated method sendSms. (you can see the definitions below).\n\n\n\n<wsdl:portType name=\"SendSms\">\n <wsdl:operation name=\"sendSms\">\n <wsdl:input message=\"parlayx_sms_send:SendSms_sendSmsRequest\"/>\n <wsdl:output message=\"parlayx_sms_send:SendSms_sendSmsResponse\"/>\n <wsdl:fault message=\"parlayx_common_faults:ServiceException\" name=\"ServiceException\"/>\n <wsdl:fault message=\"parlayx_common_faults:PolicyException\" name=\"PolicyException\"/>\n </wsdl:operation>\n</wsdl:portType>\n\n\n\n\n<xsd:element name=\"sendSms\" type=\"parlayx_sms_send_local_xsd:sendSms\"/>\n <xsd:complexType name=\"sendSms\">\n <xsd:sequence>\n <xsd:element maxOccurs=\"unbounded\" minOccurs=\"1\" name=\"addresses\" type=\"xsd:anyURI\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"senderName\" type=\"xsd:string\"/>\n <xsd:element name=\"message\" type=\"xsd:string\"/>\n <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"receiptRequest\" type=\"parlayx_common_xsd:SimpleReference\"/>\n </xsd:sequence>\n </xsd:complexType>\n\n\nI didn't find any example that I'm certain it demonstrates how I add these values.\nDo you know about such example?\n\n\nThanks,\nDaniela"
] | [
"cxf"
] |
[
"How to fix duplicate entry for key primary when inserting into database?",
"I have an android app where the user inserts records in the table. The app has worked fine for months. For the past few days, I have been receiving the duplicate entry for primary error. I'm not sure what the issue is. \n\nI'm using GenerationType Sequence for my entity. Could it be that the sequence number is off? And if so why did that happen? I'm also adding to this table from another app, could that be the issue?\n\nI've tried changing the way the record inserts but I still get the same error. Maybe if I knew why this was suddenly happening I could figure out the code.\n\n@Entity(name=\"bmwsales\")\n@Table(name=\"bmwsales\")\npublic class Bmwsales implements Serializable{\nprivate static final long serialVersionUID = 1L;\n\n@Id\n@Column(name=\"id\")\n@GeneratedValue(strategy=GenerationType.SEQUENCE)\nprivate Integer id;\n\n@Column(name=\"customerfirstname\")\nprivate String customerfirstname;\n\n ..................\n\n\nWhere the service is implemented: \n\n@Override\npublic void addBmwvehicle(Bmwsales vehicle) {\n rolllogger.info(\"add bmw customer vehicle\");\n bmwsalesRepository.save(vehicle);\n}\n\n\nError:\n\nDuplicate entry '35475' for key 'PRIMARY'\norg.hibernate.engine.jdbc.spi.SqlExceptionHelper in logExceptions at line 131\norg.hibernate.engine.jdbc.spi.SqlExceptionHelper in convert at line 110\norg.hibernate.engine.jdbc.batch.internal.BatchingBatch in performExecution at line 128\norg.hibernate.engine.jdbc.batch.internal.BatchingBatch in doExecuteBatch at line 104\norg.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl in execute at line 147\norg.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl in executeBatch at line 212\norg.hibernate.engine.spi.ActionQueue in executeActions at line 629\norg.hibernate.engine.spi.ActionQueue in executeActions at line 474\n\n\nI would like the record to be inserted as needed. Thanks in advance!"
] | [
"java",
"android",
"spring-boot",
"spring-data-jpa"
] |
[
"Create JSON in 2D array to store key value pair",
"I have a question that would like to seek your expertise on.\nI have Class call Technology and i retrieve data from the DB as object list of Technology classtechnologyList= getProjectBD().getAllTechnology(); \n\nmy question is how to store data as key value pair in Json array.\nThis is my code\n\nJSONArray technologyArray=new JSONArray();\nfor (Technology technology : technologyList) {\n JSONArray gridRow=new JSONArray();\n gridRow.put(technology.getTechnologyId());\n gridRow.put(technology.getTechnologyName()); \n technologyArray.put(gridRow); \n }\n\n\nI need to pass this data to select option in my jsp as id and name.\nex:-[1:JAVA,2:C#...]"
] | [
"java",
"arrays",
"json"
] |
[
"Language choices for writing very fast abstractions interfacing with Python?",
"I have a system currently written in Python that can be separated into backend and frontend layers. Python is too slow, so I want to rewrite the backend in a fast compiled language while keeping the frontend in Python, in a way that lets the backend functionality be called from Python. What are the best choices to do so?\n\nI've considered cython but it's very limited and cumbersome to write, and not that much faster. From what I remember of Boost Python for C++, it's very annoying to maintain the bridge between languages. Are there better choices? \n\nMy main factors are:\n\n\nspeed of execution\nspeed of compilation\nlanguage is declarative"
] | [
"java",
"c++",
"python",
"boost-python"
] |
[
"React.js dialog component disappears yet remains in DOM",
"I'm using a Dialog component from Material-UI which, for the most part, is working correctly. However, if I click away from the Dialog, the Dialog will disappear (as expected) but sometimes, it remains in the DOM with its opacity set to 0, and I can't click anything else since the Dialog is in the way. This is a small sample of my code:\n\n const [openDialog, setOpenDialog] = React.useState(false);\n\n React.useEffect(() => {\n // Get data for ReactTable\n }, []);\n\n return(\n <div>\n // Other components\n <Button color=\"white\" onClick={() => setOpenDialog(true)}>\n Open Dialog\n </Button>\n // Other components\n <Dialog open={openDialog} maxWidth=\"md\" onClose={() => setOpenDialog(false)}>\n // ReactTable and close button\n </Dialog>\n </div>\n )\n\n\nThis bug doesn't always occur which makes it tricky to debug. I've only been using React for about a month, but I'm wondering if it's a state problem, or maybe some sort of race condition. Any suggestions?\n\nEdit: This also occurs when a DropzoneDialog appears, to upload a file."
] | [
"javascript",
"reactjs",
"dialog",
"material-ui"
] |
[
"Get Length and Keys of JavaScript Object",
"I have a JavaScript object like:\n\nmyobj: \"[\n {\"id\":\"2027\",\"street\":\"street name one\"},\n {\"id\":\"2515\",\"street\":\"street name two\"}\n ]\"\n\n\nHow can I get the length and the list of keys in this object? \n\nI've tried:\n\nvar keys = Object.keys(myobj).length;\nconsole.log(keys);\n\n\nbut it always returns a length of \"1\"...why?"
] | [
"javascript",
"json",
"object"
] |
[
"Storyboard won't load",
"I copied a storyboard from one project to another and now I am getting an error when I try to load it. \n\n\n\nAny ideas? I am not missing any view controllers. What would prevent a storyboard from being able to load?\n\nI really hope I don't have to rebuild the whole thing. It's quite a large one.\n\n\n 8/20/14 11:03:07.032 AM Xcode[25482]: DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5069/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:76\n Details: Failed to load dependencies output contents from ``/Users/rsmith/Library/Developer/Xcode/DerivedData/Tatyana-cddwympaoafzixdpzoffsonzpsyb/Build/Intermediates/Tatyana.build/Debug-iphoneos/Tatyana.build/Objects-normal/armv7s/LoginViewController.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 \"The file “LoginViewController.d” couldn’t be opened because there is no such file.\" UserInfo=0x7f92323dd8f0 {NSFilePath=/Users/rsmith/Library/Developer/Xcode/DerivedData/Tatyana-cddwympaoafzixdpzoffsonzpsyb/Build/Intermediates/Tatyana.build/Debug-iphoneos/Tatyana.build/Objects-normal/armv7s/LoginViewController.d, NSUnderlyingError=0x7f923074c2f0 \"The operation couldn’t be completed. No such file or directory\"}. User info: {\n NSFilePath = \"/Users/rsmith/Library/Developer/Xcode/DerivedData/Tatyana-cddwympaoafzixdpzoffsonzpsyb/Build/Intermediates/Tatyana.build/Debug-iphoneos/Tatyana.build/Objects-normal/armv7s/LoginViewController.d\";\n NSUnderlyingError = \"Error Domain=NSPOSIXErrorDomain Code=2 \\\"The operation couldn\\U2019t be completed. No such file or directory\\\"\";\n }.\n Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, void (^__strong)(NSString *__strong))\n Thread: {name = (null), num = 190}\n Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.\n\n\nI commented out the section for that view and I now get this\n\n\n 8/20/14 11:12:27.837 AM Xcode[25482]: Exception raised while unarchiving document objects - *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil"
] | [
"ios",
"storyboard"
] |
[
"Facebook Graph API not showing shares",
"I need help with Facebook counts on Shareaholic wordpress plugin?\nThere is a post I know that should be showing shares/likes on the share bar, but nothing is showing. When I look at the URL in Facebook Debugger, I can see the URL is getting an oAuth error, although I have no idea how to fix it. I have the Facebook OGP plugin and have linked my Facebook app and most URLs work ok, but this particular one is not.\n\nIf I go here: http://graph.facebook.com/http://www.amyjbennett.com/2015/10/06/feathers-season-2-episode-9-with-heather-tollison/\n\nyou'll see I get the ID but not the shares.\n\nBut, the graph API that I found in my Facebook Developer application for this URL returns:\n\n{\n \"error\": {\n \"message\": \"An access token is required to request this resource.\",\n \"type\": \"OAuthException\",\n \"code\": 104,\n \"fbtrace_id\": \"BIuSensfLPZ\"\n }\n}\n\n\nHow can I get it to return without error and include the shares (which I know it has)."
] | [
"wordpress",
"facebook",
"api",
"facebook-graph-api"
] |
[
"EditText Crashes App When It Set to Empty ( Android )",
"I have an EditText and when I set it to Empty and Click on my Button, my App crashes.\n\nWhen I view it in Android Monitor it points to the line: \n\nfinal int addTm = Integer.parseInt(Teaching);\n\n\nHere is my code:\n\nLinearLayout\n\n <LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:padding=\"2dp\">\n\n <TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"10dp\"\n android:layout_weight=\"1\"\n android:text=\"\" />\n\n <EditText\n android:id=\"@+id/tM\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"24dp\"\n android:layout_marginRight=\"50dp\"\n android:ems=\"1\"\n android:inputType=\"number\"\n android:maxLength=\"1\"\n android:text=\"0\" />\n <Button\n android:id=\"@+id/submitBtn\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Submit\" />\n\n </LinearLayout>\n\n\nAnd my Java Code:\n\nSubmit.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View view) {\n\n String Teaching = Tm.getText().toString();\n final int addTm = Integer.parseInt(Teaching);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference myRef = database.getReference(\"sub\").child(\"TM\");\n myRef.runTransaction(new Transaction.Handler() {\n @Override\n public Transaction.Result doTransaction(MutableData mutableData) {\n Integer currentValue = mutableData.getValue(Integer.class);\n if (currentValue == null) {\n mutableData.setValue(0);\n } else {\n mutableData.setValue(currentValue + addTm);\n }\n\n return Transaction.success(mutableData);\n }\n\n @Override\n public void onComplete(DatabaseError databaseError, boolean committed, DataSnapshot dataSnapshot) {\n System.out.println(\"Transaction completed\");\n }\n\n });\n }\n });"
] | [
"java",
"android"
] |
[
"Protractor - How to sendKeys to contenteditable div?",
"I need to test this contenteditable <div> element. sendKeys is not working.\n<quill-editor format="html" class="ng-untouched ng-pristine ng-valid ng-star-inserted">\n <div quill-editor-element="" class="ql-container ql-snow">\n <div class="ql-editor ql-blank" data-gramm="false" contenteditable="true" data-placeholder="Insert text here ...">\n <p style="padding: 0px; margin: 0px;"><br></p>\n </div>\n <div class="ql-clipboard" contenteditable="true" tabindex="-1">\n </div>\n </div>\n</quill-editor>\n\nI tried the below code but I'm getting below error;\n\nelement not interactable"\n\nelement(by.css('.ql-editor')).click();\nelement(by.css('.ql-editor')).sendKeys('Test');\n\nWhat can I use to enter text in this field?"
] | [
"javascript",
"typescript",
"jasmine",
"protractor"
] |
[
"WPF & Expression studio",
"I've created a WPF application afterwards i added some effects using expression blend.\n\nNow when i try to run the application it wont run without \"Microsoft.Expression.Effects.dll\"\n\nI really want to keep the application in one EXE file. is there anyway to do it?"
] | [
"c#",
"wpf",
"dll",
"expression-blend"
] |
[
"Export excel file with macro saved in it",
"I have a vba function in access that runs some SQL commands and at the end exports one of the tables to excel. I was wondering if there was a way to save a macro in the excel spreadsheet when it exports it? I posted the line of code below that exports the table:\n\nDoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, \"PDFVerified\", \"Rev-H\""
] | [
"sql",
"ms-access",
"vba",
"export"
] |
[
"IIS PHP create file on remote windows machine",
"I am running a php script on IIS server and trying to create files in a folders. \n\nBasically, everything works fine just as long as the file path is on same server. However, if i change the path to another server then the following message appears:\n\n\n Warning: fopen ... failed to open stream: Permission denied in ...\n\n\nI understand that a problem lies in the permissions setting on the remote machine, but even when I grant full access for everyone on the remote server the problems persist.\n\nI suspect that the issue is related to a permission setting in IIS, because I need to run a script as another user. \n\nHas anyone else experienced this issue?"
] | [
"windows",
"iis",
"permissions"
] |
[
"login form submit button responsitivity issue?",
"I have coded a login form but it has responsitivity issues with it's submit button and along I want the padding inside the form to decrease also. I do know media queries but I don't want to use those so if you people can propose a solution without using media queries as : \n\n\r\n\r\n/* VMS Forms ((START)) */\r\n\r\n.vms-form-container {\r\n margin: 0 auto;\r\n}\r\n\r\n.vms-form-container a {\r\n text-decoration: none;\r\n}\r\n\r\n.vms-form-footer a:hover {\r\n color: white;\r\n}\r\n\r\n.vms-form-footer a:visited {\r\n color: white;\r\n}\r\n\r\n.vms-form {\r\n text-align: center;\r\n border: 1px solid #a68888;\r\n padding: 9% 17% 8% 17%;\r\n font-family: Arial;\r\n}\r\n\r\n.vms-form-footer {\r\n text-align: center;\r\n padding: 7% 17% 7% 17%;\r\n background-color: rgb(37, 80, 87);\r\n color: white;\r\n}\r\n\r\n.vms-form-inner {\r\n margin-top: 37px;\r\n}\r\n\r\n.vms-form-inner input {\r\n display: block;\r\n margin:0 auto;\r\n padding: 7px;\r\n width: 73%;\r\n margin-bottom: 15px;\r\n border: 1px solid #d6cfcf;\r\n}\r\n\r\n.vms-form-inner input:focus {\r\n border: 1px solid rgb(221,129,126);\r\n}\r\n\r\n.vms-form-inner .vms-form-submit {\r\n background-color: rgb(199, 109, 106);\r\n display: block;\r\n padding: 7px 121px 7px 121px;\r\n color: white;\r\n border-radius: 2px;\r\n}\r\n\r\n.vms-form-inner .vms-form-submit span {\r\n position: absolute;\r\n margin-top: -25px;\r\n margin-left: 130px;\r\n display: block;\r\n background-color: rgb(184, 98, 95);\r\n padding: 5px 11px 5px 11px;\r\n border-radius: 2px;\r\n}\r\n\r\n.vms-form-inner a {\r\n text-align: right;\r\n display: block;\r\n width: 342px;\r\n font-size: 12px;\r\n}\r\n\r\n.vms-form-title {\r\n font-size: 175%;\r\n color: #483535;\r\n letter-spacing: 2.5px;\r\n margin-bottom: 10px;\r\n}\r\n\r\n.vms-form-title-bold {\r\n font-weight: bold;\r\n}\r\n\r\n.vms-form-title-bottom-border {\r\n width: 80px;\r\n height: 1px;\r\n margin: 0px auto;\r\n border-bottom: 2px solid #483535;\r\n}\r\n\r\n\r\n\r\n/* VMS Forms ((END)) */\r\n<div class=\"container\" style=\"padding-top: 60px;padding-bottom: 60px;\">\r\n\r\n <!-- VMS Form -->\r\n <div class=\"vms-form-container col-sm-8\">\r\n <div class=\"vms-form\">\r\n <div class=\"vms-form-title\">\r\n VENUE <span class=\"vms-form-title-bold\">LOGIN</span>\r\n </div>\r\n <div class=\"vms-form-title-bottom-border\"></div>\r\n <div class=\"vms-form-inner\">\r\n <form>\r\n <input type=\"text\" name=\"email\" placeholder=\"Email\">\r\n <input type=\"password\" name=\"password\" placeholder=\"Password\">\r\n <br>\r\n <button type=\"submit\">\r\n <div class=\"vms-form-submit\">LOGIN <span>✔</span></div>\r\n </button>\r\n <a href=\"#!\">> Forgot Password ? Reset</a>\r\n </form>\r\n </div>\r\n </div>\r\n <div class=\"vms-form-footer\">\r\n <a href=\"#!\">\r\n <img src=\"../images/vms/icon-vms-form-footer.png\">\r\n > or create an account\r\n </a>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\n\nEXPECTED OUTPUT IN ALL SCREENS :"
] | [
"html",
"css",
"forms"
] |
[
"Cython - Why is the index assignment statement inside my loop still yellow?",
"I am trying to learn Cython and trying to write a speedy version of a bootstrapping function. My main loop has one pesky statement which is still yellow and I can't figure out why it's yellow. I would really appreciate help, thank you.\n\nimport numpy as np\ncimport numpy as np\nfrom libc.stdlib cimport rand, RAND_MAX\n\n\nctypedef np.float64_t FLOAT_t\n\ncpdef FLOAT_t cython_avg(np.ndarray[FLOAT_t, ndim=1] A):\n cdef double [:] x = A\n cdef double s = 0\n cdef unsigned int N = A.shape[0]\n for i in xrange(N):\n s += x[i]\n return s/N\n\n\ndef confidence_interval_mean(np.ndarray[FLOAT_t, ndim=1] sample,int its,int p):\n cdef int n = len(sample)\n cdef double[:] means = np.zeros(its,dtype=np.float)\n cdef np.ndarray[FLOAT_t, ndim=1] s = np.zeros(n,dtype=np.float)\n for i in xrange(its):\n for j in xrange(n):\n s[j] = sample[<int>(rand()/RAND_MAX * n)]\n means[i] = cython_avg(s)\n return np.percentile(means,[(100-p)/2,(100+p)/2])\n\n\nThe line which is inside the two for loops:"
] | [
"python",
"numpy",
"cython"
] |
[
"Multiple Carrierwave mount_uploader on a single model",
"I have a model called Recipe which has 2 images that use carrierwave, so in this model i have this to setup carrierwave\n\nmount_uploader :author_photo, AuthorUploader\nmount_uploader :photo, PhotoUploader\n\n\nI have also added multiple version to my images such as thumb, small, medium, large\n\nThe problem is. say i have 2 images\n\nChocolate_Cake.jpg as the photo\nMy_Photo.jpg as author_photo\n\n\nWhen i go into console and load up my recipe and to recipe.to_json, I get both my images back from carrierwave but they are both showing the photo for the recipe, not the author photo.\n\n \"recipe\": [\n {\n \"author_photo\": {\n \"url\": \"/uploads/recipe/photo/8/Chocolate_Cake.jpg\",\n \"thumb\": {\n \"url\": \"/uploads/recipe/photo/8/thumb_Chocolate_Cake.jpg\"\n },\n \"small\": {\n \"url\": \"/uploads/recipe/photo/8/small_Chocolate_Cake.jpg\"\n },\n \"medium\": {\n \"url\": \"/uploads/recipe/photo/8/medium_Chocolate_Cake.jpg\"\n },\n \"large\": {\n \"url\": \"/uploads/recipe/photo/8/large_Chocolate_Cake.jpg\"\n }\n },\n \"id\": 8,\n \"photo\": {\n \"url\": \"/uploads/recipe/photo/8/Chocolate_Cake.jpg\",\n \"thumb\": {\n \"url\": \"/uploads/recipe/photo/8/thumb_Chocolate_Cake.jpg\"\n },\n \"small\": {\n \"url\": \"/uploads/recipe/photo/8/small_Chocolate_Cake.jpg\"\n },\n \"medium\": {\n \"url\": \"/uploads/recipe/photo/8/medium_Chocolate_Cake.jpg\"\n },\n \"large\": {\n \"url\": \"/uploads/recipe/photo/8/large_Chocolate_Cake.jpg\"\n }\n },\n\n\nSo for some reason my json response isnt showing my uploaders properly.\n\nIf i was to type this in console, \n\n recipe.photo\n recipe.author_photo\n\n\nThey come up with different image urls"
] | [
"ruby-on-rails-3",
"json",
"image",
"carrierwave",
"uploader"
] |
[
"Java: File path error",
"File defaultCss=new File(this.getClass().getResource(\"application.css\").getFile());\n\nPiChart.getScene().getStylesheets().add(\"file:///\" + defaultCss.getAbsolutePath().replace(\"\\\\\", \"/\"));\n\n\nThe above line in Controller.java fetches the required resource in Eclipse while running, but when exported to an executable JAR, it is not fetching the file.\n\nBecause:\nIn Eclipse the line fetches\nsrc/com/piscope/application.css\n\nIn JAR, the path is:\ncom/piscope/application.css\n\nPlease let me know the path to be set so that one can run both eclipse and JAR executions without errors. \nNote: Since the file is the source for the software package,the file needs to be inside the JAR file."
] | [
"java",
"eclipse",
"jar",
"javafx"
] |
[
"ASP Identity table column change but mapping is not possible with new column name",
"I have changed the asp Identity so that in database Id column of AspNetIdentity table be UserId:\n\nmodelBuilder.Entity<ApplicationUser>()\n .Property(p => p.Id)\n .HasColumnName(\"UserId\");\n\n\nAnd that works fine. Generated table have UserId instead Id.\nNow I have another table that should be mapped with AspNetUsers by UserId:\nWhen write it this way:\n\npublic class JobApply\n { ...\n public int UserId { get; set; } \n public virtual ApplicationUser ApplicationUser { get; set; }\n\n\nTable in database looks like:\n\nAnd if I write it like this:\n\npublic class JobApply\n { ...\n public int ApplicationUserId { get; set; }\n public virtual ApplicationUser ApplicationUser { get; set; }\n\n\ndatabase looks like:\n\n\nFirst option created UserId field but it is not FK instead of that new field is added as FK.\nHow can I properly map this to have table JobApply with field UserId to be FK to AspNetUsers?\n\nUPDATE\n\nWhen I add this:\n\nbase.OnModelCreating(modelBuilder);\n\n modelBuilder.Entity<ApplicationUser>()\n .Property(p => p.Id)\n .HasColumnName(\"UserId\");\n\n modelBuilder.Entity<JobApply>()\n .HasRequired(e => e.ApplicationUser)\n .WithMany()\n .HasForeignKey(e => e.UserId);\n\n\nTables relation looks like this:\n\nThis is both classes:\n\npublic class ApplicationUser : IdentityUser<int, ApplicationUserLogin, ApplicationUserRole, ApplicationUserClaim>\n {\n public string Email { get; set; }\n public string ConfirmationToken { get; set; }\n public bool IsConfirmed { get; set; }\n public string PasswordResetToken { get; set; }\n\n public int CityId { get; set; }\n public virtual City City { get; set; }\n\n\n public virtual ICollection<JobApply> JobApplies { get; set; }\n }\n\npublic class JobApply\n {\n public int JobApplyId { get; set; }\n public int UserId { get; set; }\n public int JobId { get; set; }\n public int JobApplyStatusId { get; set; }\n public DateTime CreatedDate { get; set; }\n\n public virtual ApplicationUser ApplicationUser { get; set; }\n public virtual Job Job { get; set; }\n public virtual JobApplyStatus JobApplyStatus { get; set; }\n\n }"
] | [
"c#",
"entity-framework",
"entity-framework-6",
"asp.net-identity"
] |
[
"Getting tweets into JQuery list, having issues with refresh",
"I'm having difficulty figuring how A) if this is the best way to parse a Twitter JSON response and put it into a jquery list. B) why the <li> items fall apart when I refresh the page.\n\nHere is how I'm loading the tweets\n\nvar _url = 'https://api.twitter.com/1/statuses/user_timeline/tortugatruck.json?callback=?&include_rts=1&count=3';\n$.getJSON(_url,function(data){\nfor(var i = 0; i< data.length; i++){\n var tweet = '<p>'+data[i].text;\n var created = parseDate(data[i].created_at);\n var createdDate = created.getDate()+'-'+(created.getMonth()+1)+'-'+created.getFullYear()+' at '+created.getHours()+':'+created.getMinutes();\n tweet = tweet.parseURL().parseUsername().parseHashtag();\n tweet += '<div><div><a href=\"https://twitter.com/#!/CypressNorth\" target=\"_blank\" class=\"black\">@CypressNorth</a></div><div class=\"right\"><a href=\"https://twitter.com/#!/CypressNorth/status/'+data[i].id_str+'\">'+createdDate+'</a></div></div>'\n //$(\"#twitter-feed\").append('<p>'+tweet+'<p>');\n $(\"#twitter-feed\").append($(\"<li><a href='#'>\"+tweet+\"</a></li>\"));\n //$('#twitter-feed').listview('refresh');\n }\n});\n\n\nHere is my markup\n\n <div data-role=\"content\">\n <ul data-role=\"listview\" data-inset=\"true\" id=\"twitter-feed\">\n <li><a href=\"#\">Tweets on a page</a></li>\n </ul>\n </div>\n\n\nThe first time I navigate to the page it looks fine (no styles but you can see the individual list items).\n\n\nBut if you refresh the page, I lose the list item styles and navigation ability."
] | [
"jquery",
"cordova",
"jquery-mobile",
"twitter"
] |
[
"Link not showing up in div, but buttons do",
"I've been completely stuck for hours because of this problem. I have a div container which has a dynamically created fragment being inserted before a link button. However, the link doesn't show up. If I change the link to a <input type=\"image\"> or <input type=\"button\">, then it will show up. The only way I can get the link to show up is to use absolute positioning, but that just breaks everything else.\n\nThis is the HTML\n\n<div id=\"container\">\n <a href=\"#\" id=\"button\" onClick=\"function();\"></a>\n</div>\n\n\nand this is my CSS\n\n#container {\n display: none;\n background: url(../img/background.png) top left repeat;\n text-align: center;\n padding-top: 55px;\n padding-bottom: 68px;\n width: 100%;\n}\n\n#button {\n margin: 10px;\n width: auto;\n height: 40px;\n background: url(../img/button.png) no-repeat bottom;\n background-size: 100% 100%;\n}\n\n#button:hover {\n background: url(../img/buttonpress.png) no-repeat bottom;\n}\n\n\nDoes anyone know what could be causing this?"
] | [
"css",
"html",
"button",
"hyperlink"
] |
[
"CKEditor - No toolbars",
"So I got a textarea with CKEditor plugin but I just want it clean, without anything. No toolbars and no status or whatever bar. It´s simple but I can´t find it on docs or web!\n\nMy CKEditor is started with:\n\n$('#texto').ckeditor({skin:'office2003'});"
] | [
"javascript",
"ckeditor"
] |
[
"Mysql update if (some statement)",
"I wanna create a mysql update only if the table does not contain the specified value(if player have empty slot)\n\nMy Idea:\n\nupdate player_items \nset slot=20 \nwhere id=0 \nand uid=2 \nand (SELECT COUNT(*) \n FROM player_items \n WHERE slot=12 and uid=2) = 0;\n\n\ncode in sqlfiddle\n\nI hope this can be only one mysql question"
] | [
"mysql",
"count"
] |
[
"Delete duplicate records in SQL",
"I have this SQL query to select all the duplicated customers who have no orders :\n\nselect distinct * from [KUNDEN] k1\nwhere not exists (\nselect * from [BELEG] b\nwhere k1.Nummer = b.Adressnummer)\nand exists (\nselect * from [KUNDEN] k2\nwhere k1.Nummer <> k2.Nummer\nand k1.Name = k2.Name\nand k1.Vorname = k2.Vorname)\n\n\nHow can I change this query in order to delete these customers ?\n\nThanks for your help"
] | [
"mysql",
"sql"
] |
[
"How/when memory is assigned to global variables in C",
"I am aware of C memory layout and binary formation process.\nI have a doubt/query regarding the phase when and who assigns address to global variables. \n\nextern int dummy; //Declared in some other file \nint * pTest = &dummy;\n\n\nThis code compiles well. Here pTest will have address of dummy only if address is assigned to it.\nI want to know in which phase (compilation or linker) does dummy variable gets address?"
] | [
"c"
] |
[
"Problem instantiating a package with subtype access to variant record",
"I try to compile an Ada 95 program with an Ada 2012 compiler. However there are problems with instantiation of the generic package Garbage_Collector. The subtype A_Term is not accepted in the package instantiation:\nprolog.adb:27:15: designated type of actual does not match that of formal "Link"\nprolog.adb:27:15: instantiation abandoned\n\nI have tried to change A_Term to type A_Term is access A_Node;. Then the package will instantiate, but the rest of the code breaks. Has something changed since Ada 95 and how can I make it work in Ada 2012?\nprocedure Prolog is\n\n generic\n type Item is limited private;\n type Link is access Item;\n package Garbage_Collector is\n procedure Get (L : in out Link) is null;\n end Garbage_Collector;\n\n type Node_Tag is (A, B);\n\n type Node (Tag : Node_Tag);\n type Term is access Node;\n\n type Node (Tag : Node_Tag) is\n record\n case Tag is\n when A => null;\n when B => null;\n end case;\n end record;\n\n subtype A_Node is Node (A);\n subtype A_Term is Term (A);\n package Gc_A is new Garbage_Collector\n (Item => A_Node,\n Link => A_Term);\n\n T : Term;\nbegin\n Gc_A.Get (T);\nend Prolog;\n\nThe code is from a Prolog module from Stanford University. The project on GitHub"
] | [
"generics",
"ada"
] |
[
"Efficient algorithm for hashing subgraphs?",
"Is there an algorithm for hashing subgraphs (consisting of the nodes and edges) of a given graph? Similarly, the particular graph I am talking about is a molecular network, and the intent of hashing the subgraph of the network is to see if given a different network, there is a particular subgraph that matches the previously hashed subgraph. \n\nI am not concerned with the runtime of finding all the subgraphs themselves. I am concerned with given a particular hashed subgraph, and another subgraph, whether I can discover if the subgraph is one that I have seen before in O(1) time."
] | [
"algorithm",
"hash",
"graph-algorithm"
] |
[
"Laravel select where/count query",
"There are two Mysql tables:\n\n\n\n1.reservations(id,screening_id,reserved). the reserved is a boolean its value \"1\". \n\n\n\n\ntable seat_reserveds(id,screening_id,reservation_id,seat_id). \n\n\n\n\nI want the following:\n1.get the reservation id\n select id from reservation where screening_id = id and reserved = 1\nIn laravel looks like:\n\n $reservation_id = DB::table('reservations')->select('id')- \n >where('screening_id',$id)->where('reserved','1')->get();\n\n\nThen I want to count how many seats are reserved\n\n\n\nSelect count(id) from seat_resrveds where where screening_id = id and reservtain_id = id.\nIn laravel looks like: \n\n $reservedtickets = DB::table('seat_reseverds')- \n >where('screening_id',$id)->where('reservation_id',$reservation_id)->count('id');\n\n\nI think the problam is that I get \"id\":number from $reservation_id so cant use it at the $reservedtitckets query because I only need a number.\nHow can I write these querys."
] | [
"mysql",
"laravel",
"select",
"count"
] |
[
"performance of matlab's image processing toolkit",
"I've Heard that Matlab's image processing library is quite slow compared to Java's image processing library..\n\nis that true ??\n\nIf thats the case, then will it be feasible to implement applications like CBIR Image search engine using Matlab ??"
] | [
"matlab",
"image-processing",
"cbir"
] |
[
"Backbone event callback is called when bound, not triggered",
"I am trying to implement a simple mediator pattern for events, but my event callbacks are being called when I register them with the mediator.\n\nThe Mediator is simply:\n\ndefine(function(require){\n 'use strict';\n var _ = require('underscore');\n var Backbone = require('backbone');\n\n return _.extend( Backbone.Events);\n});\n\n\nI have created a simple View with no backing model or template \n\ndefine(function (require) {\n\n'use strict';\n\nvar Backbone = require('backbone');\nvar mediator = require('mediator');\n\nvar Sandbox = Backbone.View.extend({\n\n el: '.sandbox',\n initialize: function () {\n this.render();\n this.bindEvents();\n },\n\n bindEvents:function(){\n mediator.on(\"sandbox:change\", this.changeText(), this );\n },\n\n render: function () {\n $(this.el).html(\"SANDBOX VIEW IS WORKING\");\n },\n\n changeText: function () {\n $(this.el).html(\"THE TEXT HAS CHANGED\");\n }\n});\n\nreturn Sandbox;\n\n});\n\n\nWhen the view is loaded, the sandbox:change event is fired off and the changeText function is called even though nothing has called mediator.trigger('sandbox:change')\n\nWhy is the callback invoked when it is simply being bound to the mediator object?"
] | [
"javascript",
"backbone.js"
] |
[
"Changing values in column selectively. Python Pandas",
"for example i have a fruit dataset that contains the name and colour. How do i change the values in colour column based on the fruit name that i select?\n\n Name Color\n Apple NaN\n Pear Green\n Pear Green\n Banana Yellow\n Watermelon Green\n\n\nI have a rough idea but i have no idea how to code it.\n\n df[Name] == Apple then df[color] == Red"
] | [
"python",
"pandas"
] |
[
"Alexa having trouble understanding my voice input",
"I am working on an Alexa Skill and am having trouble for Alexa to understand my voice input. Therefore the utterances are not properly matched with the required slots... and alexa is always re asking or getting stuck.\nHere are some examples:\naffirm: f.m., a from\nSpeedbird: Speedboard, speaker, speed but, speed bird, spirit, speedbath\nwind: windies (wind is), when is home (wind is calm)\nrunway 03: runway sarah three\ntakeoff: the cough\nAny solution to training Alexa to properly understand me? Or should I just write as utterance all these "false" utterances so alexa will match my intents properly?\nThanks for any help!"
] | [
"alexa",
"alexa-skills-kit",
"alexa-skill",
"alexa-voice-service"
] |
[
"Tomcat Persistence Manager Kills Session Logins",
"For my web app, I use tomcat declarative security to tie login credentials to the company Active Directory. On two of our servers, logins were timing out after one minute of inactivity. On the other two servers, there is a thirty minute timeout (which is what I want).\n\nYeseterday, I found the cause of the problem. The two servers with one minute timeouts have a tomcat Persistence Manager enabled to write session information to disk. Our IT guy is out this week, so I don't know the exact details of what he was trying to accomplish with this, but he had set PersistenceManager up like this in context.xml:\n\n<Manager sessionIdLength=\"64\" className=\"org.apache.catalina.session.PersistentManager\"\n maxIdleBackup=\"10\" maxIdleSwap=\"30\">\n <Store className=\"org.apache.catalina.session.JDBCStore\" dataSourceName=\"jdbc/Auth\"\n sessionTable=\"sessions\" sessionAppCol=\"app_name\" sessionDataCol=\"session_data\" sessionIdCol=\"session_id\"\n sessionLastAccessedCol=\"last_access\" sessionMaxInactiveCol=\"max_inactive\" sessionValidCol=\"valid_session\" />\n</Manager>\n\n\nI did some research and discovered that the Idle numbers are in seconds. Thinking that might be the culprit I changed the Manager portion to:\n\n<Manager sessionIdLength=\"16\" className=\"org.apache.catalina.session.PersistentManager\"\n maxIdleBackup=\"600\" maxIdleSwap=\"3600\" minIdleSwap=\"1800\">\n\n\nThis fixed my problem. So it appears that forcing the Persistence Manager to write sessions out to disk after thirty seconds of inactivity was killing my session logins. I tracked the JSESSIONID cookie and found that the cookie remained the same even after the user is forced back to the login screen. It only changes when you re-login. This is what you would expect, because persisting the session to disk couldn't possibly change the session id. However, it does cause my declarative security model to force the user to log in again.\n\nI did find in the manual that the maxIdleSwap variable not only controls persisting sessions to disk, but also causes the \"passivating of the session out of server memory\". This sounds a bit suspicious to me.\n\nDoes anyone have any experience with this issue? Why does the Persistence Manager kill my web app logins when it persists sessions to disk? Is there any way around this without changing the swap control variables like I did?"
] | [
"apache",
"session",
"tomcat",
"tomcat7",
"persistence-manager"
] |
[
"What is the correct cache size to prevent tomcat log from getting flooded with cache warning messages",
"I am running Apache Tomcat/9.0.19 and recently I have noticed a lot of warning messages on the catalina.out log.\n\nWARNING [main] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/maps/scripts/app-72be477367.js.map] to the cache for web application [##01] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache\n\nWARNING [main] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/maps/scripts/app-f223be6846.js.map] to the cache for web application [##01] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache\n\n\nAdding the following line to the conf/context.xml solves this problem and my log is no longer flooded.\n\n <Resources cachingAllowed=\"true\" cacheMaxSize=\"100000\" />\n\n\nHow do I know what is the correct entry for my cacheMaxSize. Am I over-allocating space to cache."
] | [
"tomcat9"
] |
[
"I need to get a value of specific object's property, but don't know the type of the object",
"I have got an c# object and I don't know the type of this object. (i.e. object o)\nWhat I know is that this object has a member called 'ID' of type int.\n\nI wanted to get the value of this property but I am not good enough with reflection...\n\nI can get a type and members of this object:\n\nType type = obj.GetType();\nSystem.Reflection.MemberInfo[] member = type.GetMember(\"ID\");\n\n\n...but don't know what to do next :-)\n\nThanks for help in advance\nMariusz"
] | [
"c#",
"reflection"
] |
[
"what's the difference between std::codecvt and std::codecvt_utf8",
"there is a question makes me feel confused. What the exactly difference between std::codecvt and std::codecvt_utf8? As the STL reference saying, std::codecvt_utf8 is a drived class from std::codecvt, but could you please tell me why this function would throw an exception?\n\nstd::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t>> cvtUtf8 { new std::codecvt_byname<wchar_t, char, std::mbstate_t>(\".65001\") };\nstd::wstring_convert<std::codecvt_utf8<wchar_t>> cvt_utf8;\n\nstd::string strUtf8 = cvt_utf8.to_bytes(L\"你好\");\nstd::string strUtf8Failed = cvtUtf8.to_bytes(L\"你好\"); // throw out an exception. bad conversion"
] | [
"c++",
"unicode",
"utf-8"
] |
[
"Finding a string with strpos() that may contain CRLF",
"I have a large amount of text (originally from a text file) and am using strpos() to find small extracts of it. This works fine in most cases however when there is a CRLF before or after (or possibly both) the extract is not found (strpos() returns false).\n\nAny tips or pointers that will help me find a way around this?"
] | [
"php"
] |
[
"Finding elements of std::vector in std::set",
"I have two containers std::set and std::vector and my task is to return elements from std::vector which are present in std::set. What is the most effective way to achieve it? \nSimple solution:\nIterate through elements of vector and call set.find on each and then vector.erase if not found."
] | [
"c++",
"c++11",
"vector",
"stl",
"set"
] |
[
"Can't create/display php images - GD Image corrupt or truncated",
"I'm having a problem and i'd like some help please.\nI have made a script for creating an image with PHP using GD library, but the problem is when i preview it on the Firefox it shows me an error in Firebug: \"Image corrupt or truncated:localhost/my_scripts/images.php\". NOTE: this is not an error displayed from PHP, it seems more like an error comming from the browser.\n\nI have checked my code for syntaxes many times, i have also tried out and other gd functions, like imagegif, imagettftext etc etc but didn't have any effect. Here's my code:\n\n//$image = @imagecreate(200, 20)or die(\"Cannot Initialize new GD image stream\");\n$image = imagecreate(200, 20);\n$background = imagecolorallocate($image,0,0,0);\n$foreground = imagecolorallocate($image,255,255,255);\nimagestring($image,5,5,1,\"This is a Test\",$foreground);\nheader(\"Content-type: image/jpeg\");\nimagejpeg($image);\nimagedestroy($image);\n\n\nGD library is enabled i've already checked that in phpinfo(), and I have also tried to preview it and on Chrome and looks the same. Any ideas what i might doing wrong or why happens this? and how can i fix this error??"
] | [
"php",
"image",
"gd",
"brokenimage"
] |
[
"Does cursor copy the result set?",
"For example, if i use following code to query some data from database.\n\nUri uri = Uri.parse(\"content://com.android.contacts/contacts?address_book_index_extras=true\");\n String selection = \"LEFT OUTER JOIN (select raw_contact_id, data1 from data where mimetype_id = 5) AS phone_data ON(_id = phone_data.raw_contact_id)\"; \n Cursor c = getContentResolver().query(Contacts.CONTENT_URI, null, selection, null, null);\n\n\nWhat i want to ask is after the query method, does database copy its result set to cursor or just make cursor something like a pointer and point to the first line of result set and query for more data when we call `moveToNext'\nthanks"
] | [
"android",
"database",
"android-cursor"
] |
[
"uncaught ArgumentCountError: Too few arguments to function in codeigniter",
"I want to pass data from model to controller in codeigniter and get this error :\n\n\n An uncaught Exception was encountered Type: ArgumentCountError\n Message: Too few arguments to function Debitur::get_data_sms(), 0\n passed in\n C:\\xampp\\htdocs\\sms_gateway_2\\application\\controllers\\User.php on line\n 119 and exactly 3 expected\n \n Filename: C:\\xampp\\htdocs\\sms_gateway_2\\application\\models\\Debitur.php\n \n Line Number: 9\n \n Backtrace:\n \n File: C:\\xampp\\htdocs\\sms_gateway_2\\application\\controllers\\User.php\n Line: 119 Function: get_data_sms\n \n File: C:\\xampp\\htdocs\\sms_gateway_2\\index.php Line: 315 Function:\n require_once\n\n\nThis is my function in model (Debitur.php) :\n\n public function get_data_sms($nama_deb, $no_hp, $tunggakan)\n { \n\n $array = array('nama_deb' => $nama_deb, 'no_hp' => $no_hp, 'tunggakan' => $tunggakan);\n $query = $this->db->getwhere('sms_debitur', $array);\n\n return $query->result();\n }\n\n\nThis is my function in controller (User.php) :\n\n public function sending_sms(){\n\n $this->load->library('bulkSms');\n\n $data= $this->debitur->get_data_sms();\n\n if ($data){\n $bulkSms = new bulkSms('***');\n\n $device = 111;\n $options = [];\n\n $number = $no_hp;\n $message = \"To \".$nama_deb.\" payment \".$tunggakan.\"..\";\n\n $result = $bulkSms->sendMessageToNumber($number, $message, $device, $options);\n\n if (count($result['response']['result']['success']) > 0) {\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\">Berhasil mengirim sms</div>');\n } else {\n $this->session->set_flashdata('message', '<div class=\"alert alert-danger\">Gagal mengirim sms</div>');\n }\n\n redirect('user/send_sms', 'refresh');\n\n }\n}"
] | [
"php",
"mysql",
"codeigniter-3"
] |
[
"Applying dictionary to dictionary",
"Recently I've found a technique of applying dict to dict. It is something like this:\n(3 4 5!6 7 8)[(`a`b)!(2 3)] ~ (`a`b!0N 6)\n\nor even this, which looks more natural for reading from left to right:\n(@[;(`a`b)!(2 3)](3 4 5!6 7 8)) ~ (`a`b!0N 6)\n\nCan I use this behavior (are there any caveats)? Is it described somewhere in the official docs?\n\nIt seems like absolutely mind-blowing technique: we definitely apply function(list/dictionary/table) to it's argument, not just pass argument to a function."
] | [
"kdb",
"k"
] |
[
"php's set_time_limit(0) hangs and throws HTTP 500",
"This simple test, that calls set_time_limit 10 times:\n\n<?php\necho(\"<html><head><title>set_time test</title></head><body><h1>set_time test</h1>\");\nfor ($i=0; $i<10; $i++) {\n error_log(\"Round $i\");\n set_time_limit(0); echo(\"<p>$i</p>\");\n}\necho(\"</body></html>\");\n\n\nHangs forever with error:\n\n // Fatal error: Maximum execution time of 30 seconds exceeded in .../_set_time.php on line 4\n // Call Stack:\n // 0.0007 231768 1. {main}() .../_set_time.php:0\n // 0.0007 232000 2. set_time_limit() .../_set_time.php:4\n\n\n30 seconds is the value of max_execution_time in php.ini. If I raise it to 3000, the scripts just keeps spinning. I have AllowOverrideAll for the document root in apache's config (assuming it matters - it shouldn't, but still)\n\nA similar machine (same OS & SW versions, config very close) runs the script flawlessly each time. Log files show nothing. Google searches are mostly silently or irrelevant. Seems some weird system/configuration quirk.\n\nIdeas?\n\n\n OS: CentOS 6.9\n apache 2.2.15\n php 5.6 (webtatic RPM:php56w-5.6.30-1.w6.x86_64)\n\n\nEdit: Submitted to the xdebug project as bug: https://bugs.xdebug.org/view.php?id=1457"
] | [
"php",
"linux",
"apache",
"centos"
] |
[
"make errors undefined reference to",
"I'm using a headless image and compiling this simple code in GNU bash. I receive these linker errors\n\n#include <IL/il.h> \n#include <IL/ilu.h> \n#include <IL/ilut.h> \n#include <stdio.h> \n#include <stdlib.h> \n#include <string.h> \n\nint main(int argc, char **argv) \n{ \n ILuint ImgId;\n\n // Initialize DevIL. \n ilInit(); \n\n // Generate the main image name to use. \n ilGenImages(1, &ImgId); \n\n // Bind this image name. \n ilBindImage(ImgId); \n\n // Loads the image specified by File into the image named by ImgId. \n if (!ilLoadImage(argv[1])) { \n printf(\"Could not open file...exiting.\\n\"); \n return 3; \n } \n\n // Display the image's dimensions to the end user. \n printf(\"Width: %d Height: %d Depth: %d Bpp: %d\\n\", \n ilGetInteger(IL_IMAGE_WIDTH), \n ilGetInteger(IL_IMAGE_HEIGHT), \n ilGetInteger(IL_IMAGE_DEPTH), \n ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL)); \n\n return 0;\n}\n\n\n\n\nroot@parallella:/home/parallella/parallella-examples/lena# make display\ncc display.c -o display\n/tmp/ccSqb23j.o: In function `main':\ndisplay.c:(.text+0xa): undefined reference to `ilInit'\ndisplay.c:(.text+0x16): undefined reference to `ilGenImages'\ndisplay.c:(.text+0x1e): undefined reference to `ilBindImage'\ndisplay.c:(.text+0x2a): undefined reference to `ilLoadImage'\ndisplay.c:(.text+0x48): undefined reference to `ilGetInteger'\ndisplay.c:(.text+0x52): undefined reference to `ilGetInteger'\ndisplay.c:(.text+0x5c): undefined reference to `ilGetInteger'\ndisplay.c:(.text+0x66): undefined reference to `ilGetInteger'\ncollect2: error: ld returned 1 exit status\nmake: *** [display] Error 1\n\n\nHow can I fix this linker problem?"
] | [
"c",
"linker-errors"
] |
[
"Kendo UI grid-not able to add/create records",
"i am new on kendo UI framework.I am using grid. The problem is the table gets updated successfully but when i add/create new record ,nothing happens.New record doesn't get added to the database.\nHere is my index.php file\n\n<div id=\"grid\"></div>\n<script>\n $(function() {\n $(\"#grid\").kendoGrid({\n dataSource: {\n transport: {\n read: \"data/employees.php\",\n update: {\n url: \"data/employees.php\",\n type: \"POST\"\n },\n create: {\n url: \"data/create.php\",\n type: \"PUT\"\n }\n },\n pageSize: 20,\n error: function(e) {\n alert(e.responseText);\n },\n schema: {\n data: \"data\",\n model: {\n id: \"id\",\n fields: {\n first_name: { editable: false },\n last_name: { validation: { required: true} }\n }\n }\n }\n },\n columns: [{ field: \"first_name\" }, { field: \"last_name\" }],\n toolbar: [\"create\", \"save\", \"cancel\"],\n editable: true,\n pageable: true,\n navigatable: true,\n groupable: true,\n filterable: true\n });\n });\n</script>\n\n\nThis is create.php file\n\n <?php\n $link = mysql_pconnect(\"localhost\", \"root\", \"\") or die(\"Unable To Connect To Database Server\");\n mysql_select_db(\"northwind\") or die(\"Unable To Connect To Northwind\"); \n header(\"Content-type: application/json\");\n //Determine the request type\n $verb=$_SERVER[\"REQUEST_METHOD\"];\n //handle a get\n if($verb==\"PUT\"){\n $lastname = mysql_real_escape_string($_PUT[\"last_name\"]);\n $firstname = mysql_real_escape_string($_PUT[\"first_name\"]);\n\n $rs = mysql_query(\"INSERT INTO Employees (first_name, last_name) VALUES (\" .$firstname .\",\" .$lastname .\")\");\n\n if ($rs) {\n echo json_encode($rs);\n }\n else {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Update failed for EmployeeID: \" .$lastname;\n }\n }\n\n ?>\n\n\nAnd this is employees.php\n\n <?php\n $link = mysql_pconnect(\"localhost\", \"root\", \"\") or die(\"Unable To Connect To Database Server\");\n mysql_select_db(\"northwind\") or die(\"Unable To Connect To Northwind\"); \n header(\"Content-type: application/json\");\n //Determine the request type\n $verb=$_SERVER[\"REQUEST_METHOD\"];\n //handle a get\n if($verb==\"GET\"){\n $arr=array();\n $rs=mysql_query(\"SELECT id, last_name, first_name FROM Employees\");\n while($obj = mysql_fetch_object($rs)) {\n $arr[] = $obj;\n }\n echo \"{\\\"data\\\":\" .json_encode($arr). \"}\";\n }\n //handle a post\n if($verb==\"POST\"){\n $lastName = mysql_real_escape_string($_POST[\"last_name\"]);\n $employeeId = mysql_real_escape_string($_POST[\"id\"]);\n\n $rs = mysql_query(\"UPDATE Employees SET last_name = '\" .$lastName .\"' WHERE id = \" .$employeeId);\n\n if ($rs) {\n echo json_encode($rs);\n }\n else {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Update failed for EmployeeID: \" .$employeeId;\n }\n }\n\n ?>\n\n\nI am not able to solve this:(\nPlease help."
] | [
"javascript",
"php",
"kendo-ui",
"kendo-grid"
] |
[
"VBA PPT copy/paste chart inconsistent",
"I'm slowly getting crazy because of this problem. I'm creating a powerpoint presentation from an excel workbook, where data needs to be filled in. I'm creating multiple slides already with no issues and tackled most problems already.\n\nOne of the final things for me to do is copy a chart from excel and pasting it in my ppt. This has worked before, but suddenly it just breaks, it doesnt want to paste the chart anymore.\n\nIn my main module I call sub ROI with some required data to continue\n\n\nCall ROI(PPPRes, Slidestart, language, i)\n\n\n\nThis is in a seperate Module to keep things clean in the main module\n\n\nSub ROI(PPPRes, Slidenumber, language, proposal)\nSet pp = CreateObject(\"PowerPoint.Application\")\nDim oPPTShape As PowerPoint.Shape\nDim PPSlide As PowerPoint.Slide\nDim ColumnWidthArray As Variant\nDim i As Integer\n\n'Create a slide on Slidenumber location\nSet PPSlide = PPPRes.Slides.Add(Slidenumber, ppLayoutTitleOnly)\nPPSlide.Select\nPPSlide.Shapes(\"Title 1\").TextFrame.TextRange.Text = Range(\"Titlename in chosen language\")\nPPSlide.Shapes.AddTable(3, 3).Select\nSet oPPTShape = PPSlide.Shapes(\"Table 4\")\n\n'Filling in data in the table from an excel table. Basic stuff working with a few loops to make this happen\n\n\n 'Changing the width of the created table, column by column\n ColumnWidthArray = Array(37, 210, 180)\n Set oPPTShape = PPSlide.Shapes(\"Table 4\")\n On Error Resume Next\n With oPPTShape\n For i = 1 To 3\n .table.columns(i).width = ColumnWidthArray(i - 1)\n Next i\n .Top = 180\n .Left = 520\n .height = 200\n End With\n\n 'Add a rectangle on the slide\n PPSlide.Shapes.AddShape Type:=msoShapeRectangle, Left:=404, Top:=400, width:=153, height:=43\n\n 'Copy a picture from excel and paste it in the active slide \n Sheets(\"Shapes\").Shapes(\"ROI_img\").Copy\n PPSlide.Shapes.Paste.Select\n pp.ActiveWindow.Selection.ShapeRange.Left = 800\n pp.ActiveWindow.Selection.ShapeRange.Top = 20\n\n'Copy chart from excel (with index number that is linked to \"proposal\") and then paste onto slide\nSheets(\"Proposals\").Shapes(\"ChartInvProp\" & proposal).Copy\nPPSlide.Shapes.Paste.Select\nSet oPPTShape = PPSlide.Shapes(\"ChartInvProp\" & proposal)\nWith PPSlide.Shapes(\"ChartInvProp\" & proposal)\n .Left = 20\n .Top = 120\n .width = 480\n .height = 320\nEnd With\nend sub\n\n\n\nSo everything in the code is executed, but most of the time the chart from excel is NOT being pasted onto the slide.\nHowever, if I checked what is in the clipboard by breaking the code just after copying the chart from excel. And I then manually paste whatever is in the clipboard into a Word document I will see the chart. --> The action of copying the chart is being executed, but not the pasting part\nIf I now continue after the break, the chart will be pasted on the powerpoint somehow. But if I do NOT break the code, and let it run its course, the chart will not be pasted.\n\nSomehow it seems to need more time after copy before it can actually paste the chart. I dont really understand what is happening here.\nSometimes it only pastes Chart 1 in the slide, and when it loops for the second/third/etc... chart it doesnt want to paste it anymore.\n\nIt really is very random, and I only see a little bit of structure in it not executing..."
] | [
"vba",
"excel",
"powerpoint"
] |
[
"Specific advantages of using a winform rather than a WPF",
"Is all the functionality of a WinForm included in a WPF?\nAre there any specific advantages of using a traditional WindowsForm rather than a WPF?"
] | [
".net",
"wpf",
"winforms"
] |
[
"How can I show dotfiles in Textmate 2?",
"I recently upgraded to Textmate 2 and now my dotfiles are not showing up in the file browser. Obviously, this is important when working with stuff like .htaccess files.\n\nIs there a way to enable this feature?"
] | [
"text-editor",
"textmate2",
"dotfiles"
] |
[
"CSS First element that does not have a class",
"I've got a few list items, the first one's with a featured class and the after a while a few without. Withh CSS, I'd like to select the first item in the list that does not have a featured class...\n\nThe code is as follows:\n\n<ul>\n<li class=\"featured\"></li>\n<li class=\"featured\"></li>\n<li></li>\n<li></li>\n<li></li>\n</ul>\n\n\nI've tried the following with no effect:\n\nul li:not(.featured):first-child {\n /* Do some stuff here */\n}\n\n\nAny ideas on how to do this without resorting to jQuery?\n\nUPDATE\nThe ability does exist to add non-feature classes if that would help. E.g:\n\n<ul>\n<li class=\"listing featured\"></li>\n<li class=\"listing featured\"></li>\n<li class=\"listing\"></li>\n<li class=\"listing\"></li>\n<li class=\"listing\"></li>\n</ul>"
] | [
"css",
"css-selectors",
"pseudo-class"
] |
[
"how to run java class file in cmd line",
"my 2 classes are like this:\n\npackage p;\nclass A{\n public static void main(String[] args){\n B b = new B(\"haha\");\n b.run();\n //System.out.println(\"he\");\n }\n}\n\n\nand\n\npackage b;\nclass B{\n String s; \n public B(String s){ \n this.s = s;\n } \n\n public void run(){\n System.out.println(s); \n } \n}\n\n\nI fail to compile these 2 files using javac a.java b.java, and the error is:\n\n\n a.java:4: cannot find symbol\n symbol : class B \n location: class p.A\n B b = new B(\"haha\");\n ^\n a.java:4: cannot find symbol\n symbol : class B\n location: class p.A\n B b = new B(\"haha\");\n ^\n 2 errors \n\n\nwhile after removing package p;,javac a.java b.java runs well.\n\nSo, how can I compile and run class A with the package p;?\n\n======Edit=======\nThanks for all your reply,and finally I made my classes run by changing my files like this:\n\n.\n├── b\n│ ├── B.class\n│ └── B.java\n└── p\n ├── A.class\n └── a.java \n\nand a.java:\n\npackage p;\n\nimport b.B;\n\nclass A{\n public static void main(String[] args){\n B b = new B(\"haha\");\n b.run();\n //System.out.println(\"he\");\n }\n}\n\n\nB.java:\n\npackage b;\npublic class B{\n String s;\n public B(String s){\n this.s = s;\n }\n\n public void run(){\n System.out.println(s);\n }\n}\n\n\nThings need to pay attention to :\n\n\nclass B must be public\nshould import B when trying to use it in class A"
] | [
"java",
"compilation",
"command",
"javac"
] |
[
"Is there possible to make seperate InkWell Button with Firebase? Flutter",
"I am new on Flutter, trying to do project with firebase. In my code, I can write screen only one InkWell with card, when i try to add another InkWell, project showing error.\nSo how can i add more than one InkWell\nHere is my code;\nimport 'package:flutter/material.dart';\nimport 'package:whatsapp/home.dart';\nimport 'package:firebase_core/firebase_core.dart';\n\nvoid main() async {\n WidgetsFlutterBinding.ensureInitialized();\n await Firebase.initializeApp();\n runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n // This widget is the root of your application.\n @override\n Widget build(BuildContext context) {\n return MaterialApp(\n debugShowCheckedModeBanner: false,\n title: 'YOS APP',\n theme: ThemeData(\n primarySwatch: Colors.blue,\n brightness: Brightness.dark,\n visualDensity: VisualDensity.adaptivePlatformDensity,\n ),\n home: Home());\n }\n}\n\nHere is my tabbar page;\nimport 'package:flutter/material.dart';\nimport 'package:cloud_firestore/cloud_firestore.dart';\nimport 'package:firebase_core/firebase_core.dart';\n\nclass TabBar1 extends StatelessWidget {\n const TabBar1({Key key}) : super(key: key);\n @override\n Widget build(BuildContext context) {\n return StreamBuilder(\n // ignore: deprecated_member_use\n stream: Firestore.instance.collection('mat1').snapshots(),\n builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {\n if (snapshot.hasError) {\n return Center(child: Text('Error: ${snapshot.error}'));\n }\n if (snapshot.connectionState == ConnectionState.waiting) {\n return Center(child: Text('Loading..'));\n }\n return Container(\n padding: EdgeInsets.all(20.0),\n child: GridView.count(\n crossAxisCount: 2,\n // ignore: deprecated_member_use\n children: snapshot.data.documents\n .map(\n (doc) => InkWell(onTap: () {}, child MyCard(\n title: doc['konu'],\n ),\n )\n .toList(),\n ),\n );\n },\n );\n }\n}\n\nclass MyCard extends StatelessWidget {\n final String title;\n const MyCard({\n Key key,\n this.title,\n }) : super(key: key);\n\n @override\n Widget build(BuildContext context) {\n return Card(\n child: Center(\n child: Text(title),\n ),\n );\n }\n}\n\nWhen i trying to put MyCard() widget into map area, an error occurs.\n .map(\n (doc) => MyCard(\n title: doc['konu1'],\n ),\n (doc)=> MyCard(title: doc['icerikler1'],)\n )\n .toList(),\n\nerror;\nToo many positional arguments: 1 expected, but 2 found.\nTry removing the extra arguments."
] | [
"android",
"ios",
"flutter",
"dart",
"mobile-development"
] |
[
"I'd like for the variables that talks about grandad to say that he's old but it says he's not old. What I am doing wrong? Thanks in advance",
"name1 = 'homer'\nage1 = 40\nshow1 = 'simpsons'\n\nname2 = 'peter'\nage2 = 40\nshow2 = 'family guy'\n\nname3 = 'grandad'\nage3 = 68\nshow3 = 'boondocks'\n\ndef tv_shows(name, age, show):\n age = (age1,age2,age3)\n for age in age:\n if age >= 66:\n return name +"?, he's old"\n else:\n if age <= 66:\n return name +"?, he's not old"\n\n\n\ntv_shows(name1, age1, show1)\ntv_shows(name2, age2, show2)\ntv_shows(name3, age3, show3)\n\nI'd like for the variables that talks about grandad to say that he's old but it says he's not old. What I am doing wrong?"
] | [
"python",
"function"
] |
[
"Cat a file with a variable name present in it",
"var=`date`\n\npg_dump -U postgres database_name > ~/database_backups/database_name.backup.${var}\n\nnew_item_id=$(cat ~/database_backups/database_name.backup.${var}| grep \"Item\" | awk '{print($1);exit}’)\n\n\ncat: /Users/karanj/database_backups/database_name.backup.: No such file or directory"
] | [
"shell",
"unix"
] |
[
"Assertion failed: (LHSCst != RHSCst && \"Compares not folded above?\")",
"I'm trying to compile ICU v4.8.1 with Alchemy, but am running into an LLVM problem:\n\nAssertion failed: (LHSCst != RHSCst && \"Compares not folded above?\"), function visitAnd, file /Volumes/data/dev/FlaCC/llvm-2.1/lib/Transforms/Scalar/InstructionCombining.cpp, line 3465.\n0 llvm-ld 0x00264aee _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 6078\n1 llvm-ld 0x00265092 _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 7522\n2 libSystem.B.dylib 0x970a805b _sigtramp + 43\n3 ??? 0xffffffff 0x0 + 4294967295\n4 libSystem.B.dylib 0x971355a5 raise + 26\n5 libSystem.B.dylib 0x9714b6e4 abort + 93\n6 libSystem.B.dylib 0x9713820f __assert_rtn + 252\n7 llvm-ld 0x000a0816 _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 252214\n8 llvm-ld 0x000cf25e _ZN4llvm11InstVisitorIN108_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_InstructionCombining.cpp_00000000_6BB61AFF12InstCombinerEPNS_11InstructionEE5visitERS3_ + 766\n9 llvm-ld 0x000c5895 _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 403893\n10 llvm-ld 0x000c631c _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 406588\n11 llvm-ld 0x002004a6 _ZN4llvm12FunctionPassD1Ev + 20998\n12 llvm-ld 0x002008fa _ZN4llvm12FunctionPassD1Ev + 22106\n13 llvm-ld 0x00200e51 _ZN4llvm12FunctionPassD1Ev + 23473\n14 llvm-ld 0x0020125a _ZN4llvm12FunctionPassD1Ev + 24506\n15 llvm-ld 0x002012da _ZN4llvm12FunctionPassD1Ev + 24634\n16 llvm-ld 0x00002f10 0x0 + 12048\n17 llvm-ld 0x000091e2 _ZN4llvm2cl3optINS_12PluginLoaderELb0ENS0_6parserISsEEE16handleOccurrenceEjPKcRKSs + 11986\n18 llvm-ld 0x00002706 0x0 + 9990\nmake[2]: *** [../../bin/genrb] Error 6\nmake[1]: *** [all-recursive] Error 2\nmake: *** [all-recursive] Error 2\n\n\nWhat kind of code leads to this problem in the linker? It seems to have something to do with casting (\"left-hand-side-cast != right-hand-side-cast\"). I'm not above modifying the ICU code to make it compile, but I'm not sure what to modify."
] | [
"llvm",
"alchemy",
"llvm-gcc"
] |
[
"Why does R change the variable type when prepending NA values to a data frame with factors?",
"I have a problem with the way R coerces variable types when using rbind of two data.frames with NA values. I illustrate by example:\n\nx<-factor(sample(1:3,10,T))\ny<-rnorm(10)\ndat<-data.frame(x,y)\nNAs<-data.frame(matrix(NA,ncol=ncol(dat),nrow=nrow(dat)))\ncolnames(NAs)<-colnames(dat)\n\n\nNow the goal is to append dat and NAs while keeping the variable types factor and numeric of x and y. When I give:\n\ndat_forward<-rbind(dat,NAs)\nis.factor(dat_forward$x)\n\n\nthis works fine. However the backward direction using rbind fails:\n\ndat_backward<-rbind(NAs,dat)\nis.factor(dat_backward$x)\nis.character(dat_backward$x)\n\n\nNow x is coerced to character level. I am confused - can't it stay factor type even if I use the other order of binding? What would be a straight forward change to my code to reach my goal?"
] | [
"r",
"dataframe",
"na",
"rbind",
"r-factor"
] |
[
"React multi select value send to django rest",
"React.js\nReact.js multi select value set by prototype array is does not send django rest api manyToMany instead have convert to object array filler key and send {}. i try many time different way but still solve. who have expert in js please help this\nconstuctor\nconstructor(props) {\n\n super(props);\n this.state = {\n\n newspaper: '',\n selectOptions: [],\n value: [],\n }\n}\n\nAxios get fetch endpoint for select option\nasync getOptions() {\n var u = ""\n const res = await axios.get('http://127.0.0.1:8000/api/Newspaper/')\n const data = res.data\n\n const options = data.map(d => ({\n "value": d.id,\n "label": d.newspaper\n }))\n\n this.setState({\n selectOptions: options\n })\n console.log(options, "home")\n\n}\n\nhandleChange(e) {\n this.setState({\n value: e\n });\n}\n\ncomponentDidMount() {\n this.getOptions()\n}\n\nRender element for multi-select dropdown option\nrender() { return (\n<>\n <form className="className=Newspaper__form__forms" onSubmit={this.handleSubmit.bind(this)} method="POST">\n <CFormGroup row>\n <CCol md="2">\n <CLabel htmlFor="text-input"><strong>Order</strong></CLabel>\n </CCol>\n <CCol xs="12" md="8">\n {/*\n <CInput id="text-input" type="tel" name="text-input" pattern="[0-9]*" options={this.state.selectOptions} onChange={this.handleChange.bind(this)} placeholder="Enter Phone No" /> */}\n <Select custom name="ccyear" options={this.state.selectOptions} onChange={this.handleChange.bind(this)} isMulti /> { this.state.value === null ? "" : this.state.value.map(v => <strong>{v.lable}</strong>) }\n <CFormText color="danger">{this.state.newspaper_Error}</CFormText>\n </CCol>\n </CFormGroup>\n\n <CCardFooter>\n <CFormGroup row className="my-0">\n <CButton xs="4" type="submit" size="sm" color="primary">\n <CIcon name="cil-scrubber" /> <strong>Submit</strong></CButton>\n <br></br>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <CButton xs="4" type="button" size="sm" color="danger" value="cancel" onClick={this.cancelCourse}>\n <CIcon name="cil-ban" /><strong> Reset</strong></CButton>\n </CFormGroup>\n </CCardFooter>\n </form>\n</> ) }\n\n\nHere selected value\nObject { value: 95, label: "ADA" }\n\nObject { value: 87, label: "SUNDAY NEWSf" }\n\nI want expect for like this\n{"ADA"},{"SUNDAY NEWSf"}\n\n"
] | [
"reactjs",
"django-rest-framework"
] |
[
"Error in eigen(Sigma, symmetric = TRUE) : infinite or missing values in 'x' with zelig logistic regression",
"So I am trying to do propensity score matching and then utilize Zelig to perform a logistic regression on the matched data. \n\nHere is an example of what my data looks like:\nDATA\n\nSo I am trying to match the patients based on Dementia, Stroke, and Age. I am then trying to see whether or not Drug X is associated with an increased risk of falling once the patients have been matched. I would then like to go through the same process for Drug Y and Drug Z to see if each individual drug has an association. \n\nHere is the code I have used so far to perform the matching and the logistic regression analysis:\n\ndata <- read_csv(\"Desktop/data.csv\")\nView(data)\nattach(data)\ndata[1:10,]\n\nm.out = matchit(Fall ~ Dementia + Stroke + Age, method = \"exact\", data = data)\n\nm.data = match.data(m.out)\nlibrary(Zelig)\nz.out = zelig(Fall ~ Drug X + Dementia + Stroke + Age, model = \"logit\", data = m.data)\n\nx.out0 <- setx(z.out, Drug X = 0)\nx1.out0 <- setx(z.out, Drug X = 1)\n\ns.out0 <- sim(z.out, x = x.out0, x1 = x1.out0)\n\n\nEverything seems to be going smoothly until this last line. Here is the error message I keep getting. \n\nError in eigen(Sigma, symmetric = TRUE) : \n infinite or missing values in 'x'\n\n\nAny ideas what I'm doing wrong? I've been stuck here for a while now and decided to reach out for help. \n\nThanks in advance."
] | [
"r",
"logistic-regression",
"r-zelig"
] |
[
"Move files into year/month folders based on file name timestamp powershell",
"I have thousands of files spanning 5 years which I would like to move into year/month folders. The file names all end with \n\n\n _yyyy_mm_dd_wxyz.dat\n\n\nI'm looking for ideas on how I can generate such file folders and move the files into the appropriate folders yyyy/mm using the windows command shell."
] | [
"powershell",
"recursion",
"directory"
] |
[
"packaging Java library with dependencies in OSGi/Eclipse jars",
"I am finishing a Java library that I want to make available to third parties. \nIn addition to its core functionality, I am providing some classes that ease the usage of my library when used as part of an Eclipse plugin.\nThen, I have some dependencies in my library to certain OSGi/Eclipse classes (e.g., org.osgi.framework.Bundle, org.eclipse.core.runtime.FileLocator, org.eclipse.jdt.core.dom.CompilationUnit, among others).\n\nSo my questions is: What is the correct/convenient way to package this library for third parties usage?. Should I include all the Eclipse jars that contain the required dependencies ?. Intuitively, I think this is not a good solution given that the user obviously could have a different Eclipse version than the one I have, and this could lead to class loading conflicts. The solution of just not providing the Eclipse jars - and asking the user to find the ones he/she likes - does not really convince me neither.\n\nI do not have lots of experience with Maven, but as far as I understand I can create a POM file that the user can use for downloading the last version of my project and its dependencies. But again: in that case I also have to decide if I should include or not the Eclipse jars in the download, considering the reasons I wrote above.\n\nThanks for sharing your experience on this regard."
] | [
"java",
"eclipse",
"eclipse-plugin",
"software-packaging"
] |
[
"Android DataBinding float to TextView",
"I am trying to bind:\n\n @Bindable\npublic float getRoundInEditAmount()\n{\n return roundInEdit.getAmount();\n}\n\n@Bindable\npublic void setRoundInEditAmount(float amount)\n{\n roundInEdit.setAmount(amount);\n notifyPropertyChanged(BR.roundInEditAmount);\n}\n\n\nto\n\n <EditText\n android:layout_width=\"100dp\"\n android:layout_height=\"50dp\"\n android:inputType=\"numberDecimal\"\n android:text=\"@={`` + weightSet.roundInEditAmount}\"\n ></EditText>\n\n\nHowever on clicking the EditText I am presented with a a text input not the number pad. If I click this EditText again I am then presented with the number pad. If the field has been defaulted to 50.0 or another value I cannot delete these amounts. I can enter text though and it does persist. \n\nHas anyone else come across this behavior with the text input coming up on first click rather than the number pad? Also does the two way binding on EditText work the way I am expecting. I have written my own Binding and InverseBinding adapter and they behave in the same way -> TextInput on first click and then number pad on second click but you cant delete the number that you start with."
] | [
"android",
"android-databinding"
] |
[
"Javascript animation very slow in Android HTML5 website",
"I have a little HTML5 web app for mobile devices (running inside PhoneGap/Cordova). I animate some elements, moving them around the screen modifying the \"left/top\" properties over a function called frequently (by a \"setInterval\").\n\nThe performance is excellent on iOS, but really slow in most android devices.\n\nIs there any way to improve the performance in that kind of animation?\n\nthanks"
] | [
"javascript",
"android",
"animation",
"cordova"
] |
[
"How to sort DataColumns by First In First Out",
"I'm not sure if the question is correct but that's what I'm trying to do.\n\nI have an Import/Export tool that import/export test cases in TestRail using a Matrix spreadsheet template that looks like this (AP=Applicable, NA=Not Applicable):\n\nSections Test1 | Test2 | Test3 | Test4 | Test5\nSection 1 NA | AP | AP | AP | NA\nSection 2 AP | NA | AP | AP | AP\nSection 3 AP | AP | AP | NA | AP\n\n\nSo once in TestRail it looks like this:\n\n\nSection 1\n\n\nTest2\nTest3\nTest4\n\nSection 2\n\n\nTest1\nTest3\nTest4\nTest5\n\nSection 3\n\n\nTest1\nTest2\nTest3\nTest5\n\n\n\nBut when I export from TestRail, the columns are not in the same order as the Import:\n\nSections Test2 | Test3 | Test4 | Test1 | Test5\nSection 1 AP | AP | AP | | \nSection 2 | AP | AP | AP | AP\nSection 3 AP | AP | | AP | AP\n\n\nThis is the code I have so far using DataTable and by trying to detect the previous Test Case... but after some test, it is not accurate/working as intended at all... especially with a big amount of Sections and Tests:\n\nString previousTC = String.Empty;\n\n// For each Test Case\n// Adds column to the Matrix table for each new Test Cases\nforeach (var tcase in currentCases)\n{\n if (!dtMatrix.Columns.Contains(tcase.title))\n {\n // Adds a new Column if TestCases does not exist\n dtMatrix.Columns.Add(tcase.title, typeof(string));\n }\n else\n {\n if (dtMatrix.Columns.Contains(previousTC))\n {\n // Gets the position of the previous TestCase \n // in order to put the new one right after\n var previous = dtMatrix.Columns.IndexOf(previousTC);\n var current = dtMatrix.Columns.IndexOf(tcase.title);\n if (previous >= current)\n {\n dtMatrix.Columns[current].SetOrdinal(previous);\n }\n }\n }\n previousTC = tcase.title;\n}\n\n\nPLEASE NOTE that Test1 to 5 are only to explain my issue and can be anything and not in alphabetical order.\n\nSo I would need some help to find the right algorithm that will fix my sort order issue.\n\nThanks a lot!\n\nEDIT:\nI thought that maybe, based on TestRail's suites, I could find a way to merge them.. then keeping track of each merged Test Cases columns."
] | [
"c#",
"algorithm",
"sorting",
"datatable",
"datacolumn"
] |
[
"Difference between parallel and sequential Convolutions in Convolutional Neural Network",
"I'm trying to implement a Convolutional Neural Networks with tensorflow for classifying text. I already found some implemented models and found especially two implementations: \n\n[I'm not allowed to post more than 2 Links, I will try to provide the sources in the comments]\n\nHowever they seem to differ fundamentally in their architecture. The first model uses the convolutions parallel with the input data whereas the second model uses the convolutions in a sequential way. I visualized the two models with tensorboard:\n\nFirst the parallel convolutions. After the convolutions the results are concated and with one fully connected layer the output is created.\n\nparallel use of convolutions\n\nThe sequential convolutions seem to be more straight forward, we use the result form the previous layer as the input for the next layer. \n\nsequential use of convolutions\n\nSo my question is, since both are used to classify text, where lies the difference between these two implementations and which one is more suitable for classifying text?"
] | [
"tensorflow",
"neural-network",
"deep-learning",
"conv-neural-network"
] |
[
"VACUUM sqlite database from the SQLiteOpenHelper",
"My app's database keeps growing and I want to perform a VACUUM to retrieve some lost space. From what I've read VACUUM does not run if there are other transactions.\n\nMy question is: how do I run the command from my SQLiteOpenHelper? is something like db.execSQL(\"VACUUM\") work? But how do I get some sort of progress while doing this so I can block the UI with a loading dialog?"
] | [
"android",
"sqlite",
"vacuum"
] |
[
"Change connection string to use external MSSQL database",
"Let me briefly explain what I've done so far:\nI have created a basic ASP.NET MVC web application. I am using the included login features that is included when you create a new project. (I have also added some extra fields in the login/registration that I need). \nCurrently it creates a local database in the AppData folder (see code below) however I need to access this database remotely once its been hosted. \n\n<connectionStrings>\n <add name=\"DefaultConnection\" connectionString=\"Data Source=(LocalDb)\\v11.0;AttachDbFilename=|DataDirectory|\\aspnet-HubSite-20141231121833.mdf;Initial Catalog=aspnet-HubSite-20141231121833;Integrated Security=True\" providerName=\"System.Data.SqlClient\" />\n</connectionStrings>\n\n\nI have registered a domain with 123-REG and it shall be hosted with TSOHOST. TSOHOST have also created me an MSSQL database which I can use instead of the local one the application is using.\n\nTSOHOST have given me the following information for the MSSQL database\n\nPassword: aaaaaaaaaa \nDatabase name: bbbbbbbbbb \nDatabase username: cccccccccc \nServer: 11.111.1.11\nRemote IP: 22.222.22.2,2222\n\n\nHow can I adapt the connection string so that it points to this new database?\n\nThanks :)"
] | [
"asp.net",
"sql-server",
"asp.net-mvc",
"database"
] |
[
"Haskell Cannot find gtk2hsChs",
"Has anyone run into problems with gtk2hsChs installing glib with GHC on linux (OpenSuse) and know of a workaround?\n\nHere is the scenario: I have cabal installed gtk2hs-buildtools, and gtk2hsChs is in the path (e.g. which gtk2hsC2hs works).\n\nHowever, I cannot install this library. The program builds fine, but fails to install. If I \n\ncabal unpack glib\ncd glib\ncabal configure\ncabal build\n\n\nEverything works just fine. But\n\ncabal install \nand\ncabal install --global\n\n\nfail.\n\nCannot find gtk2hsC2hs\nPlease install `gtk2hs-buildtools` first and check that the install directory is in \nyour PATH (e.g. HOME/.cabal/bin).\n\n\nCabal-install doesn't have an option (as per --help) to change the location of gtk2hsC2hs, but \n\nrunhaskell Setup configure\n\n\ndoes. However,\n\nrunhaskell Setup configure --with-gtk2hsC2hs=/usr/local/bin/gtk2hsC2hs\nrunhaskell Setup build\nsudo runhaskell Setup install \n\n\nfails on the last step with the same error message as with cabal install. \n\nThe weird thing is this: If I change the location of the gtk2hsC2hs program manually in Gtk2HsSetup.hs, and run\n\ncabal configure\nor\nrunhaskell Setup configure\n\n\nI get a different error message: setup: \"Unknown build tool gtk2hsC2hs\" I can't find this string in any of the setup files, so it is being generated elsewhere. Perhaps this indicates the problem.. perhaps a version mismatch.. perhaps something else silly I am missing?"
] | [
"haskell",
"build",
"gtk2hs"
] |
[
"SQL How to group by but with special conditions",
"I have a SQL Server 2008 table where I have a list of employees with timestamps.\n\nI have a script that groups by employee the dates.\n\nWhat I need is to group by employee but I have to exclude the timestamps that are in the same day and the difference between them are less than 8 hours.\n\nHere is a table that explains better:\n\n\n\nI created a SQL Fiddle with the table and sample data.\n\nhttp://sqlfiddle.com/#!3/3b956/1\n\n\n Any clue?"
] | [
"sql",
"sql-server",
"sql-server-2008"
] |
[
"Split arrays of natural numbers according to a requirement",
"I have two arrays {Ai} and {Bi} of natural numbers. The sums of all elements are equal.\n\nI need to split each element of the two arrays into three natural numbers:\n\nAi = A1i + A2i + A3i\nBi = B1i + B2i + B3i\n\nsuch that the sum of all elements of A1 is equal to the sum of all elements of B1 and the same for all the other pairs.\n\nThe important part I initially forgot about:\n\nEach element from A1j, A2j, A3j should be between Aj/3-2 and Aj/3+2 or at least equal to one of these numbers\n\nEach element from B1j, B2j, B3j should be between Bj/3-2 and Bj/3+2 or at least equal to one of these numbers\n\nSo the elements of arrays must be split in almost equal parts\n\nI look for some more elegant solution than just calculating all possible variant for both arrays."
] | [
"arrays",
"numbers"
] |
[
"Associating a File extension with a pure E4Editor",
"how can I associate a pure E4Editor with a file ending?\nI created a feature containing some plugins, in which the editor is implemented. I'am contributing my feature into an legacy E4 application via installation of my feature via p2 updatesite.\nWhere can I define the file association for my editor. Can I define this in my fragment.xmi or programmatically?\n\nThanks in advance,\nSebastian."
] | [
"eclipse-rcp",
"e4"
] |
[
"Apache NiFi perfomance",
"I have a question about perfomance in Apache NiFi. I often works with JSON and to handle JSON I always use JoltTransformJSON or ExecuteGroovyScript. For small JSON files (about 5-10k rows, < 1 Mb) I guess it's okay to use and modify JSON.\nFor example, typical JOLT config:\n[\n {\n "operation": "remove",\n "spec": {\n "*": {\n "ownerId": ""\n }\n }\n },\n {\n "operation": "default",\n "spec": {\n "*": {\n "accountName": "${account.name}",\n "ownerId": "${account.owner.id}"\n }\n }\n }\n]\n\nBut sometimes I have to work with kinda big JSONS (30-50k rows, > 15 Mb) and I think about alternatives. Is it better to convert JSON to AVRO and work with QueryRecord or UpdateRecord? But ofc some tasks you cannot do with only Record processors.\nWhat about perfomance and RAM usages with JSON and AVRO? Is there a big difference? And is AVRO really better for saving files into DB than JSON and why?"
] | [
"apache-nifi"
] |
[
"Scala akka-http client Timeout error",
"I have a Scala Play application that uses Akka and queries a REST server. The request can take a long time to respond and I am getting timeouts:\n\n\"The server was not able to produce a timely response to your request. Please try again in a short while!\"\n\nI have tried using Play WSClient and kaka-http client and get the same error and I have set every timeout property I can find.\n\nThe WSClient is Injected into the Actor and I call it this was in my Actor\n\nval resp = ws.url(\"myurl\").withRequestTimeout(Duration.Inf).get()\nresp pipeTo self\n\n\nAnd I tried:\n\nHttp().singleRequest(HttpRequest(uri = \"myurl\"))\n\n\nAnd then pipe this to self but still the timeout.\n\nIn application.conf I have set:\n\nplay.ws.timeout.connection = 3600 s\nplay.ws.timeout.request = 3600 s\nplay.ws.timeout.idle = 3600 s\nakka.http.server.idle-timeout = 3600 s\nakka.http.http-connection-pool.idle-timeout = 3600 s\nakka.http.http-connection-pool.client.idle-timeout = 3600 s\nakka.http.server.request-timeout = 3600 s\nakka.http.client.idle-timeout = 3600 s\nakka.http.client.connecting-timeout = 3600 s\n\n\nI am not sure what else I can do. I have even tried \n\nAwait.resutl(rest, Duration.Inf)\n\n\nBut this does not help. If anyone has any idea on what I can try it would be appreciated. I am using Akka 2.4.4 and Play 2.5.3."
] | [
"scala",
"playframework-2.0",
"akka",
"akka-http"
] |
[
"Task distribution using Spring JMS receiving",
"I am trying to receive JMS messages from an Active MQ queue. On receiving messages, they are forwarded to different servers for processing.\n\nI want to instantiate Message Listeners with information about server it is communicating with and process status.\n\nUsing available Spring Message Listener Container Classes only a single stateless instance of Message Listener can be created which is used with multiple threads.\n\nIs there a solution for adding multiple instances of Message Listener to Message Listener Container?"
] | [
"java",
"spring",
"jms",
"activemq"
] |
[
"Changing the format of videos for mobile",
"Hello, I would like to know how can i do to call a video on mobile and in mode desktop\nthat you can use?\nI have two videos a video is for desktop and i want you when you arrive in mobile change the format of the video.\nam working with php and javascript and mediaelements"
] | [
"javascript",
"php",
"jquery",
"mobile",
"content-management-system"
] |
[
"EasyPHP and windows 8",
"Need some help with Windows 8 installation.\n\nI was able to install EasyPHP on the Windows 8 Consumer Preview, but when I try to visit \"http://127.0.0.1/\" to access my local webpages, I get a \n\n\n Internet Explorer cannot display the webpage \n\n\nerror and it doesn't work in any other browser."
] | [
"php",
"easyphp"
] |
[
"How to walk the line between location accuracy and power efficiency?",
"I am working on an app that requires to work in foreground and background and send location data. I haven't written code yet and just familiarized myself with how CoreLocation works to determine which approach to follow. From the reading I did so far, I gather that:\n\n\nWith startMonitoringSignificantLocationChanges \n\n\nthe GPS is never activated \nit only calls didUpdateLocations (or didUpdateToLocation for ios<6) when a change of radio tower is detected \nthe desiredAccuracy and distanceFilter properties are both ignored\n\nWith startUpdatingLocation\n\n\nthe battery drain is higher\ndidUpdateLocations is called whenever some hardware from the phone has some data to provide. And because there are multiple hardware components that can be used for location (GPS, radio, wifi), there is no guarantee when or how often didUpdateLocations is called, or whether a new reading will be more accurate than the previous one even\nthe first number(s) are usually bad because they do not rely on the GPS\nthere is no sure way of knowing whether we have the best location we will ever get: it is just a matter of picking among all locations received the one with the best accuracy in the given time window available \n\n\n\nI don't see however much discussion or documentation about any intermediate route. What if I want to be power-conscious but get reasonably accurate data when a user has moved significantly? It seems that a possible compromise approach is to:\n\n\nturn on startMonitoringSignificantLocationChanges\nswitch to using startUpdatingLocation when didUpdateLocations is called\nwait for a short while to give a chance to the GPS to get some good readings and select the one with best accuracy \nswitch back to using startMonitoringSignificantLocationChanges and so on...\n\n\nAs far as I know, this approach will work the same in foreground and background and will provide some compromise between the two standard approaches supported by Apple.\n\nQuestions:\n- Is my understanding correct and my \"compromise\" approach sound?\n- Has anyone used that approach successfully?\n- What are the caveats to look for with that approach?\n- Is there a better compromise approach out there?\n\nPS: I imagine that I could later refine the approach to take into account the estimated travel speed so that I don't constantly use the GPS when the person is traveling."
] | [
"iphone",
"cocoa-touch",
"core-location",
"cllocationmanager",
"background-process"
] |
[
"Efficient way to create an array of nonzero values in a numpy tensor?",
"I have a 3D numpy grid A[ix,iy,iz] and I filter out elements by zeroing them out via A[ A<minval ] = 0, or A[ A>maxval ] = 0, etc. I then want to perform statistics on the remaining items. For now, I am doing:\n\nfor ai in np.reshape(A, nx*ny*nz):\n if( ai > 0 ):\n Atemp.append(ai)\n\n\nand then I perform statistics on Atemp. This takes quite a long time, however, and I wonder if there is a more efficient way to create Atemp. For what it's worth, I am working with several GB of data in these arrays.\n\nNOTE: I do not want a different way to filter these items out. I want to zero them out, then create a temporary array of all nonzero elements in A."
] | [
"python",
"arrays",
"numpy"
] |
[
"Javadoc multiple packages",
"I am trying to generate java documentation for multiple packages so I have a single index.html, I can generate them fine for single packages by writing,\n\n javadoc packages/mypackage1/program/*.java\n\n\nbut I can't get it to work for multiple packages. I tried using javadoc @packages but I get \n\nerror - cannot read packages <access is denied>\n\n\nAny ideas would be great!!"
] | [
"java",
"documentation",
"package",
"javadoc"
] |
[
"How to retrieve the image in javascript",
"I have one url , which returns an image tag.Now i need to call this url using javascript , and embed this return under a div tag.\nI was trying $.get(), but \"data\" is returning some text.How to retrieve the image in javascript.\nnote: pls provide sln with javascript/jquery.\n\nEdit: data returns GIF40 or soem this kind of arbitary value.."
] | [
"javascript",
"jquery"
] |
[
"how play video in fullscreen with exoplayer?",
"this is my code:\n\n setContentView(R.layout.activity_video);\n SimpleExoPlayerView exoPlayerView;\n //SimpleExoPlayer exoPlayer;\n Intent intent = getIntent();\n\n String url_video_passato = intent.getStringExtra(\"URL_VIDEO\");\n System.out.println(\"PASSATO?\"+url_video_passato);\n // String videoURL = \"http://vod06.msf.ticdn.it/farmunica/2017/11/124899_15fc565cd8f965/15fc565cd8f965-11_0.mp4\";\n\n\n exoPlayerView = (SimpleExoPlayerView) findViewById(R.id.exo_player_view);\n try {\n\n\n BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();\n TrackSelector trackSelector = new DefaultTrackSelector(new AdaptiveTrackSelection.Factory(bandwidthMeter));\n exoPlayer = ExoPlayerFactory.newSimpleInstance(this, trackSelector);\n\n Uri videoURI = Uri.parse(url_video_passato);\n\n DefaultHttpDataSourceFactory dataSourceFactory = new DefaultHttpDataSourceFactory(\"exoplayer_video\");\n ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();\n MediaSource mediaSource = new ExtractorMediaSource(videoURI, dataSourceFactory, extractorsFactory, null, null);\n\n exoPlayerView.setPlayer(exoPlayer);\n exoPlayer.prepare(mediaSource);\n exoPlayer.setPlayWhenReady(true);\n }catch (Exception e){\n Log.e(\"MainAcvtivity\",\" exoplayer error \"+ e.toString());\n }\n\n\nVIDEO ACTIVITY LAYOUT\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.constraint.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n tools:context=\"marco.uomini.donne.Video\">\n <com.google.android.exoplayer2.ui.SimpleExoPlayerView\n android:id=\"@+id/exo_player_view\"\n android:layout_alignParentStart=\"true\"\n android:layout_alignParentEnd=\"true\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentBottom=\"true\"\n >\n\n </com.google.android.exoplayer2.ui.SimpleExoPlayerView>\n\n</android.support.constraint.ConstraintLayout>\n\n\nVideo is not playing in fullscreen by using exoplayer, i don't know why.\nthis is the result as of now:\n\n\n\nCan anyone help me?"
] | [
"java",
"android",
"exoplayer"
] |
[
"Correlation coefficient between rows of two matrices",
"I have the following code, how will I be able to simplify it using the function as it currently runs pretty slow, assume X is 10x7 and Y is 4x7 and D is a matrix stores the correlation between each pair of vectors. If the solution is to use the xcorr2 function can someone show me how it is done?\n\nfor i = 1:4\n for j = 1:10\n D(j,i) = corr2(X(j,:),Y(i,:));\n end\nend"
] | [
"matlab",
"statistics",
"distance"
] |
[
"Calling Lambda function with PHP using AWS Cognito is giving error",
"I am using AWS cognito to call lambda function and get response in PHP but getting below error\n\nFatal error: Uncaught Aws\\Exception\\CredentialsException: Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1005 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)) in C:\\xampp\\htdocs\\LighthouseFolders\\lighthouseproject\\lighthouse\\Aws\\Credentials\\InstanceProfileProvider.php:240 Stack trace: #0 C:\\xampp\\htdocs\\LighthouseFolders\\lighthouseproject\\lighthouse\\Aws\\Credentials\\InstanceProfileProvider.php(132): Aws\\Credentials\\InstanceProfileProvider->handleRetryableException(Object(GuzzleHttp\\Exception\\ConnectException), Array, 'Error retrievin...') #1 [internal function]: Aws\\Credentials\\InstanceProfileProvider->Aws\\Credentials{closure}() #2 C:\\xampp\\htdocs\\LighthouseFolders\\lighthouseproject\\lighthouse\\GuzzleHttp\\Promise\\Coroutine.php(142): Generator->throw(Object(GuzzleHttp\\Exception\\ConnectException)) #3 C:\\xampp\\htdocs\\LighthouseFolders\\lighthouseproject\\lighthouse\\GuzzleHttp\\Promise\\Promise.php(203): GuzzleHttp\\Promise\\Coroutine->_handle in C:\\xampp\\htdocs\\LighthouseFolders\\lighthouseproject\\lighthouse\\Aws\\Credentials\\InstanceProfileProvider.php on line 240\n\nPlease take a look at the below code\n<?php\n\nrequire 'aws-autoloader.php';\n\nuse Aws\\Lambda\\LambdaClient;\n\n$client = LambdaClient::factory([\n 'version' => 'latest',\n 'region' => 'us-east-1',\n [\n "action" => "session",\n "user_id" => "ABC123"\n ]\n]);\n\n$result = $client->invoke([\n 'FunctionName' => 'identity_manager', \n]);\n\necho json_decode((string) $result->get('Payload'));\n\n?> \n\nWhat I want to do is to call LAMBDA identity_manager with\n{\n"action":"session",\n"user_id":userid\n}\nto get a result of {"session_id":sessionid}.\nHowever, I am encountering below issues:\n\nUnable to pass object inside LambdaClient so I am sending array with action and user_id\nGetting the error posted above\n\nPlease let me know how to properly use this function in PHP to pass the parameters and get response accordingly.\nBest Regards,"
] | [
"php",
"amazon-web-services",
"aws-lambda"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.