texts
sequence
tags
sequence
[ "D3.js v5 concat dynamic arrays", "For this particular task, I'm unable to parse data. So I need to hard-code some data with desired format:\nvar data = ["1Equity","2Equity","3Equity","4Balanced","5Balanced","6MMF","7MMF","8MMF","9MMF","10MMF"];\n\nIt is essentially an array with numerous occurrences of several different strings; the actual array will be much longer and so I am searching for a labor-saving device.\nI have tried:\nd3.range(3).map(function(v) { return v+"equity"}).push(d3.range(2).map(function(v) { return v+"balanced"})).push(d3.range(5).map(function(v) { return v+"mmf"}))\n\nHowever, this returned:\n\nUncaught (in promise) d3.range(...).map(...).push(...).push is not a\nfunction\n\nQuestion\nHow can I concat arrays with items mapped to several different strings (occurrence of string based on my discression/user configurable) in a single line?" ]
[ "javascript", "d3.js" ]
[ "Copy Protection Scheme", "I want to create some simple copy protection for my program, I want my program could be run only from original read-only optical disc (CD/DVD), my question is:\n\n\nis there any unique number for each optical media that I could check against my program?\nis there a simple way (or C++ snippets) to programatically check whether my program was launched from optical disc instead of writable disk?\nis there any copy protection scheme that you know i could use, but i prefer end-user doesn't need to input any serial number, need internet access or use some usb-dongle." ]
[ "c++", "media", "copy-protection", "dvd", "dongle" ]
[ "Is there any way to print out debug statements in Postgres PSQL?", "I'm thinking something in the lines of DBMS_OUTPUT.PUT_LINE in Oracle, it allows you to trace what's going on in a stored procedure in the exactly same way you would use printf, puts or some other STDIO writing proc in a \"normal\" programming language, i.e.\n\nDBMS_OUTPUT.PUT_LINE('I got here:'||:new.col||' is the new value'); \n\n\nis there any way of doing this in Postgres?\n\nIf not, what's the \"community way\" of doing this? Creating a table with a string row and inserting debug values there?" ]
[ "postgresql", "psql" ]
[ "Is it possible to put a wx.window (frame/panel) over a wx.MenuBar?", "I want to know if it's possible to put a frame or a panel over a menubar using wxpython?\n\nThanks in advance!" ]
[ "python", "wxpython" ]
[ "Line Of Hex Into ASCII", "I am trying to make a string of hex like \n\n\n 4100200062006C0061006E006B002000630061006E0076006100730020007200650063006F006D006D0065006E00640065006400200066006F007200200046006F007200670065002000650064006900740069006E00670020006F006E006C0079002E\n\n\nTurn into ASCII and look like:\n\n\n A blank canvas recommended for Forge editing only.\n\n\nThe variable for the hex is collected from a file that I opened into the program, reading a specific address like so:\n\nBinaryReader br = new BinaryReader(File.OpenRead(ofd.FileName));\nstring mapdesc = null;\n\nfor (int i = 0x1C1; i <= 0x2EF; i++)\n{\n br.BaseStream.Position = i;\n mapdesc += br.ReadByte().ToString(\"X2\");\n}\n\nrichTextBox1.Text = (\"\" + mapdesc);\n\n\nNow that I have the mapdesc, I made it print into the richtextbox, and it just looked like a line of hex. I wanted it too look like readable ASCII.\n\nIn Hex Editor, the other side reading in ANSI looks like\n\n\n A. .b.l.a.n.k. .c.a.n.v.a.s. .r.e.c.o.m.m.e.n.d.e.d. .f.o.r. .F.o.r.g.e. .e.d.i.t.i.n.g. .o.n.l.y\n\n\nThe dots are 00s in the hex view, so I believe with the ASCII format, they should be nothing so that I get the readable sentence which is how the game reads it. What would I have to do to convert mapdesc into ASCII?" ]
[ "c#" ]
[ "Issues with thread and dynamic list in python", "I will try to be clear, hoping everyobdy will understand even if it will not be easy for me. \nI'm a beginner in coding in python so every help will be nice !\nI've got those librairies import : requests and threading.\nI'm trying to send in parrallel several urls to reduce the sending time of data. I used a dynamic list to stack all urls and then used requests.post to send them. \n\nl=[]\n if ALARM&1:\n alarmType=\"Break Alarm\"\n AlarmNumber = 1\n sendAlarm(alarmType, AlarmNumber)\n print alarmType\n else:\n s = \"https://...\" #the url works \n l.append(threading.Thread(target=requests.post, args=(s)))\n if ALARM&2:\n alarmType=0\n if ALARM&4:\n alarmType=\"Limit Switch\"\n AlarmNumber = 2\n sendAlarm(alarmType, AlarmNumber)\n print alarmType\n else:\n s=\"https://...\" \n l.append(threading.Thread(target=requests.post, args=(s)))\n\n for t in l:\n t.start()\n for t in l:\n t.join()\n\n\nThe error that I got is :\n\nException in thread Thread-1:\nTraceback (most recent call last):\n File \"/usr/lib/python2.7/threading.py\", line 810, in __bootstrap_inner\n self.run()\n File \"/usr/lib/python2.7/threading.py\", line 763, in run\n self.__target(*self.__args, **self.__kwargs)\nTypeError: post() takes at most 3 arguments (110 given)\n\n\nAnd same thing for Thread-2, I asked around me but we can't find a solution. If someone have an idea ? Thanks !" ]
[ "python", "multithreading", "dynamic-list" ]
[ "How is this complex generic Makefile rule constructed", "Several modules each are tested independently with their own test_$(MODULE).c.\nA shared library has been generated $(LIBRARY) containing modules without coverage. $(basename $<).o should override the one in $(LIBRARY). For some reason, I get results as if they are not overridden. Can someone review this and make suggestions on fixes? Currently I have non-generic gcov rules for each of the five objects. These gcovs work correctly. Below I show the generic rule and one specific use of the rule.\n\nSHARED_OPTS=-O0 -Wall -Wextra -fPIC\nGOPTS=$(SHARED_OPTS) -g -coverage -pg\n\n%.gcov : %\n @echo \"\\t$@ generic (needs work)\"\n @-gcc $(GOPTS) -c -o test_$(basename $<).o test_$<\n @-gcc $(GOPTS) -c -o $(basename $<).o $<\n @-gcc $(GOPTS) -o gcov_test_$(basename $<) \\\n test_$(basename $<).o \\\n $(basename $<).o \\\n -L . -l $(LIBRARY)\n @-./gcov_test_$(basename $<)\n @-gcov $< >[email protected] 2>&1\n @echo \"no Mac gprof: -gprof gcov_test_$(basename $<) gmon.out > $<.prof\"\n @$(call timestamp,$@)\n\nUnicode.c.gcov: Unicode.c\n\n\nIf anyone is interested in collaborating on high efficiency high quality Unicode lexing/parsing support by developing a shared library, I would love to have reviewers or contributors.\n\nThe Makefile fragment shown above is in a github repository:\n\nhttps://github.com/jlettvin/Unicode Specifically down the c subdirectory." ]
[ "gcc", "makefile", "gcov" ]
[ "Unknow field error in Gatsby GraphQL for custom query", "I am usingGatsby with GraphQL. Getting unknown field error as follows:\nGraphQL Error Encountered 2 error(s):\n- Unknown field 'allBlogPost' on type 'Query'. Source: document `homeAymanDesktopFirstSrcPagesIndexJs2258072279` file: `GraphQL request`\n \n GraphQL request:3:3\n 2 | {\n 3 | posts: allBlogPost {\n | ^\n 4 | nodes {\n- Unknown field 'blogPost' on type 'Query'.\n\n file: /home/ayman/Desktop/first/src/templates/post.js\n\nHere is my post.js template file:\nimport React from "react"\nimport { graphql } from "gatsby"\n\nexport default ({ data }) => {\n console.log(data)\n return (\n <div>\n <h1>{data.post.title}</h1>\n <div dangerouslySetInnerHTML={{ __html: data.post.html }} />\n </div>\n )\n}\n\nexport const query = graphql`\n query($id: String!) {\n post: blogPost(id: { eq: $id }) {\n title\n html\n }\n }\n`\n\n\nMy gatsby-node.js configuration can be found in this pastebin\nMy GraphiQL:\n\n\nUpdate\nAfter adding Asciidoc file in content/posts and content/articles , getting this error:\nCannot query field "slug" on type "BlogPost".\n\nFile: gatsby-node.js:89:16\n\n\n ERROR #11321 PLUGIN\n\n"gatsby-node.js" threw an error while running the createPages lifecycle:\n\nCannot read property 'posts' of undefined\n\n\n\n TypeError: Cannot read property 'posts' of undefined\n \n - gatsby-node.js:99" ]
[ "javascript", "graphql", "gatsby" ]
[ "Build an iOS like Transition on an Activity Change", "So, I'm trying to build a transition between two Activities in my Android App, that looks similar to the transitions in iOS Apps. And my \"Going in Transition\" works perfectly fine, the way I want it to work, the new layout slides over the old one, while the old one moves just a bit to the left. But now I'm stuck with the reverse transition, going back to my first layout, cause I want it to look exactly like the first transition, but just reversed, which I'm not able to achieve, cause Android automatically layers the moving in transition on top of the moving out transition, as you can see in the attached gif.\n\nSo I would have two ideas, to work around that problem. Is there either a possibility to change the layers of the transition? If not, it would be also possible to animate a moving mask ok my moving in transition. But for neither of these possibilities, I know how to implement them.\n\n\n\nMy current code:\n\nI just call the animations on the OnCreate of my two activities:\n\nOnCreate of my Main Menu:\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_left);\n setContentView(R.layout.activity_main);\n}\n\n\nOn Create of my Settings:\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n overridePendingTransition(R.anim.slide_in_right,R.anim.slide_out_right);\n setContentView(R.layout.activity_settings);\n}\n\n\nAnd my xml files:\nslide_in_left.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\n\nandroid:fromXDelta=\"-30%p\"\nandroid:toXDelta=\"0\"\n\nandroid:duration=\"@android:integer/config_longAnimTime\" />\n\n\nslide-out-left.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\n\nandroid:fromXDelta=\"0\"\nandroid:toXDelta=\"100%p\"\n\nandroid:duration=\"@android:integer/config_longAnimTime\" />\n\n\nslide_in_right.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\n\nandroid:fromXDelta=\"100%p\"\nandroid:toXDelta=\"0\"\n\nandroid:duration=\"@android:integer/config_longAnimTime\" />\n\n\nslide_out_right.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\n\nandroid:fromXDelta=\"0\"\nandroid:toXDelta=\"-30%p\"\n\nandroid:duration=\"@android:integer/config_longAnimTime\" />" ]
[ "java", "android", "xml" ]
[ "Why does gprof occasionally not print number of calls for particular functions?", "The application is compiled with -O0 -g -pg and gprof is run with its default settings." ]
[ "c", "debugging", "profiling", "gprof" ]
[ "MongoDB - Use aggregation framework or mapreduce for matching array of strings within documents (profile matching)", "I'm building an application that could be likened to a dating application.\n\nI've got some documents with a structure like this:\n\n\n $ db.profiles.find().pretty()\n\n\n[\n {\n \"_id\": 1,\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"fieldValues\": [\n \"favouriteColour|red\",\n \"food|pizza\",\n \"food|chinese\"\n ]\n },\n {\n \"_id\": 2,\n \"firstName\": \"Sarah\",\n \"lastName\": \"Jane\",\n \"fieldValues\": [\n \"favouriteColour|blue\",\n \"food|pizza\",\n \"food|mexican\",\n \"pets|yes\"\n ]\n },\n {\n \"_id\": 3,\n \"firstName\": \"Rachel\",\n \"lastName\": \"Jones\",\n \"fieldValues\": [\n \"food|pizza\"\n ]\n }\n]\n\n\nWhat I'm trying to so is identify profiles that match each other on one or more fieldValues. \n\nSo, in the example above, my ideal result would look something like:\n\n<some query>\n\nresult:\n[\n {\n \"_id\": \"507f1f77bcf86cd799439011\",\n \"dateCreated\": \"2013-12-01\",\n \"profiles\": [\n {\n \"_id\": 1,\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"fieldValues\": [\n \"favouriteColour|red\",\n \"food|pizza\",\n \"food|chinese\"\n ]\n },\n {\n \"_id\": 2,\n \"firstName\": \"Sarah\",\n \"lastName\": \"Jane\",\n \"fieldValues\": [\n \"favouriteColour|blue\",\n \"food|pizza\",\n \"food|mexican\",\n \"pets|yes\"\n ]\n },\n\n ]\n },\n {\n \"_id\": \"356g1dgk5cf86cd737858595\",\n \"dateCreated\": \"2013-12-02\",\n \"profiles\": [\n {\n \"_id\": 1,\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"fieldValues\": [\n \"favouriteColour|red\",\n \"food|pizza\",\n \"food|chinese\"\n ]\n },\n {\n \"_id\": 3,\n \"firstName\": \"Rachel\",\n \"lastName\": \"Jones\",\n \"fieldValues\": [\n \"food|pizza\"\n ]\n }\n ]\n }\n]\n\n\nI've thought about doing this either as a map reduce, or with the aggregation framework.\n\nEither way, the 'result' would be persisted to a collection (as per the 'results' above)\n\nMy question is which of the two would be more suited?\nAnd where would I start to implement this?\n\nEdit\n\nIn a nutshell, the model can't easily be changed.\nThis isn't like a 'profile' in the traditional sense.\n\nWhat I'm basically looking to do (in psuedo code) is along the lines of:\n\nforeach profile in db.profiles.find()\n foreach otherProfile in db.profiles.find(\"_id\": {$ne: profile._id})\n if profile.fieldValues matches any otherProfie.fieldValues\n //it's a match!\n\n\nObviously that kind of operation is very very slow!\n\nIt may also be worth mentioning that this data is never displayed, it's literally just a string value that's used for 'matching'" ]
[ "mongodb", "mapreduce", "aggregation-framework" ]
[ "Where can i get SpringSource Tool 2.60 for linux", "I know STS 3.60 is available now a days but seems like i need STS version 2.60 for Linux(Ubuntu to be specific). Can any one tell me where i can get it.\n\n(I need it as it seem, projects created in 3.60 are not compatible in 2.60, and colleagues use 2.6 in windows)\n\nSo can any one please provide me where i can download STS v 2.6 \n\nThank You in advance" ]
[ "spring", "sts-springsourcetoolsuite" ]
[ "I want a wpf application to detect usb or cd drive when i inserted", "I have created wpf application with listbox having some images. Now what i want is if i inserted usb or cd into the system having some images my application has to start automatically once i inserted usb or cd having images and application has to ask whether to add those images of usb or cd to the application by default.\n\nAny source code plz... any suggestions also...\n\nThanks in advance" ]
[ "wpf", "c#-3.0" ]
[ "Column A and Column B equal new Value for Column C in table 2", "I have been asked to update some of our SQL fields to a more modern, singular terminology. So now I am in the process of merging 2 columns into one new value and inputting that new value into another table. I know what I want the old to now equal, I am just not sure how to put in to less words and the right terminology to to know how to search for help. \n\nThe person who originally designed this database makes things more complicated than it should be. Therefore making somethings difficult to understand and comprehend...\n\nTo try to explain.. Currently I am working with the data from TABLE1 and translating it to a new value which will go into TABLE2\n\nUDATE: I originally posed my tables wrong\n\nTABLE1 TABLE2\n+---------+---------+---------+ +---------+---------+\n| ID | A | B | | ID | C |\n+---------+---------+---------+ +---------+---------+\n| 01 | DESCRPT1| STRIPED | | 01 | ZEBRA |\n+---------+---------+---------+ +---------+---------+\n| 01 | DESCRPT2| HORSE | | 02 | SNAKE |\n+---------+---------+---------+ +---------+---------+\n| 02 | DESCRPT1| SLIMEY | \n+---------+---------+---------+ \n| 02 | DESCRPT2| ROPE | \n+---------+---------+---------+ \n\nFrom TABLE1\nIf Value DESCRPT1 is 'Striped' and DESCIRP2 is 'Horse'\nTHEN insert 'Zebra' into TABLE2 column C where TABLE1.ID = TABLE2.ID\nIf Value DESCRPT1 is 'Slimey' and DESCIRP2 is 'Rope'\nTHEN insert 'Snake' into TABLE2 column C where TABLE1.ID = TABLE2.ID\n\n\nNOTE: This is my first post here, so if I am missing any information or doing this wrong. Sorry :(\n\nUPDATE\n\ntblEngagementAttributes tblEngagement\n+---------+---------+---------+ +---------+---------+---------+\n| ID | A | B | | ID | Client | C |\n+---------+---------+---------+ +---------+---------+---------+\n| 01 | DESCRPT1| STRIPED | | 01 | John | ZEBRA |\n+---------+---------+---------+ +---------+---------+---------+\n| 01 | DESCRPT2| HORSE | | 02 | Mark | SNAKE |\n+---------+---------+---------+ +---------+---------+---------+\n| 02 | DESCRPT1| SLIMEY | \n+---------+---------+---------+ \n| 02 | DESCRPT2| ROPE | \n+---------+---------+---------+ \n\n\nSo a little more information that I'm finding might be beneficial for helping to figure this out.. The table that I am translating the data into is already an existing table. These two tables have a shared foreign key 'ID'" ]
[ "sql", "sql-server-2012" ]
[ "Adding the \"source\" directory to the PATH variable and then using it", "I had to first add the source directory to my PATH variable. So I did this...\n\ncd /usr/src\nPATH=$PATH:.\n\n\nthen I have to run the phmenu program in the easiest way, implying I use my new modified PATH variable.\n\nI don't know how to go about doing this. Inside the src directory (what I added to PATH) there is a subdirectory called packages. \n\nDid I add the wrong \"source\" file to the PATH, is there another it can be referring to? Or am I on the right track?" ]
[ "linux", "path", "environment-variables" ]
[ "Set up a certificate of completion to be sent as an attachment to each recepient in Docusign signing process", "Please let me know how to set up a certificate of completion to be sent as an attachment via email, to all recipients in the document workflow of a given template." ]
[ "docusignapi" ]
[ "Angularjs - change in scope not reflecting", "I am using ddSlick plugin in my angularjs website. The plugin works fine. But after selecting the option, the scope variable is not updated. It is the same issue in this link. But the answer doesn't work for me.\n\n$scope.ddData = []\nfor(var i in $scope.List){\n var tempData = {}\n tempData.text = $scope.List[i].name\n tempData.value = $scope.List[i].slug\n tempData.imageSrc = $scope.List[i].img + '.png'\n if(i == 0)\n tempData.selected = true\n else\n tempData.selected = false\n $scope.ddData.push(tempData)\n}\n\n$('#Dropdown').ddslick({\n data: $scope.ddData,\n width: 350,\n imagePosition: \"left\",\n selectText: \"Select a list\",\n onSelected: function (data) {\n $scope.updateSelected(data);\n $scope.$apply();\n }\n});\n\n$scope.updateSelected = function(data){\n $scope.Selected = data.selectedData.value\n}\n\n\nI have to loop through a variable to get the json data for the dropdown list. Can someone help? Thanks!" ]
[ "javascript", "angularjs", "angularjs-directive", "angularjs-scope" ]
[ "Is it efficient to use lua to store game data?", "I'm new to lua and I'm wondering, is it efficient to use lua to store game data (such as monster's description, spells).\n\nMy problem is, \nwhen I try to create a monster object every second, I have to run the lua file and get the data repeatedly, \nwhich I think may be not efficient.\n\nBefore I try to use lua, I use XML to store data.\nAt the beginning of gameplay, I read the \"monster.xml\" file once, and keep it in the memory, and every time I need to create a monster, I just refer to it.\nIs this XML approach more efficient than the lua one ? Or are there other better solutions?\n\nThanks !" ]
[ "xml", "database", "cocos2d-iphone", "lua", "game-engine" ]
[ "Read a file in the external distribution before installing the files in install4j", "I have a requirement to read a file that is in the external distribution before the \"install Files\" action is called during the installation. is it possible to read the file during the startup action or extract the file to a temp location and read it before the installation process?" ]
[ "install4j" ]
[ "Pyautogui click not clicking properly", "in this code:\n\ntemp = None\nwhile temp == None:\n temp = pyautogui.locateOnScreen(\"Play_Button.PNG\")\n\nplay_buttonx, play_buttony = pyautogui.center(temp)\n\npyautogui.click(play_buttonx, play_buttony, duration = 0.3)\n\n\nThe pointer heads to the center of the button and stops!\n\nI tried the win32api + win32con, still it didn't work, I tried setting \"clicks\" to a different number, changing intervals, etc..., yet nothing works, once I touch my mousepad the button is clicked and the game starts..." ]
[ "python", "click", "bots" ]
[ "Limiting MySQL results to prior days of the week", "I have a table like so:\n\nid | gallons_used | date\n----------------------\n1 2 157263300\n2 5 157262000\n...\n\n\nI want to get a result set containing only records that took place on X day of the week (Monday or Tuesday or Wednesday, etc etc)" ]
[ "mysql", "sql", "database" ]
[ "Tensorflow Serving: Rest API returns \"Malformed request\" error", "Tensorflow Serving server (run with docker) responds to my GET (and POST) requests with this:\n\n{ \"error\": \"Malformed request: POST /v1/models/saved_model/\" }\n\nPrecisely the same problem was already reported but never solved (supposedly, this is a StackOverflow kind of question, not a GitHub issue):\n\nhttps://github.com/tensorflow/serving/issues/1085\n\nhttps://github.com/tensorflow/serving/issues/1095\n\nAny ideas? Thank you very much." ]
[ "rest", "tensorflow", "machine-learning", "tensorflow-serving" ]
[ "How to disable resizeableActivity without disabling the support of foldable devices", "In the android developers site they say:\n\nIf you set resizeableActivity=false to disable multi-window mode but\nstill want to support app continuity, add the following meta-data to\nthe manifest of your element:\n<meta-data\n android:name="android.supports_size_changes" android:value="true" />\n\nIf the value is true and the user attempts to fold or unfold a device,\nthe activity will apply any changed configurations in a way that\nsupports changes in window sizes.\n\nSo I did as they said but the activity isn't automatically resumed when I test it in the emulator.\nhere is my code:\n <application\n android:allowBackup="true"\n android:icon="@mipmap/ic_launcher"\n android:label="@string/app_name"\n android:resizeableActivity="false"\n android:roundIcon="@mipmap/ic_launcher_round"\n android:theme="@style/MaterialTheme">\n \n <meta-data\n android:name="android.supports_size_changes" android:value="true" />\n </application>\n\nDid I do anything wrong?" ]
[ "android", "foldable-devices" ]
[ "How to set android application \"type\"?", "Is there a way to set your applications \"type\"? For example, If I download Opera for Android and then in another application I click a web URL, Android will ask me do I want to open the link with the default browser or with Opera. How do Opera achieve this?\n\nEDIT specifically, how would I pass the URL into my activity?" ]
[ "android" ]
[ "sed to extract pattern between a substring and first occurance of a substring in a string - get relative path", "I have the following line:\n\nSF:/Users/someuser/Documents/workspace/project/src/app/somejavascriptfile.js ./coverage/coveragereport.info\n\n\nI am trying to get the relative path from the above absolute path using sed in bash.\n\nTried a bunch of combinations but none of the regexes seem to work appropriately.\n\nThis is what I tried:\n\nABSOLUTEPATH=SF:$(echo $PWD | sed 's_/_\\\\/_g')\nsed -i '' 's/.*'$ABSOLUTEPATH'/SF:' ./coverage/coveragereport.info\n\n\nbut this doesn't work as intended.\n\nAny idea?" ]
[ "regex", "bash", "sed" ]
[ "How Can We Pass a Value From PopUpWindow to Aspx Page using JavaScript?", "Im using the below function:\n\nfunction GetRowValue(val) {\n window.opener.document.getElementById(\"UniqueKeyField\").value = val;\n window.opener.__doPostBack();\n window.close();\n }\n\n\nwindow.opener.__doPostBack error and Even if i have window.Close() function Popup window is not closing." ]
[ "javascript", "asp.net" ]
[ "How can i save selected item from dropdown list in angular 2", "I need help with saving selected item from dropdown list.\nHere is my code. With this code I can console.log selectedProject.id and selectedProject.name by button and function outData. But I can't show selectedProject.name in HTML by itself. \n\nWhen I trying print this data I get this error: \n\n\n EXCEPTION: Uncaught (in promise): Error: Error in\n http://localhost:3000/app/home.component.html:2:48 caused by:\n self.context.selectedProject is undefined\n\n\n import { Component, OnInit, NgModule } from '@angular/core';\n import { Router, Routes, RouterModule, ActivatedRoute } from '@angular/router';\n import { FormsModule } from '@angular/forms';\n\n import { Project } from './project'\n import { AVAILABLEPROJECTS } from './mock-projects';\n\n @Component({\n moduleId: module.id,\n templateUrl: 'home.component.html',\n styles: [`\n .container {\n padding-top: 41px;\n width:435px; \n min-height:100vh;\n }\n `]\n })\n\n export class HomeComponent {\n public projects: Project[];\n public selectedProject: Project;\n\n constructor() {\n this.projects = AVAILABLEPROJECTS;\n }\n\n outData() {\n console.log(this.selectedProject.id);\n console.log(this.selectedProject.name);\n }\n }\n\n\n<div class=\"container\">\n <form class=\"form form-login\" role=\"form\">\n <h2 class=\"form-login-heading\">Projekt:</h2>\n <!--{{selectedProject.name}}-->\n <div class=\"form-group\">\n <select class=\"form-control\" [(ngModel)]=\"selectedProject\" name=\"selectedProject\">\n <option *ngFor=\"let project of projects\" [ngValue]=\"project\">{{project.name}}</option>\n <!--[value]=\"project\"-->\n </select>\n\n </div>\n <div>\n <dutton (click)=\"outData()\">Out Data</dutton>\n </div>\n </form>\n</div>" ]
[ "angular", "typescript", "angular2-forms", "angular2-databinding" ]
[ "How can I load jar files for debugging in Jython?", "How can I load jar files for debugging in Jython?" ]
[ "java", "jar", "jython" ]
[ "SQLite: Query not responding when key = null", "I have the following tables\n\nR: \nrid, wid, sid, attend\n1 1 3 1\n2 1 2 0\n3 2 3 1\n4 3 1 0\n5 2 1 1\n6 4 1 1\n\nE: \neid, wid,sid\n1 1 3\n2 2 1\n\nW:\nwid, title\n1 title1\n2 title2\n3 title3\n4 title4\n\n\nI want to retrieve the title of W where the wid is in R but not in E. Naturally, I will use LEFT OUTER JOIN. I wrote the following query\n\nSELECT DISTINCT w.title\nFROM E LEFT OUTER JOIN R \nON R.sid = E.sid AND R.wid = E.wid \nJOIN W\nON R.wid = W.wid\nWHERE R.sid = 1 AND R.attend = 1\n\n\nthis will return the titles of wid that exists in both tables R and E: title2 and title3. However, I want to retrieve the titles of wid that exists in R but not in E i.e: title4. Therefore, when I LEFT OUTER JOIN R with E, the columns of E that does not have matching values in R will be filled with NULL values -as far as I know-. Though, when I use the clause WHERE E.sid = NULL or ON E.sid = NULL the query does not retrieve anything what so ever. I tried to retrieve from the table with simple query like \nSELECT * FROM E where sid = NULL but it would not retrieve anything although I added a row with sid = null just to test.\nso, maybe there is a problem with SQLite supporting null values or maybe it is just something in my query.\n\nI have been searching for a week now. I hope I can find some help here as I usually do." ]
[ "sqlite" ]
[ "is it possible to execute binary file by using ruby on rails", "I felt this is very strange to me, I am having a sample binary file called Sum. This is file type - ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=6cff4e9ea8b26ee16eafa07599eec08ea629ee09, not stripped\n\nI need to execute this using ruby by passing two inputs. I am not aware of this, so is it possible to achieve this using Ruby on Rails. I am really apologise if my explanation is obscure. Thanks in advance." ]
[ "ruby-on-rails", "ruby", "binaryfiles" ]
[ "Write MSIL interpreter - how to describe operational semantics?", "I want to write MSIL interpreter using Mono Cecil to parsing but interpretation I want to do it yourself. I've seen a lot of examples but mostly for expression only. How to describe operational semantics for MSIL? I dont know how to start with this task so any advice will be valuable." ]
[ "interpreter", "cil" ]
[ "How to configure coin-osi with mosek interface", "I have downloaded the source code from http://www.coin-or.org/download/source/Osi/, and installed Mosek 7. How to configure the coin-osi with Mosek library? Could you give me some advice, please? Thanks." ]
[ "mosek" ]
[ "Php email function not working properly", "I know this seems like it is a duplicate but please read first:\n\nI have the following php code:\n\n<?php\n\n$to = '[email protected]';\n\n$name = $_POST['name'];\n$email = $_POST['email'];\n$message = $_POST['message'];\n$subject = $_POST['subject'];\n$headers = \"From: \".$email.\" \\r\\n\";\n$headers .= \"Reply-To: \".$email.\"\\r\\n\";\n\nmail($to, $subject, $message, $headers); \n\n?> \n\n\nI think it's the standard email sending script. However, I face an interesting bug. My website is florin-pop.com and the emails are only sending when in the email input field I put something like this: [email protected] or [email protected] or anything before @florin-pop.com.\n\nIf I try to put a something different like [email protected] or even a real yahoo email address I don't get the email. Why? It's something wrong with my code? It may be from the hosting company? ( I use hostgator ).\n\nEDIT:\n\nIf I change the Reply-To to the domains email address then it is working, but it is still not the perfect way to do it. If you press the reply button and forget about this trick, you will email yourself.\n\nCode:\n\n<?php\n\n$to = '[email protected]';\n$my_domain_email = '[email protected]';\n\n$name = $_POST['name'];\n$email = $_POST['email'];\n$message = $_POST['message'];\n$subject = $_POST['subject'];\n$headers = \"From: \".$email.\" \\r\\n\";\n$headers .= \"Reply-To: \".$my_domain_email.\"\\r\\n\";\n\nmail($to, $subject, $message, $headers); \n\n?>" ]
[ "php", "html", "email" ]
[ "Odoo: How to process winmail.dat attached in conversations?", "We have some customers who uses Microsoft Outlook to send attachments. However in odoo we see only winmail.dat files (while everything looks ok in mail client).\n\nIs there any way to force odoo to expose winmail.dat content?" ]
[ "python", "odoo", "tnef", "winmail.dat" ]
[ "dot notation , window object and its properties", "I am trying to learn some new concepts about javascript.Here is a simple code I wrote. Inside a function THIS keyword refers to global object which is window unless it's bind with the context of another object. Inside myobj object there are two methods which shares a same name with another two globally accessible function called afunc and anotherfunc respectively. I want to access those global function within myobj context and of course without using binding global object to a immediately invoked function which I used to call them. But it is throwing an error. My question is if everything in javascript is an object and window object holds them ,then why can i access those function using this.afucn or window.afunc?\n\n\r\n\r\n(function(){\r\nvar afunc=function (){\r\n document.write('this is world'+'</br>');\r\n}\r\nvar anotherfunc=function (){\r\n document.write('this is another world');\r\n}\r\n var myobj={\r\n afunc:function(){\r\n document.write('afunc');\r\n },\r\n anotherfunc:function(){\r\n document.write('anotherfunc');\r\n },\r\n context:function(){\r\n (function(){\r\n this.afunc();\r\n this.anotherfunc();\r\n })();\r\n }\r\n };\r\n myobj.context();\r\n})();" ]
[ "javascript", "scope", "this", "window-object" ]
[ "Padding not applied on integer in a struct when it is followed by a char of size bigger than integer", "I have some structs for which i am checking their sizes. According to the rules of padding, i am expecting different results. When i have a char of size between 4 and 8, i see that padding is applied to the char up to size 8, but padding is not applied for the preceding integer or for the last integer/variable of the struct. \n\nThe main question here is why padding is not applied to integers whenever they are followed by char of size bigger than 4?\n\nWhat is the meaning of applying padding to the char to reach 8 bytes, if integer still use 4 bytes?\n\nBelow, you can see the code why my questions in comments:\n\n#include <stdio.h>\n\ntypedef struct {\n int i; \n char str[3]; //padding of 1\n int f;\n} stru_10;\n\n//size is 4+4+4 = 12\n\ntypedef struct {\n int i; //why no padding applied here?\n char str[7]; // padding of one\n int f; //why no padding applied here?\n} stru_11;\n\n//Actual result : size is 16. Why no padding on integers?\n\ntypedef struct {\n int i; //why no padding applied here?\n char str[9]; // padding of 3\n int f; //why no padding applied here?\n} stru_12;\n\n//Actual result : Size is 20. Why no padding on integers?\n\ntypedef struct {\n int i; //why no padding applied here?\n char str[5]; // padding of 3\n int f; //why no padding applied here?\n} stru_13;\n\n//Actual result : Size is 16. Why no padding on integers?\n\ntypedef struct {\n int i; \n char c; // padding of 3\n int f; \n} stru_14;\n\n//Actual result. Size is 12 as expected.\n\ntypedef struct {\n int i; // padding of 4 \n char *c; // padding of 3\n int f; //padding of 4 \n} stru_15;\n\n//Actual result. Size is 24 as expected(8*3).\n\nint main(void) {\n\n printf(\"Size of stru_10 is %d\\n\",sizeof(stru_10)); //12\n printf(\"Size of stru_11 is %d\\n\",sizeof(stru_11)); //16\n printf(\"Size of stru_12 is %d\\n\",sizeof(stru_12)); //20\n printf(\"Size of stru_13 is %d\\n\",sizeof(stru_13)); //16\n printf(\"Size of stru_14 is %d\\n\",sizeof(stru_14)); //12\n printf(\"Size of stru_15 is %d\\n\",sizeof(stru_15)); //24\n\n return 0;\n}" ]
[ "c", "memory-management", "struct", "size", "padding" ]
[ "python: how to get information about a function?", "When information about a type is needed you can use:\n\nmy_list = []\ndir(my_list)\n\n\ngets:\n\n['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n\n\nor:\n\ndir(my_list)[36:]\n\n\ngets:\n\n['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n\n\nNow, in the documentation of Python information can be found about these functions, but I would like to get info about these functions in the terminal/command-line.\nHow should this be done?" ]
[ "python", "function", "methods" ]
[ "Append list items with different query", "I have a nav list generated by a CMS. The cms does not allow for additional html to be inserted in the nav component except adding a class to each element. The end product I would like to have is attaching an icon beside each nav item via font awesome. Each nav item has its own unique icon and unique class. I have been able to use jquery to append each one individually however is there a cleaner approach to this.\n\n.html\n\n<ul class=\"nav navbar-nav\">\n <li class=\"homeNav\"><a href=\"#\">Home</a></li>\n <li class=\"aboutNav\"><a href=\"#about\">About</a></li>\n <li class=\"objNav\"><a href=\"#objective\">Objective</a></li>\n ...\n ...\n ...\n</ul>\n\n\n.jquery i am using\n\n$('.homeNav').children().empty().append('<i class=\"fa fa-home\"></i> Home');\n\n\nShould I just make a jquery call for each item?" ]
[ "javascript", "jquery" ]
[ "Why parametric bootstrapping bias and standard error are zero here?", "I'm performing parametric bootstrapping in R for a simple problem and getting Bias and Standard Error zero always. What am I doing wrong?\n\nset.seed(12345)\ndf <- rnorm(n=10, mean = 0, sd = 1)\n\nBoot.fun <- \n function(data) {\n m1 <- mean(data)\n return(m1)\n }\n\nBoot.fun(data = df)\n\nlibrary(boot)\nout <- boot(df, Boot.fun, R = 20, sim = \"parametric\")\nout\n PARAMETRIC BOOTSTRAP\n\n\nCall:\nboot(data = df, statistic = Boot.fun, R = 20, sim = \"parametric\")\n\n\nBootstrap Statistics :\n original bias std. error\nt1* -0.1329441 0 0" ]
[ "r", "statistics", "statistics-bootstrap" ]
[ "To validate string or to identify space in a string", "This is my sample code\n\n<setProperty propertyName=\"selection2\">\n <constant>PHONE.NUMBER EQ {phoneNumber}</constant>\n</setProperty>\n\n\nHow to check whether there is any space in 'phoneNumber' before assigning to PHONE.NUMBER field?\n\nif there is any space I need to replace it with '+' symbol." ]
[ "apache-camel", "spring-camel" ]
[ "WinForms/WebForms controls' default case musings", "Why does the WinForms default name for controls start with lowercase, but is uppercase for WebForms? What's the likely rationale for this?" ]
[ "c#", "winforms", "webforms", "uppercase", "lowercase" ]
[ "Unable to read the String from json data in android via url", "I started programming android and came across a problem with json.\nI was trying to get the data as a string from the json, {\"results\":{\"results_start\":1,\"results_returned\":4,\"api_version\":\"2.00\",\"results_available\":4,\"school\":[{\"name_kana\":\"Cook\",\"kyoten\":{\"name_kana\":\"CookTime\",\"kyoten_type_cd\":\"TK\",\"shiryo_url\":{\"qr\":\"http://webservice.recruit.co.jp/common/qr?url=https\"}]}.\n\nI tried to use the code below to get the value from \"name_kana\" from the json data above with the following code but cannot get the string. \n\n String name_kana=\"\";\n try{\n JSONObject reader= new JSONObject(requestresult);\n JSONArray school = reader.getJSONArray(\"school\");\n for (int i = 0; i < school.length(); i++) {\n reader = school.getJSONObject(i);\n }\n name_kana = reader.optString(\"name_kana\");\n }catch(JSONException ex){\n\n }\n t = (TextView)container.findViewById(R.id.test);\n t.setText(name_kana);\n\n\nSince I'm new to android, would you mind if you can explain or provide me with the hints so that I can get the string data from the json mentioned above ? I would love to hear from you !" ]
[ "android", "json" ]
[ "How to move Jupyter notebook cells up/down using keyboard shortcut?", "Anyone knows keyboard shortcut to move cells up or down in Jupyter notebook?\nCannot find the shortcut, any clues?" ]
[ "python", "jupyter-notebook" ]
[ "Priority order of visibility and display in CSS", "I know that display: none removes the element from the page while visibility: hidden hides the element but preserves the space.\n\nMy question is, is it a good idea to use the two styles together on an element and if so, what is the priority order of the two when used together? \n\nMy use case is like so:\n\n\nWhen shouldRemoveElement = true, Irrespective of\nshouldHideElement the div should be removed from the page. \nWhen shouldRemoveElement = false, the div should respect the\nvisibility style based on the shouldHideElement value.\n\n\nWhile this works as expected I'm wondering if it could cause any unexpected side effects.\n\nsample code:\n\n<div className=\"field-container count-field\"\n style={{ display: shouldRemoveElement ? 'none' : true, visibility: shouldHideElement ? 'hidden' : 'visible' }}>\n <customComponent>..</customComponent>\n</div>" ]
[ "html", "css" ]
[ "Orchestrate Cloud Formation using Code Pipeline", "I'm using Code Pipeline: Jenkins for Build and Code Deploy/Opsworks for deployment.\nI am able to Orchestrate Cloud Formation template with AWS CLI using Jenkins, specifying a Command line step.\nIs there any other option Orchestrate Cloud Formation without using Jenkins or any CI tool? Once the build is done, can it trigger the Cloud Formation in Code pipeline?\n\nPlease suggest any best practices." ]
[ "amazon-web-services", "amazon-cloudformation", "aws-codepipeline" ]
[ "Checking a DataFrame string value contains words with certain prefixes", "First time working with Pandas, and I'm struggling to query the DataFrame for this spec.\n\nLet's say I create a dataframe as follows:\n\ndf = pd.read_csv(_file, names=['UID', 'Comment', 'Author', 'Relevancy'])\n\n\nWhich gives:\n\nUID . Comment . Author . Relevancy\n1234 . motorcycles are cool . dave . 12\n5678 . motorhomes are cooler . mike . 13\n9101 . i love motorbikes . frank . 14\n\n\nI need to return all of these rows when I query the word 'motor'.\n\nI.e. a row should be returned if it's \"Comment\" string contains a word that is prefixed by a given word. \n\nI essentially want to do something like:\n\ndf[\"Comment\"][any(word in df[\"Comment\"].str.split() if word.startswith(\"motor\"))]\n\n\nAny help and direction is much appreciated." ]
[ "python", "string", "pandas" ]
[ "smudge in svg animation", "I'm animating an SVG and notice a smudge or piece of the SVG that shouldn't be there when the browser is done loading. If you check this code pen - http://codepen.io/claire2013/pen/ouIeg you'll notice a little black smudge/drawing on the left side near the nose area of the glasses. Anyone have an idea to why this is happening?" ]
[ "vector", "svg", "vector-graphics" ]
[ "Do we have to keep Exceptions serializable in .NET 5?", "Since the concept of having multiple AppDomains is going bye-bye in .NET 5, do we need to keep serializing custom Exceptions once the move is done? I understand that if I'm writing a library and it is consumed from .NET Framework, then the Exception needs to be Serializable, but barring that, is there a reason to, other than inertia?" ]
[ "c#", ".net", ".net-5" ]
[ "PySpark add rows to dataset in streaming", "I'm new in the world of Spark and in particular of pyspark. I have an app that gets data from Kafka in streaming and has to process these data in some way. What I need is to add the new coming row to the original dataset, in a few words, my dataset, in my app, is expanding.\nHere my try:\nuniverse = spark_session.read.csv('./dataset/data_v4', header=True, inferSchema=True)\nuniverse = universe.withColumn('id', monotonically_increasing_id())\nuniverse.createOrReplaceTempView('universe')\n\nuniverse.show()\n\nssc = StreamingContext(spark_session.sparkContext, 5)\n\nquiet_logs(spark_context)\n\nbrokers = [0]\ntopic = 'mytopic'\ndirectKafkaStream = KafkaUtils.createDirectStream(ssc, [topic], kafkaParams={"bootstrap.servers": 'myAmazonServer'})\n\nprint('Attendo i dati...')\ndirectKafkaStream.foreachRDD(compute_rdd)\nssc.start()\nssc.awaitTermination()\n\nIn the function compute_rdd I'm trying to do this:\ndef compute_rdd(time, rdd):\n\n if rdd.count() > 0:\n \n print('New data...')\n\n stream_data = rdd.collect()\n data = json.loads(stream_data[0][1])\n date_format = '%Y-%m-%dT%H:%M:%S'\n\n new_data = {\n 'id': universe.select('id').collect()[-1]['id'] + 1, # cambiare con funzione random o qualche funzione di spark\n 'timestamp': datetime.strptime(data['timestamp'], date_format),\n 'vessel': str(data['vessel']),\n 'velocity': float(data['velocity']),\n 'distance': float(data['distance']),\n 'drift_angle': float(data['drift_angle']),\n 'decision': int(data['decision'])\n\n }\n\n \n times = {}\n if universe.where(f'vessel=="{new_data["vessel"]}"').rdd.isEmpty():\n\n print('Add data:', new_data)\n new_row = spark_session.createDataFrame([new_data], schema=universe.schema)\n\n universe = universe.union(new_row) # here the error\n\nThe problem is that I can't add new row using the classic sintax:\ndf = df.union(new_row)\n\nThe raised error is UnboundLocalError: local variable 'universe' referenced before assignment\nI tried to make my variable universe, containing my dataset, as global writing these functions:\ndef read_universe(datafile):\n if 'universe' not in globals():\n universe = get_spark_context().read.csv(datafile, header=True, inferSchema=True)\n universe = universe.withColumn(ID_COLUMN_NAME, monotonically_increasing_id())\n universe.createOrReplaceTempView('universe')\n\n globals()['universe'] = universe\n return globals()['universe']\n\n return globals()['universe']\n\n\ndef get_universe():\n return globals()['universe']\n\ndef universe_update(new_universe):\n globals()['universe'] = new_universe\n\n return globals()['universe']\n\nIn this way, using these functions, I solved my problem, but is it the right way to reasoning in pyspark framework? How works Global variables in the spark environment? Global variables have impact on scalability and parallelism in Spark?\nOf course, I'm here also for suggestions and other solutions." ]
[ "python", "apache-spark", "pyspark", "global-variables", "spark-streaming" ]
[ "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom'", "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom'\n\nI am getting the above error while trying to move the entire application from react v15.6to v16.2, by using the migration tool from facebook like jscodeshift." ]
[ "javascript", "reactjs", "facebook", "jscodeshift" ]
[ "Runtime Error 3075 - - VBA Access- missing Operator", "Where is the missing Operator?\n\nCode:\n\nIf Nz(DLookup(\"Email\", \"Employees\", \"Email=\" & Me![Email]), \"\") <> \"\" Then\n correo = DLookup(\"Email\", \"Employees\", \"Email=\" & Me![Email])" ]
[ "vba", "ms-access" ]
[ "Speeding up simulation in Matlab using gpuArrays", "I have a Matlab simulation which updates an array :\n\nArray=zeros(1,1000) \n\n\nas follows: \n\nfor j=1:100000 \nArray=Array+rand(1,1000) \nend \n\n\nMy question is the following: \nThis loop is linear, so it cannot be parralelized for each slot in the array, but different slots are updated independently. So, naturally Matlab performs array operations such as this in parralell using all the cores of the CPU. \n\nI wish to get the same calculation performed on my NVIDIA GPU, in order to speed it up (utilizing the larger number of cores there). \n\nThe problem is:\nthat naively doing \n\ntic \nArray=gpuArray(zeros(1,1000));\nfor j=1:100000 \n Array=Array+gpuArray(rand(1,1000)); \nend \ntoc \n\n\nresults in the calculation time being 8 times longer! \n\na. What am I doing wrong? \n\nUpdate: \nb. Can someone provide a different simple example perhaps, to which GPU computing is beneficial? My aim is to understand how I can utilize it in Matlab for very \"heavy\" stochastic simulations (multiple linear operations on big arrays and matrices)." ]
[ "matlab", "for-loop", "parallel-processing" ]
[ "Word (Along with space) search in T Sql", "I have a column Transactions in a SQL Server table A.\n\nI have around 1000 rows in that table, and in each row I have strings which has combination of \n\n \"@transaction --space of 3 characters---1\" or \"@transaction --space of 3 characters---0\" these strings may be even repeated n number of times within the single row.\n\n\nResult - I want to check all the \n\n\"@transaction --space of 3 characters---1\" ones how many times repeated.\n\"@transaction --space of 3 characters---0\" zeros how many times repeated.\n\n\nI tried with queries such as \n\nSelect * from A where transaction like '%@transaction --space of 3 characters---1%\nSelect * from A where transaction like '%@transaction --space of 3 characters---0%\n\n\nBut these can't give me the desired result because there may be more number of above strings in single column. \n\nCan anyone suggest how to count all these two strings with ending 1 and 0 separately ?\n\nThanks in advance" ]
[ "sql", "sql-server-2008", "tsql" ]
[ "Git and diff showing on Bitbucket", "I have a GIT repository hosted on Bitbucket. When commiting changes to the repo, Bitbucket sees these changes on the whole file (before it worked properly). So Bitbucket says 1 line added and 1 line removed.\n\nBefore pushing I check locally on differences with difftool (diffmerge). Here the changes are shown as normal.\n\ncore.autocrlf is set to true.\n\nWhat is the problem here?" ]
[ "git", "github", "bitbucket" ]
[ "Magic getter/setter not being called", "When I was reading the OOP chapter in the Zend PHP Certification study guide, 5.5, I found a question that gave me a shock from its answer. This question is:\n\nclass Magic\n{\n public $a = \"A\";\n protected $b = array( \"a\" => \"A\" , \"b\" => \"B\" , \"c\" => \"C\" );\n protected $c = array( 1 , 2 , 3 );\n\n public function __get( $v )\n {\n echo \"$v\";\n return $this->b[$v];\n }\n\n public function __set( $var , $val )\n {\n echo \"$var: $val,\";\n $this->$var = $val;\n }\n}\n\n$m = new Magic();\necho $m->a . \", \" . $m->b . \", \" . $m->c . \", \";\n$m->c = \"CC\";\necho $m->a . \", \" . $m->b . \", \" . $m->c . \", \";\n\n\nThe output for this code is:\n\nb, c, A, B, C, c: CC, b, c, A, B, C\n\n\nWhy does this code not print a, and how does it work?" ]
[ "php", "oop", "echo" ]
[ "How to overwrite the rdd saveAsPickleFile(path) if file already exist in pyspark?", "How to overwrite \nRDD output objects any existing path when we are saving time.\n\ntest1: \n\n975078|56691|2.000|20171001_926_570_1322\n975078|42993|1.690|20171001_926_570_1322\n975078|46462|2.000|20171001_926_570_1322\n975078|87815|1.000|20171001_926_570_1322\n\nrdd=sc.textFile('/home/administrator/work/test1').map( lambda x: x.split(\"|\")[:4]).map( lambda r: Row( user_code = r[0],item_code = r[1],qty = float(r[2])))\nrdd.coalesce(1).saveAsPickleFile(\"/home/administrator/work/foobar_seq1\")\n\n\nThe first time it is saving properly. now again I removed one line from the input \n file and saving RDD same location, it show file has existed.\n\nrdd.coalesce(1).saveAsPickleFile(\"/home/administrator/work/foobar_seq1\") \n\n\nFor example, in dataframe we can overwrite existing path. \n\ndf.coalesce(1).write().overwrite().save(path)\n\n\nIf I am doing same on RDD object getting an error. \n\nrdd.coalesce(1).write().overwrite().saveAsPickleFile(path)\n\n\nplease help me on this" ]
[ "apache-spark", "pyspark", "rdd", "pyspark-sql" ]
[ ".Net Core TFS 2017 build losing some appsettings in appsettings.json file", "I have a strange situation where when I build in release mode versus debug mode, some of the settings within appsettings.json suddenly don't exist in what is published to the drop folder of TFS 2017. Sometimes, this even happens if I'm building in debug mode. What causes this and how do I stop it from occurring?" ]
[ "c#", ".net", "tfs", ".net-core" ]
[ "Timestamp value from database in grid column in Magento", "I've created a grid in Magento admin, and I try to get a column from database which is timestamp.\n\nIn my grid I added it like this:\n\n$this->addColumn(\n 'created_at', array(\n 'header' => $translateHelper->__('Created at'),\n 'align' => 'left',\n 'width' => '50px',\n 'type' => 'datetime',\n 'index' => 'created_at',\n )\n);\n\n\nBut in my columns my data looks like this:\n\nMMMMMMMMM 28, 13 04:June:ssss PM \n\n\nIt's really strange because I created other timestamp columns like above, and they show OK. Does anybody know what is the problem?" ]
[ "magento", "grid", "timestamp" ]
[ "How to download *.ics file from the browser in android?", "How to register a new MIME type in android? I am very much new to android. I need to download a *.ics file from the browser (Email attachment).but the browser response is unsupported file format.Can anyone help me ???" ]
[ "android" ]
[ "Getting events from specific calendar using office 365 API", "I am trying to get events from specific calendar (non default) using Office 365 API. I found this URL from the office 365 API docs.\n\nGET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}\n\n\nWhere i replaced {calendar_id} with actual ID which i got from another API call which returns all calendar groups. \n\nGET https://outlook.office.com/api/{version}/me/calendargroups\n\n\nAfter replacing all relevant parameters, i am getting a HTTP 500 error.\n\nBut i can get events for my default calendar with \n\nGET https://outlook.office.com/api/{version}/me/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}\n\n\nHow can i get events from specific (non default) calendar ?\n\nAppreciate your help." ]
[ "office365", "outlook-restapi" ]
[ "Renaming carrierwave extension before process ends", "I have an audiofile which gets uploaded via carrierwave. I wanna rename the current_file before it gets processed.\n\nWhen I do processing a version, normally I rewrite the file extension via \n\ndef full_filename(for_file=file)\n super.chomp(File.extname(super)) + '.mp3'\nend \n\n\nbut this will be executed after the version creation process. \n\nHow can I make a version and renmame it before it gets saved. \n\nTo be more concret: \n\nI am converting an WAV file to a MP3 by using ffmpeg.\n\nFFMPEG needs an inputfile (-i inputfile.wav) and and outputfilename which needs the mp3 fileextension to process an mp3. (output.mp3 in my case)\n\nHow can I rename the extension before it get's saved?\n\nffmpeg -i inputfile.wav -acodec libmp3lame -f mp3 watermarked.mp3\n HOW CAN I RENAME THE EXTENSTION BEFORE IT GET SAVED? ^^^\n\n\nThe above snip (-f forcing the codec and format) does NOT it's job and \n\ndef full_filename(for_file=file)\n super.chomp(File.extname(super)) + '.mp3'\nend \n\n\nis happening too late (done after processing)\n\nHow can I rename the temporary Carrierfile name?" ]
[ "ffmpeg", "carrierwave", "fog" ]
[ "ASP.NET Repeater DataItems", "I have a simple repeater control with 5 columns and data that show up fine. But, I have a 6th data item that I need to place in the next line after each of the table rows.\n\nI have tried it placing the 6th item in the alternating template item, and it does what I want, but, does not loop through all the rows.\n\nFrom the below code, the Notes data item is the one I want to appear in a new line after each row...The code below does it, but it does not loop through:\n\n\n\n <HeaderTemplate>\n <table class=\"tblMoves\" >\n <tr>\n <th>\n Type\n </th>\n <th>\n ID\n </th>\n <th>\n First Name\n </th>\n <th>\n Last Name\n </th>\n <th>\n Date\n </th>\n </tr>\n\n </HeaderTemplate>\n <AlternatingItemTemplate>\n <tr>\n <td colspan=\"5\"> <%#Eval(\"Notes\")%></td>\n </tr>\n </AlternatingItemTemplate>\n <ItemTemplate>\n\n <tr>\n <td><asp:Label ID=\"empid\" Text='<%#Eval(\"type\") %>' runat=\"server\"></asp:Label></td>\n <td><asp:Label ID=\"Label1\" Text='<%#Eval(\"ID\") %>' runat=\"server\"></asp:Label></td>\n\n <td><asp:Label ID=\"Label2\" Text='<%#Eval(\"FirstName\") %>' runat=\"server\"></asp:Label></td>\n\n <td><asp:Label ID=\"Label3\" Text='<%#Eval(\"LastName\") %>' runat=\"server\"></asp:Label></td>\n <td><asp:Label ID=\"Label4\" Text='<%#Eval(\"Date\", \"{0:MM/dd/yyyy}\") %>' runat=\"server\"></asp:Label></td>\n </tr>\n </ItemTemplate>\n\n\n\n <FooterTemplate> </table></FooterTemplate>\n </asp:Repeater>" ]
[ "repeater" ]
[ "Removing One String CSV elements from another CSV String in java", "I am trying to remove elements from one CSV string with other CSV string :\n\nExample: \n\nString s1= \"a,b,c,d,e,f,g,h,w,p,4,5,12,u,v\"; /* Base String */\n\nString s2=\"e,5,v\";` /*(input string) This elements has to remove from above string S1 */\n\n\nExpected Output String s1: \"a,b,c,d,f,g,h,w,p,4,12,u\";\n\nI have Tried: For loop and remove elements and append back String.\n\nI can to this by no. of ways, but i want to know if there is any library/method/utility available ?" ]
[ "java", "arrays", "string" ]
[ "difference between MLA's USB CDC basic demo and CDC Device serial Emulator", "Microchip Library for applications provides demo code for USB - \"CDC basic demo\" & \"CDC device serial emulator\". I found all of them are related to microchip - USB communication, but what are the main difference between them." ]
[ "usb", "pic", "microchip", "cdc" ]
[ "yii2 deny user login on backend", "I have yii2 advance template with RBAC migration applied. I was trying to learn RBAC and followed the Docs 2.0. \n\nI have logged in using database, but the front-end and back-end both get logged in with any account. I have made 2 RBAC roles (admin, user), but can't understand or find how to \n\n\n restrict back-end to login non-admin user-role.\n\n\nThe following is the code for roles. and database entries:\n\nnamespace console\\controllers;\n\nuse Yii;\nuse yii\\console\\Controller;\n\nclass RbacController extends Controller\n{\n public function actionInit()\n {\n $auth = Yii::$app->authManager;\n\n // add \"admin\" role\n $admin = $auth->createRole('admin');\n $auth->add($admin);\n\n // add \"user\" role\n $user = $auth->createRole('user');\n $auth->add($user);\n\n $auth->assign($admin, 1);\n }\n}\n\n\nUser Table:\n\nadmin [email protected] 20 10 1421197319 1421197319\nuser [email protected] 10 10 1421198124 1421198124\n\n\nCurrent rules:\n\n'rules' => [\n [\n 'actions' => ['login', 'error'],\n 'allow' => true,\n ],\n [\n 'actions' => ['logout', 'index'],\n 'allow' => true,\n 'roles' => ['@'],\n ]," ]
[ "php", "yii2", "rbac" ]
[ "Can I use the command line/a script to modify variables in a java program that is already running", "I have a threaded TCP connection that is essentially waiting to receive messages inside a while(true) loop. The functionality of the program itself works great but it is not closing the socket/thread gracefully on exit and occasionally I get zombie processes that I have to kill before I can reconnect on the same port. I am writing a script that is going to be in charge of closing this and another program that runs in parallel with it. Originally my plan was to use a ShutdownHook to clean everything up at the end but the shutdown hook is being triggered by the script which kills the process. \n\nIs there any way that I can pass information to/modify a variable in the Java program while it is already running such as the boolean associated with the while loop? [while(true) just seems like bad coding] \n\nIf not does anyone have a better idea of how to use a script to clean up and close more gracefully a program that is running as a jar with no GUI. \n\nThanks in advance" ]
[ "java", "multithreading", "sockets", "batch-file", "command-line" ]
[ "How to populate user profile with django-allauth provider information?", "I'm using django-allauth for my authentication system. I need that when the user sign in, the profile module get populated with the provider info (in my case facebook).\n\nI'm trying to use the pre_social_login signal, but I just don't know how to retrieve the data from the provider auth\n\nfrom django.dispatch import receiver\nfrom allauth.socialaccount.signals import pre_social_login\n\n@receiver(pre_social_login)\n\ndef populate_profile(sender, **kwargs):\n u = UserProfile( >>FACEBOOK_DATA<< )\n u.save()\n\n\nThanks!!!" ]
[ "django", "facebook", "authentication", "django-allauth" ]
[ "rand() is outputting the same Number for my while loop but not for my for loop", "I am making this code for a random dice roller and I want to get a random number until I get three 6's on the dice. For some reason this produces the same number for all runs, but on my for loop it works. Can I get some help getting this to work? \n\nThe pesky While loop in question:\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\nint Ran(int max) {\nreturn (rand() % max)+ 1;\n}\n\nint main(){\n\n int max = 6;\n int nsuc = 0, ncount = 0;\n int matt = 40;\n srand((unsigned) time(0));\n\n for(int i = 1; i <= 20; i++){\n while(!(nsuc >= 3)){\n int nr = Ran(max);\n if(nr < matt){\n ncount++;\n if(nr == 6){\n nsuc++;\n }\n }\n }\n printf(\"Number of rolls until 3 6's = %d\\n\", ncount);\n }\n}\n\n\nCleaned up the for loop so it's easier to read now:\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n\nvoid Shuffle() {\nsrand((unsigned) time(NULL));\n}\n\nint Ran(int max) {\nreturn (rand() % max)+ 1;\n}\n\nvoid binomial(int run, int max, int btrials, int *array, int scount){\n\n for(int j = 1; j<=run; j++){\n for (int i=1;i<=btrials;i++){\n int r = Ran(max);\n if(r == 6){\n scount++;\n }\n printf(\"Trial %i, roll = %d\\n\",i , r);\n }\n array[j-1] = scount;\n scount = 0;\n printf(\"\\nEnd of Run %d\\n\\n\",j);\n }\n\n}\n\nint main(){\n\n int Runs;\n printf(\"How many runs do you want to do? > \");\n scanf(\"%d\", &Runs);\n printf(\"\\n\");\n\n int bdist[20];\n int distcount = 0;\n int max = 6;\n int btrials = 20;\n int suc[Runs+1];\n int scount = 0;\n\n\n\n Shuffle();\n binomial(Runs, max, btrials, suc, scount);\n\n printf(\"All counts of succesful 6 rolls.\\n\");\n\n /*\n for(int z = 1; z<=Runs; z++){\n printf(\"Run %d has %d 6's\\n\", z, suc[z-1]);\n }\n */\n\n for(int k = 0; k<=btrials; k++){\n for(int j = 1; j<=Runs; j++){\n if(suc[j-1] == k){\n distcount++;\n } \n }\n bdist[k] = distcount;\n distcount = 0;\n }\n\n for(int t = 0; t<=btrials; t++){\n printf(\"Number of runs with %d 6s = %d\\n\", t, bdist[t]);\n }\n\n return 0;\n\n}" ]
[ "c", "random", "while-loop" ]
[ "How to use regex to find exact match of a word but ignoring the same text with preposition? C#", "hi i've been working with DXF files and i got some trouble for regular expression.\ni have some text like this\n\n BODY\n 123\n abc\n GR-BODY\n attrib\n AcdbLine\n\n\nand i've write some regular expression that should be work but clearly i still need some help for this regular expression\n\nhere is my code\n\nstring[] tmp = Regex.Split(originalString, @\"(3DFACE|3DSOLID|ACAD_PROXY_ENTITIY|ARC|ATTDEF|ATTRIB|BODY|CIRCLE|DIMENSION|ELLIPSE|HATCH|HELIX|IMAGE|INSERT|LEADER|LIGHT|LWPOLYLINE|MLINE|MLEADERSTYLE|MLEADER|MTEXT|OLEFRAME|OLE2FRAME|POINT|POLYLINE|RAY|REGION|SEQEND|SHAPE|SOLID|SPLINE|SUN|SURFACE|TABLE|TEXT|TOLERANCE|TRACE|UNDERLAY|VERTEX|VIEWPORT|WIPEOUT|XLINE|LINE)\", RegexOptions.None);\n\n\nand i would like just to catch the BODY text but the GR-BODY still included, how to exclude the GR-BODY?\nthanks\n\nEDIT 1\ni'm sorry i look for the wrong code earlier\n\numm i want to the output like this\n\ntmp[0] = BODY\ntmp[1] = 123\\nabc\\nGR-LINE\\nattrib\\nAcdbLine\n\n\nsince my code only been able to make it like this\n\ntmp[0] = BODY\ntmp[1] = 123\\nabc\\nGR-\ntmp[2] = BODY\\nattrib\\nAcdbLine" ]
[ "c#", "regex" ]
[ "Post action not working in controller but working in another controller", "I have a project that allows users to create a new project. The UI has some textboxes and a submit button. It sends data through a POST request to an api call, which then creates a new project entity in the database. I deleted my migrations and then added a new migration since I wanted to fix some code, but now the post action no longer works. I see the following error message in the console -\n\nSystem.InvalidOperationException: Unable to resolve service for type\n'AutoMapper.IMapper' while attempting to activate\n'IssueTracker.Controllers.ProjectController'.\n\nCreate new project\n// POST api/values\n[HttpPost]\npublic void Post([FromBody] Projects project)\n{\n _repository.CreateProject(project);\n _repository.SaveChanges();\n}\n\nProjects Model\npublic class Projects\n{\n public Projects(string name, string description)\n {\n this.name = name;\n this.description = description;\n }\n\n public Projects()\n {\n //\n }\n\n [DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n public string id { get; set; }\n \n [Required]\n public string name { get; set; }\n \n [Required]\n public string description { get; set; } \n}" ]
[ "c#", "asp.net", ".net", "asp.net-mvc", "entity-framework" ]
[ "How to use jquery css('display', 'block') and css('display', 'none') in if else statement", "I am trying to use jquery-circle-progress (https://github.com/kottenator/jquery-circle-progress) start animate when user scroll in to that location. I was able to do a little bit with bug. Problem is the animation keep repeating. I like to animate it only once when user scroll to that location. Here is my work:\n\njquery:\n\n$(window).scroll(function() {\nvar windowWidth = $(this).width();\nvar windowHeight = $(this).height();\nvar windowScrollTop = $(this).scrollTop();\n\n\n$(document).ready(function() {\n $('#circle').circleProgress({\n value: 0.75,\n size: 180,\n fill: {\n gradient: [\"lightblue\", \"grey\"]\n }\n });\n});\n\n\nif (windowScrollTop > 760) {\n\n $('#circle').css('display', 'block');\n\n\n} else {\n $('#circle').css('display', 'none');\n\n}\n});\n\n\nhtml:\n\n<div id=\"circle\"></div>\n\n\nCSS: \n\n#circle {\ntext-align: center;\n}" ]
[ "javascript", "jquery", "css" ]
[ "How to pass a string variable data from Form2 to Form1?", "It's a program that reads student data from a text file and displys it in a listbox(Form1). From there on you can add a new student to the textfile by clicking on \"Add\" button that shows another form(Form2) and you input the new student data into the appropriate text boxes. Afterwards you can press \"Add\" button(Form2), but the Add Student(Form2) window comes up again with all the inputted data gone, and if I place the new student info into the text boxes again and click \"Add\", the program jumps back to the Form1 and a message box suppose to say what was added to the textfile, but nothing was added except for empty listbox items." ]
[ ".net", "vb.net", "string", "forms", ".net-3.5" ]
[ "Deactivate Apache Rewrite for Folder", "I have an Apache web server with default settings, I didn't add any rewrite rules to it. \n\nWhen I request a file through my application, if the file doesn't exist then Apache returns another file with a close name to the original name. The GET return is 301. I don't want this behavior but I am not sure how to disable it.\n\nI attempted several solutions I found online, but none seem to work. Here are my attempts:\n\n\nI added a .htaccess file with a RewriteEngine Off\nI added a .htaccess file with a RewriteEngine On but without any other lines or rules for the rewrite. One person online suggested that this is similar to turning it off.\nI added a <Directory> directive in httpd.conf, with only one line in it: RewriteEngine Off. I attempted the Directory two times, one time with a full path, and another time with a path starting after the domain name. For example, the link is www.domain.com/some/path/file.flv. My first attempt was <Directory \"/root/to/some/path/\"> and the second attempt was <Directory \"/some/path/\">.\n\n\nNone of these attempts have worked and I am not sure how to resolve this issue.\n\nUPDATE 1:\n\nMy application is a Flex Application created with the Flex SDK. I have Adobe Media Server installed on my server. My application loads a video file by setting the source property of the VideoDisplay object to (for example):\n\"/some/path/123_video.flv\".\n\nNow if that file doesn't exist, and I have a file called: \"124_video.flv\" then this other file will be played instead and my /var/log/httpd/access_log will have a line with GET 301 return value.\n\nI am sure that I send the correct file name from my application. The access_log even shows my file's name (123_video.flv in this example) but with a 301 return code and then my application plays the other video (124_video.flv).\n\nAs a test, I disabled the mod_rewrite.so module in my httpd.conf (by commenting the line with #) and I started getting 500 as a return code for files that didn't exist.\n\nWhat is more strange, I just did a quick test again, I went through my httpd.conf and changed all AllowOverride All to AllowOverride None restarted the httpd server and I still got the 301 code!!\n\nI even commented the mod_rewrite.so again and restarted the server.. and I got the same result 301!!\n\nI think my last test has something else wrong in it, but not sure what." ]
[ "php", "apache", ".htaccess", "mod-rewrite", "url-rewriting" ]
[ "Bitcoin URI \"r=\" param. How it works?", "Example: \n\nbitcoin:?r=https://bitpay.com/i/WEZPwt4tjjN9UXZrxSnTKu\n\n\nIt not gone work now, because bitpay payment is available only 15 minutes. But if you have an active payment it opens your Bitcoin app (f.e. Bitcoin core) and make your forms filled. \n\n\n\nHow to do smartlink like this? If im using simply URI I can put bitcoin:1ADDRESS?amount=1 etc., but I want to do it like a Bitpay." ]
[ "url", "request", "uri", "bitcoin", "bitcoind" ]
[ "Install Ruby via RVM on CPanel System to use Unicorn via Apache mod_proxy", "I own a CentOS 6.0 System with CPanel 11.30.5 installed. I'm very new to CPanel.\n\nI want to install Ruby using RVM in a user directory that will be created as a CPanel account (install it locally in a home directory, not on a system level). I want to run Unicorn (a Ruby application server) and have Apache act as a proxy. Unicorn will run on some port (eg. 3001) and I simply want to do what is usually done in an Apache Virtual Host as:\n\nProxyPass / http://127.0.0.1:3001\n\n\nAnyway, I'm tempted to just open the virtual hosts file and add my directive but as per my understanding it's best not to mess with any of the system files on a CPanel box. So my question is: What is the proper CPanel way to add ProxyPass to a virtual host and is there anything I need to know that might be unexpected?\n\n(I do not want Ruby installed system-wide or for use by others, just for this one account -- which I own and control -- so the CPanel specific implementation does not interest me.)\n\nThanks!" ]
[ "ruby-on-rails", "ruby", "rvm", "centos", "cpanel" ]
[ "KineticJS drawScene method stops workgin after some time", "In my application I draw some images that can be hidden from canvas by clicking them.\nand I've encountered an error in my clients browsers (opera and safai)\nAfter a sometime (2 to 5 minutes) of continuous clicking to those images, they've just stopped reacting on clicks.\n\nthe code looks like this:\n\nthis.selectItem = function(evt){\n evt.preventDefault();\n var addon = evt.targetNode;\n var current_avatar = avatars.avatar_list['avatar_'+addon.attrs.avatar_id];\n if(current_avatar.editable){\n if(!addon.attrs.addon_isbase){\n if(addon.attrs.addon_cattype !== 1){\n current_avatar.stage.remove(addon);\n /*addon.visible(false);*/\n current_avatar.stage.drawScene();\n }\n }\n }\n};" ]
[ "javascript", "kineticjs" ]
[ "how to get the parent div ID using javascript selenium?", "I am using webdriverjs, and i want to get the parent id of a webelement.There are multiple classes called row but each has a different id. The challenge is ID gets generated when a message is sent. so i can grab the innerHtml by class and then try to fetch the Id. \nI have the below html,\n\n<div class=\"row\" id=\"4003\">\n<div class=\"client-chat\">\n<p class=\"client-chat-text\">If you have any questions, don’t hesitate to message me. I’m here to help with whatever you need!<span class=\"chat-time\">Feb 01 2017 11:30:57</span></p>\n</div>\n</div>\n\n<div id=\"4361\" class=\"row\">\n<div class=\"coach-chat\">\n<p class=\"coach-chat-text\">\nhi\n</p>\n</div>\n\n\nthe second div that is with id(4361) is the generated one which i need to grab for my testing. However, I am able to fetch coach-chat-text . How do i get the parent element in selenium. I have tried the below code, but i don't know how to get the parent id.\n\nit('send a text message now',function(done){\n driver.findElement(webdriver.By.css(\"#messageField\")).sendKeys('Hi');\n driver.sleep(1000);\n driver.findElement(webdriver.By.xpath(\".//*[@id='sendMessage']\")).click().then(function(){\n driver.findElement(webdriver.By.className(\"coach-chat-text\")).getText().then(function(text){\n var message = text.slice(0,2);\n //i want to fetch the parent id here.\n try {\n expect(message).to.equal(\"www.pluma.co\");\n done();\n } catch (e) {\n done(e);\n }\n });\n });\n });\n });" ]
[ "javascript", "html", "selenium" ]
[ "Embedded Jetty app with 2 ContextHandlers listening at same port - Loading issue", "My embedded jetty app (using 6.1.26 jetty) has 2 context handlers registered to it. Both are listening at same port. Below is the sample.\n\nServer s = new Server();\nConnector c = new SelectChannelConnector();\n((SelectChannelConnector)connector).setAcceptors(2);\nconnector.setHost(IP);\nconnector.setPort(port);\nserver.addConnector(connector);\n\nContextHandler context1 = new ContextHandler();\ncontext.setContextPath(\"/abc\");\ncontext.setHandler(handler1);\ncontext.setAllowNullPathInfo(true);\n\nContextHandler context2 = new ContextHandler();\ncontext2.setContextPath(\"/xyz\");\ncontext2.setHandler(handler2);\ncontext2.setAllowNullPathInfo(true);\n\nContextHandlerCollection hc = new ContextHandlerCollection();\nhc.addHandler(context1);\nhc.addHandler(context2);\n\nserver.setHandler(hc);\nserver.start();\n\n\nI am also using a thread pool which is set at server level.\nWhen I send requests to one context and put load on that so that all threads are used, At that time when I send a request to the second context its taking time to process the request to 2nd context.\n\nI also tried by setting thread pool at SelectChannelConnector level and tried. \nAlso tried by adding more connectors using same host/port so that each will have its own thread pool.\n\nMy requirement is that other context (but port is same) should not delay processing when one context is under load.\n\nCan I have dedicated thread pool for each context. Is there any other work around.\nAppreciate reply to this.\n\nThanks\nSarath" ]
[ "jetty", "threadpool" ]
[ "Swift Firebase authentication not working when in another class", "I am attempting a project just for fun, I would like to use Firebase. I made a class to user for user related things. I was testing the signing up function and when it is within a class it first yields false then yields true. But when I do not place this in a separate class and place it directly in the view controller it yields true and performs the segue as indicated. Due to I not knowing how to explain this best I will show below which code works and which does not.\n\nFirebase embedded in a class:\n\n import Foundation\nimport Firebase\nclass Account {\n\n var email: String\n var password: String\n init(email: String, password: String) {\n self.email = email\n self.password = password\n\n }\n func createAccount ()-> Bool{\n var made = false\n Auth.auth().createUser(withEmail: email, password: password) { (user, error) in\n if (error == nil) {\n print(\"Registration Successful\")\n made = true\n\n }else{\n\n print(error!)\n made = false\n }\n }\n print(\"this is\\(made)\")\n return made\n\n }\n\n\nbutton code:\n\n@IBAction func signUpButton(_ sender: UIButton) {\nsignUpEmail = emailTextField.text!\nsignUpPassword = passwordTextField.text!\nlet signUp = Account(email: signUpEmail, password: signUpPassword);\nlet signUpOccur = signUp.createAccount()\nif( signUpOccur == true){\n performSegue(withIdentifier: \"signUpToHome\", sender: self)\n}else{\n print(signUpOccur)\n}}\n\n\n////this yields: \"this is false\" then \"Registration Successful\" then \"this is true\" but does not perform the Segue due to first yielding false I assume \n\ncode that works as desired:\n\n signUpEmail = emailTextField.text!\n signUpPassword = passwordTextField.text!\n Auth.auth().createUser(withEmail: signUpEmail, password: signUpPassword) { (user, error) in\n if (error == nil) {\n print(\"Registration Successful\")\n self.performSegue(withIdentifier: \"signUpTohome\", sender: self)\n }else{\n\n print(error!)\n }\n }\n\n\nIs it possible to place thing within a class and function or would it be best to just place it within the button the way it works? Or is there something I am doing wrong?\n\nThank you for all feedback" ]
[ "ios", "swift", "firebase" ]
[ "Do I need these handmade components (React.Fragment that will passthrough props and conditionnal wrapper)", "I feel I just reinvented the wheel and it might not be round, because I'm new to the React ecosystem.\n\nI have written these components :\n\nconst ForwardPropsWrapper = ({ children, ...rest }) => {\n return React.Children.map(children, child => React.cloneElement(child, rest))\n}\n\n\nNote that it just forwards its props to its children.\n\nconst ConditionalWrapper = ({ condition, children, ...rest }) => {\n return (!condition || condition(rest)) ?\n React.Children.map(children, child => React.cloneElement(child, rest))\n : null;\n}\n\n\ncondition is a function and it's passed the wrapper's props\n\nI use it with react-admin's to replace a ReferenceField inside a Datagrid with two fields combined :\n\n<Datagrid rowClick=\"edit\">\n {/*\n `Datagrid` will pass props to `ForwardPropsWrapper`\n */}\n <ForwardPropsWrapper label=\"User / Role\">\n {/*\n Both `ConditionalWrapper`s will receive props passed by `Datagrid`\n through `ForwardPropsWrapper` and call the `condition` function\n with these props as argument\n */}\n <ConditionalWrapper condition={props=>props.record.RoleId}>\n <ReferenceField source=\"RoleId\" reference=\"role\">\n <TextField source=\"name\" />\n </ReferenceField>\n </ConditionalWrapper>\n <ConditionalWrapper condition={props=>props.record.UserId}>\n <ReferenceField source=\"UserId\" reference=\"user\">\n <TextField source=\"email\" />\n </ReferenceField>\n </ConditionalWrapper>\n </ForwardPropsWrapper>\n</Datagrid>\n\n\nWhy ?\n\nForwardPropsWrapper because react-admin's Datagrid expects one child per column and passes props to it (the record). A React.Fragment is not good enough because it will swallow up the props.\n\nConditionalWrapper is explicit, I need to show either one of the two components depending on the props that Datagrid passes them. The condition needs to be evaluated with the props that are passed to the wrapped component by Datagrid so I can't use a simple ternary condition in the template.\n\nSo... I can't believe this is the way to go.\n\nIs there a way to achieve this without writing custom components ?\n\nWhat problems may I run into with the components above ?\n\nCriticism is expected please !" ]
[ "javascript", "reactjs", "react-admin" ]
[ "SQL Server Agent Job - where to find Package Source", "I am trying to figure out where an SSIS package is located for a SQL Server Agent Job.\nI have had to take over the administration with limited knowledge of SQL Server so please excuse my ignorance.\nI see two Jobs under SQL Server Agent Job in Object Explorer.\nWhen I right click on one of them and select Properties, under Job Properties, I go to \"Steps\" and see one step. I highlight the Step and select \"Edit\". Under that window, in the General section and General Tab, I see \\LoadPackagexyz under the Package field. When I click the browse button, it shows up under SSIS Packages folder tree.\n\nMy question - where do I find this \"LoadPackagexyz\" package to view its properties?" ]
[ "sql" ]
[ "port .net framework to .net core while sharing source code for backward support", "We have several different products compiled for .net framework 4.6.1. Each of these products contains several different solutions which contains many projects that are co-dependent between different solution and products. We need to port one of these products to .net core 2.0. The recommended way by Microsoft to port a .net framework project to .net core is to simply copy all the code file to a new .net core project. Since we have hundreds of projects I need to port to .net core, and at the same time these projects needs to be referenced by legacy .net framework projects, I prefer a solution that would allow me to use the same CS files and only to compile them using different .csproj files. Otherwise, it would just be impossible to maintain all of it. Logically it's not supposed to be very difficult as long as I keep the code valid in both frameworks, but I cant find a clean way to do it in Visual Studio.\nAny suggestions for the best approach to this problem?" ]
[ "c#", ".net", ".net-core" ]
[ "How to use the react-grid-gallery package in GatsbyJS?", "I would like to use this package in one of my projects, but I don't really understand how to use it.\nThis is my gallery page:\nimport React from "react";\nimport Gallery from "react-grid-gallery";\nimport {photos} from "../data/data";\nimport Layout from "../components/layout";\nimport SEO from "../components/seo";\n\n\nexport default function GalleryPage() {\n return(\n <Layout>\n <SEO title = "Activities"/>\n <div className = "font-monserrat text-red-dark text-4xl font-light"> Photos</div>\n <br/>\n <Gallery photos={photos} />\n </Layout>\n )\n}\n\n\nAnd it gives me this error:\nTypeError: Cannot read property '-1' of undefined" ]
[ "reactjs", "gatsby" ]
[ "Ggpairs barDiag with normal curve", "I am using the ggpairs from ggplot2. \n\nI need to get an histogram in the diagonal for the ggpairs, but want to superimpose the normal density curve using the mean and sd of the data. \n\nI read the help (https://www.rdocumentation.org/packages/GGally/versions/1.4.0/topics/ggpairs) but can't find an option to do it. I guess I must built my own function (myfunct) and then \n\nggpairs(sample.dat, diag=list(continuous = myfunct))\n\nHas anyone have tried this? \n\n\n\nI have tried the following: \n\nhead(data) \n x1 x2 x3 x4 x5 x6 F1 F2 \n1 -0.749 -1.57 0.408 0.961 0.777 0.171 -0.143 0.345 \n\nmyhist = function(data){ \n ggplot(data, aes(x)) + \n geom_histogram(aes(y = ..density..),colour = \"black\") + \n stat_function(fun = dnorm, args = list(mean = mean(x), sd = sd(x))) \n } \n\nggpairs(sample.data, diag=list(continuous = myhist))\n\n\nThe result is: \n\n\n Error in (function (data) : unused argument (mapping = list(~x1))" ]
[ "r", "ggplot2", "ggpairs" ]
[ "Why does Express onError handler only handle \"listen\" errors?", "The Express generator defines an onError() event handler that has this:\n\nif (error.syscall !== 'listen') throw error;\n\n\nThe syscall is described as \"a string describing the syscall that failed\", of which there are many possible types of failures (on linux, not sure what would happen on windows).\n\nSo why is only a \"listen\" error handled - surely the node app can fail for other reasons? This is part of the express generator template, I'm sure there's a good reason for it." ]
[ "node.js", "express" ]
[ "Select Record with Min value in a column and with specific value in another column", "I have a table like this:\n\nusername date place time\npaolo 1/1/2001 milan 00:10.20\nmarco 1/1/2001 milan 00:11.40\npaolo 1/1/2011 milan 00:12.20\npaolo 1/1/2004 milan 00:10.50\n\n\nI want to return the row with the lowest value of time for the username paolo:\n\npaolo 1/1/2001 milan 00:10.20\n\n\nI am trying with this query:\n\nSELECT username,date,place,MIN(time) as record\nFROM crono\nWHERE username=\"paolo\"\nGROUP BY username,date,place\n\n\nBut it doesn't give the result I want." ]
[ "php", "mysql", "sql" ]
[ "Python NameError The class of the name is not defined but it actually is", "I was playing with classes and I thought to create a class called Container which is meant to group all things that can hold other things.\n\n# -*- coding: utf-8 -*-\n\nclass Container(object):\n def __init__(self, name, volume):\n self.name = name\n self.max_volume = volume\n\nhands = Container('HANDS', 2)\n\n\nI started from this point and then I wanted to test if everything was ok but if in the python console I call hands.name it says that hands is not defined. This happens when I import it as a module too.\n\nI don't get what I am doint wrong! Can you please explain me how to make it work?\n\nI get from the python console:\n\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nNameError: name 'hands' is not defined" ]
[ "python", "class" ]
[ "Eclipse JDT: Debugging in the same IDE instance", "I'm writing an Eclipse plugin that needs to specifically make use of Workspace, Projects, Packages, Compilation Units etc. \n\nI already have a decent number of projects, packages, and compilation units in my workspace (not all related to my plugin though, but present nevertheless), which I would like to be able to use as a 'test dataset' for debugging. \n\nWhen I click the toolbar icon of my plugin, I can print to the console the names of the projects returned by this statement:\n\nIProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();\n\n\nHowever, when I launch the debugger, a new Eclipse IDE instance starts up with no projects visible in it anymore. While no project is visible, the projects array does list the project RemoteSystemTempFiles!\n\nBut this is completely useless for my debugging needs, as I need some good data set to step through during debugging.\n\nQuestion: Is there any way to make my projects existing in the development instance of the IDE appear in the second, debugging instance also? Or, if not, can I somehow debug in the same IDE instance instead of starting a second one? I would hate to litter all my code with console-log messages - it's very tedious also to write them in the first place. Setting up the existing test data in the plugin's initialization code would also be way too much work, which I would like to avoid as well." ]
[ "debugging", "eclipse-plugin", "eclipse-jdt", "projects" ]
[ "Open Source Ruby Projects", "I have just recently started to study Ruby, and in lieu of Jeff's advice over the weekend...\n\n\nStop theorizing.\nWrite lots of software.\nLearn from your mistakes. \n\n\n...I was interested in honing my skills while helping out the Open Source Community the process so I thought I'd ask if anyone have any suggestions for cool/interesting Open Source Projects written in Ruby that you know of or are involved in." ]
[ "ruby", "open-source" ]
[ "Could not initialize class exception on scala(possibly squeryl bug)", "I am developing a web application with scala 2.8.1, scalatra 2.0.0.M2, squeryl 2.8.0 and scalate 2.0.0 and sbt\n\nI am having a problem with, apparently a model or the schema class. When I run my tests I get a:\n\njava.lang.NoClassDefFoundError: Could not initialize class org.mycompany.myproject.model.myschema\n\n\nIf I try to run the following code on sbt's console-quick I get an error:\n\nimport org.mycompany.myproject.model.myschema\nmyschema.mytable\n\n\nError:\n\njava.lang.RuntimeException: Could not deduce Option[] type of field 'field1' of class org.mycompany.myproject.model.myotherclass\n\n\nAs I have expected the error pops up no matter what method I try to invoke on that schema.\n\nNow here is how my schema looks like near that table declaration:\n\nobject myschema extends Schema {\n val myotherclasses = table[myotherclass]\n val otherClassManyToMany = manyToManyRelation(yetanotherclass, mytables).\n via[myotherclass]((e,ssr, sse) => (e.id === sse.leftId, sse.rightId === ssr.id))\n...\n}\n\n\nThis is how my code table looks like:\n\nclass myotherclass(\n val rightId: Long,\n val field1: Option[Long],\n val field2: Option[Long],\n val foreiginKey: Long,\n val leftId: Long) extends KeyedEntity[CompositeKey2[Long, Long]] {\n def id ={compositeKey(sesestacao, sessensor)}\n}\n\n\nAnd finally my sql definition:\n\ncreate table telemetria.myotherclass (\n rightId numeric(8,0) references telemetria.estacao(estcodigo),\n field1 numeric(8,0),\n field2 numeric(8,0),\n foreiginKey smallint references myschema.thirdtable(idOfThird),\n leftId smallint references myschema.yetanotherclass(id),\n primary key (rightId, leftId)\n);\n\n\nI have not mapped the thirdtable into my code. What could be going on?" ]
[ "scala", "sbt", "squeryl" ]
[ "Meteor: How does javascript choose parameters add to function", "I'm making a Meteor application. In this application, I make a form allow for user to submit data. Firstly javascript is:\n\nTemplate.post_question_form.events({\n 'submit form' : function() {\n console.log(\"form submitted\");\n }\n});\n\n\nAfter that, as tutorial. I add event parameter:\n\nTemplate.post_question_form.events({\n 'submit form' : function(event) {\n console.log(\"form submitted\");\n }\n});\n\n\nEverything runs as I expected. the problem I don't know is: I'm come from Java world (strongly type language world), so I don't know how Javascript solve this. when your function's parameter is empty, javascript will called it. when your function's parameter is event, javascript will attach event object into this automatically. so how does javascript do in this case:\n\nTemplate.post_question_form.events({\n 'submit form' : function(param1, param2, param3, param4) {\n console.log(\"form submitted\");\n }\n});" ]
[ "javascript", "meteor" ]
[ "Finding pipe and redirects in perl @ARGV", "When writing a traditional Unix/Linux program perl provides the diamond operator <>. I'm trying to understand how to test if there are no argument passed at all to avoid the perl script sitting in a wait loop for STDIN when it should not.\n\n#!/usr/bin/perl\n# Reading @ARGV when pipe or redirect on the command line\nuse warnings;\nuse strict;\n\nwhile ( defined (my $line = <ARGV>)) { \n print \"$ARGV: $. $line\" if ($line =~ /eof/) ; # an example\n close(ARGV) if eof;\n}\n\nsub usage {\n print << \"END_USAGE\" ;\n Usage:\n $0 file\n $0 < file\n cat file | $0 \nEND_USAGE\n exit();\n}\n\n\nA few outputs runs shows that the <> works, but with no arguments we are hold in wait for STDIN input, which is not what I want.\n\n$ cat grab.pl | ./grab.pl\n-: 7 print \"$ARGV: $. $line\" if ($line =~ /eof/) ; # an example\n-: 8 close(ARGV) if eof;\n\n$ ./grab.pl < grab.pl\n-: 7 print \"$ARGV: $. $line\" if ($line =~ /eof/) ; # an example\n-: 8 close(ARGV) if eof;\n\n$ ./grab.pl grab.pl\ngrab.pl: 7 print \"$ARGV: $. $line\" if ($line =~ /eof/) ; # an example\ngrab.pl: 8 close(ARGV) if eof;\n\n$ ./grab.pl\n^C\n$ ./grab.pl\n[Ctrl-D]\n$\n\n\nFirst thought is to test $#ARGV which holds the number of the last argument in @ARGV. Then I added a test to above script, before the while loop like so:\n\nif ( $#ARGV < 0 ) { # initiated to -1 by perl\n usage();\n}\n\n\nThis did not produced the desired results. $#ARGV is -1 for the redirect and pipe on the command line. Running with this check (grabchk.pl) the problem changed and I can't read the file content by the <> in the pipe or redirect cases.\n\n$ ./grabchk.pl grab.pl\ngrab.pl: 7 print \"$ARGV: $. $line\" if ($line =~ /eof/) ;\ngrab.pl: 8 close(ARGV) if eof;\n\n$ ./grabchk.pl < grab.pl\n Usage:\n ./grabchk.pl file\n ./grabchk.pl < file\n cat file | ./grabchk.pl\n\n$ cat grab.pl | ./grabchk.pl\n Usage:\n ./grabchk.pl file\n ./grabchk.pl < file\n cat file | ./grabchk.pl\n\n\nIs there a better test to find all the command line parameters passed to perl by the shell?" ]
[ "perl", "pipe", "argv", "diamond-operator" ]
[ "core data adding a new field to an existing sqlite table", "I have an sqlite table that I'd like to add a new field to. Would I add the new field directly in sqlite or does the Core Data model change the sqlite table itself?\n\nI'm stuck for some reason right now w/ adding a new field to the db table. thanks for any help." ]
[ "iphone", "sqlite", "core-data" ]
[ "Is the default lodash memoize function a danger for memory leaks?", "I want to use memoize but I have a concern that the cache will grow indefinitely until sad times occur.\n\nI couldn't find anything via google/stackoverflow searches.\n\nP.S. I am using lodash v4." ]
[ "javascript", "lodash" ]
[ "General failure building bootstrapper", "while doing the build of my dontnet 4.0 project setup i'm getting following errors\n\nAn error occurred generating a bootstrapper: Unable to finish updating resource for E:\\project\\Setup\\Debug\\setup.exe with error 8007006E E:project\\Setup\\Setup.vdproj Setup\n\nGeneral failure building bootstrapper E:\\project\\Setup\\Setup.vdproj Setup\n\nUnrecoverable build error E:\\project\\\\Setup\\Setup.vdproj Setup\n\n\nI am using dotnet framework 4 and MSVS 2010." ]
[ "visual-studio-2010", ".net-4.0", "setup-project", "setup-deployment", "bootstrapper" ]
[ "Jenkins clone fails with AWS code-commit repository (status code 143)", "I have installed Jenkins in my Mac & i am trying to clone an AWS code-commit repository (URL looks like this: https://git-codecommit.us-east-1.amazonaws.com/v5/repos/testRepo). \n\nThe repository is only a few MB which can be cloned using terminal using git clone command but Jenkins throws the following error \n\nERROR: Timeout after 10 minutes\nERROR: Error fetching remote repo 'origin'\nhudson.plugins.git.GitException: Failed to fetch from https://git-codecommit.us-east-1.amazonaws.com/v5/repos/testRepo\nat hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888)\n at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155)\n at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)\n at hudson.scm.SCM.checkout(SCM.java:504)\n at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)\n at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)\n at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)\n at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)\n at hudson.model.Run.execute(Run.java:1810)\n at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)\n at hudson.model.ResourceController.execute(ResourceController.java:97)\n at hudson.model.Executor.run(Executor.java:429)\nCaused by: hudson.plugins.git.GitException: Command \"git fetch --tags --progress https://git-codecommit.us-east-1.amazonaws.com/v5/repos/testRepo +refs/heads/*:refs/remotes/origin/*\" returned status code 143:\nstdout: \nstderr: \n at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)\n at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)\n at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)\n at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)\n at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:886)\n ... 11 more\nERROR: Error fetching remote repo 'origin'\nFinished: FAILURE\n\n\nI have also increased the timing to 30 mins but no luck. I expect Jenkins to clone the repository without any error.\n\nAny help is highly appreciated." ]
[ "git", "amazon-web-services", "jenkins", "aws-codecommit" ]
[ "Render topojson mesh in D3 as distinct paths", "I have code like:\n\nd3.json(\"topo-census-regions.json\", function(error, topoJ) {\n g.append(\"path\")\n .datum(topojson.mesh(topoJ, topoJ.objects.divis, function(a, b) { return a !== b; }))\n .attr(\"class\", \"division-borders\")\n .attr(\"d\", path);\n});\n\n\nIt works, basically. (This is pretty much straight from Bostock's zoom demo, just using a different source file.)\n\nMy problem is that the boundaries between census regions render out as a single SVG path. TopoJson's mesh method collapses all shared internal boundaries into a single compound path. But I need to render different parts of the path with different styles.\n\nFor a visual reference, see this.\n\nThe boundary between \"Pacific\" and \"Mountain\" within the \"Western\" division should be one path element, the boundary between \"West North Central\" and \"East North Central\" should be another, etc. I could manufacture these paths manually in Illustrator fairly easily but need to be able to do this programmatically across a large data set. I want the efficient de-duplication that mesh performs, but with continuous segments as separate elements.\n\nThanks in advance for any help." ]
[ "javascript", "d3.js", "svg", "topojson" ]
[ "Debug sent headers by FormRequest.from_response", "Scrapy has great debugging feature. However I not able to find way to debug the headers, get, post param sent by FormRequest.from_response \n\nIs there any way, I can see those post data? I am particularly concern if it send values from hidden field." ]
[ "python", "web-scraping", "scrapy" ]
[ "Center the content and float inside", "I am confused about float: I have a div menu with 2 items inside. I center it with margin 0 auto. If I put blue and red in float is not centered anymore and gets out of content. I do not understand why? \n\nHere is the example: http://jsfiddle.net/A4FHd/\n\nCSS:\n\n#content{\n margin:0 auto;\n width:400px;\n background:yellow;\n}\n\n#text{\n margin:0 auto;\n text-align:justify;\n}\n\n#menu{\n margin:0 auto;\n z-index:0;\n background:grey;\n}\n\n#blue{\n float:left;\n width:50px; height:50px;\n z-index:0;\n background:blue;\n}\n#red{\n float:left;\n width:50px; height:50px;\n z-index:0;\n background:red;\n}\n\n\nHTML:\n\n<div id=\"content\">\n\n <div id=\"text\"> \n some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text \n </div>\n\n <div id=\"menu\"> \n <div id=\"red\"> </div>\n <div id=\"blue\"> </div>\n </div>\n\n</div>" ]
[ "css", "css-float" ]
[ "Display Tow Array Adapter", "I want to display \n\nArrayAdapter<com.example.database.Sms>adapter = new SmsAdapter(this, smss);\n\n\nand \n\nArrayAdapter<com.example.database2.part1> adapter = new DastanAdapter(this, part1);\n\n\nBut according to my code it shows just one of them but I want to have both of them shown \n\npublic void refreshDisplay() {\n Log.i(com.example.database.DBAdapter.TAG, smss.size() + \"= tedad smss\");\n ArrayAdapter<com.example.database.Sms>adapter = new SmsAdapter(this, smss);\n setListAdapter(adapter);\n}\n\npublic void refreshDisplay2() {\n Log.i(DBAdapter.TAG, part1.size() + \"= tedad part1\");\n ArrayAdapter<com.example.database2.part1> adapter = new DastanAdapter(this, part1);\n setListAdapter(adapter);\n}" ]
[ "android-arrayadapter" ]