texts
sequence | tags
sequence |
---|---|
[
"Python Count Items in Dictionary",
"I would like to count part of speech tags. So far I have the part of speech tags (for German) stored in a dictionary, where the key the POS-tag is, and the value the number of occurrences is. \n\nWhen I count, I want to summarize 'NN' and 'NE' as one variable 'nouns_in_text', because both of them are nouns. I did this partially successfully. When I have an input-text in which I have both 'NN' and 'NE', in this case my code is working, and I get the correct result, meaning the sum of 'NN' and 'NE'.\n\nBut the problem is, when I have an input text, which for example has only 'NN' and no 'NE', then I get a KeyError.\n\nI need the code to look if there are 'NN' or 'NE' in the input-text. If there are 'NN' and 'NE', then sum them up. If there is only 'NN' then return just the number of occurrences for 'NN', and the same if there is only 'NE'. In case there is neither 'NN' nor 'NE' return 0 or \"None\".\n\nI would like a Code, that would work for all three in the following described scenarios, without getting an Error.\n\n# First Scenario: NN and NE are in the Input-Text\nmyInput = {'NN': 3, 'NE': 1, 'ART': 1, 'KON': 1}\n\n# Second Scenario: Only NN is in the Input-Text\n#myInput = {'NN': 3, 'ART': 1, 'KON': 1}\n\n# Third Scenario: Neither NN nor NE are in the Input-Text\n#myInput = {'ART': 1, 'KON': 1}\n\ndef check_pos_tag(document):\n return document['NN'] + document['NE']\n\nnouns_in_text = check_pos_tag(myInput)\nprint(nouns_in_text)\n\n# Output = If NN and NE are in the input text I get 4 as result\n# But, if NN or NE are not in the input text I get a KeyError\n\n\nI think I could or should solve this problem with if-else conditions or with try-except blocks. But I'm not sure how to realize this ideas... Any suggestions? Thank you very much in advance! :-)"
] | [
"python",
"dictionary",
"if-statement",
"count",
"try-except"
] |
[
"Doctrine2 How to check if there is the related record in",
"I have a bidirectional many-to-many between theese two entities:\n\nPosition\n\n/**\n* Position\n*\n* @ORM\\Table(name=\"applypie_position\")\n* @ORM\\Entity(repositoryClass=\"Applypie\\Bundle\\PositionBundle\\Entity\\PositionRepository\")\n*/\nclass Position\n{\n\nconst IS_ACTIVE = true;\n\n/**\n * @var integer\n *\n * @ORM\\Column(name=\"id\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"AUTO\")\n */\nprivate $id;\n\n/**\n * @ORM\\ManyToMany(targetEntity=\"Applypie\\Bundle\\UserBundle\\Entity\\Applicant\", mappedBy=\"bookmarks\")\n */\nprivate $bookmarkedApplicants;\n\n\nApplicant\n\n/**\n * Applicant\n *\n * @ORM\\Table(name=\"applypie_applicant\")\n * @ORM\\Entity\n */\nclass Applicant\n{\n/**\n * @var integer\n *\n * @ORM\\Column(name=\"id\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"AUTO\")\n */\nprivate $id;\n\n/**\n * @ORM\\ManyToMany(targetEntity=\"Applypie\\Bundle\\PositionBundle\\Entity\\Position\", inversedBy=\"bookmarkedApplicants\")\n * @ORM\\JoinTable(name=\"applypie_user_job_bookmarks\",\n * joinColumns={@ORM\\JoinColumn(name=\"applicant_id\", referencedColumnName=\"id\")},\n * inverseJoinColumns={@ORM\\JoinColumn(name=\"position_id\", referencedColumnName=\"id\")}\n * )\n */\nprivate $bookmarks;\n\n\nMy Problem is: In an PositionControllers Action which easily shows an position by ID i need to know if there the current Applicant whichs wants to see the position has an bookmark for the current position.\n\nI first thought of get all the Bookmarks with $applicant->getBookmarks() and run in within a forearch, checking all the applicants bookmarks against the current position, but i think there must be an easier way?\n\nthank you"
] | [
"symfony",
"doctrine-orm",
"many-to-many"
] |
[
"Onchange AJAX for textarea not working in Safari",
"I have an AJAX function that works just fine when I'm on my PC. But when I switch to Safari (mobile), only the radio-boxes will trigger the AJAX. How come?\n\nHTML:\n\n<input type=\"radio\" id=\"q1r1\" name=\"q1\" value=\"Awesome\" onchange=\"GrabData(this)\">\n<input type=\"radio\" id=\"q1r3\" name=\"q1\" value=\"Awful\" onchange=\"GrabData(this)\">\n\n<div class=\"comment\"><textarea name='q1comment' id='comment' maxlength=\"400\" placeholder=\"Add a comment (max 400 characters)\" onchange=\"GrabC(this)\"></textarea>\n\n\nAJAX\n\n//AJAX question 1.\n function GrabData(Passeddata){\n var radioValue = Passeddata.value;\n var URL = \"question1.php?q1=\" + radioValue + \"&teamid=\" + <?php echo $teamid; ?>; \n $.ajax( {\n url : URL,\n type : \"GET\",\n dataType: 'json',\n success : function(data) {\n if (data == \"\") {\n alert(\"data is empty\");\n } else {\n console.log('got your data back sir');\n }\n }\n });\n };\n//AJAX for comment question 1.\n function GrabC(PassedComment){\n var radioValue = PassedComment.value;\n var URL = \"question1.php?comment1=\" + radioValue + \"&teamid=\" + <?php echo $teamid; ?>; \n $.ajax( {\n url : URL,\n type : \"GET\",\n dataType: 'json',\n success : function(data) {\n if (data == \"\") {\n alert(\"data is empty\");\n } else {\n console.log('got your data back sir');\n }\n }\n });\n };\n\n\nAgain, works fine on my PC, the textarea onchange does not seems to work on Safari on the mobile. Can't figure out why!"
] | [
"javascript",
"jquery",
"html",
"ajax",
"safari"
] |
[
"How to save the value of INPUT in variable?",
"How to save the value of INPUT in variable to not to write a lot of duplicate code?\n\nlike var input = $(this).val();\n\nfull example\n\n<div id=\"form\">\n 1. <input type=\"text\" value=\"title\" />\n 2. <input type=\"text\" value=\"value\" />\n</div>\n\n$(function(){\n $('#form input:eq(0)').bind({\n focus: function(){\n if($(this).val()=='title'){\n $(this).val('');\n }\n },\n blur: function(){\n if($(this).val() == ''){\n $(this).val('title');\n }\n }\n });\n\n $('#form input:eq(1)').bind({\n focus: function(){\n if($(this).val()=='value'){\n $(this).val('');\n }\n },\n blur: function(){\n if($(this).val() == ''){\n $(this).val('value');\n }\n }\n });\n});"
] | [
"javascript",
"jquery",
"input"
] |
[
"Why this selector doesn't work in jQuery?",
"I made a filter function if user enters any text, this function finds the rows in the table that has that text. This code is working but has a bug. That is, if someone wants to search for text 'edit' or 'delete' every rows are displayed because all the table row has 'Edit' and' Delete' button. So I want to use Selector to not search those buttons. \n\nI tried .filter, tr.can_filter etc.. many selectors in this3. Ain't works ; (\n\n// In real code, this1, 2, 3 written as 'this'. just for recognition. \nfunction filterItem(self){\n $(\"#myInput\").on(\"keyup\", function(){\n var value = $(this1).val().toLowerCase();\n $(\"#myTable tr\").filter(function() { \n return $(this2).toggle($(this3).text().toLowerCase().indexOf(value) > -1);\n });\n });\n}\n\n\n// index.blade.php file\n <tbody id=\"myTable\">\n @foreach($detail as $event)\n @php\n $datas = $event->participants->pluck('date', 'name');\n $array = JSON_decode($datas, true);\n $string = implode(\":\\n\", array_keys($array)).\"\\n\".implode(\"\\n\", $array);\n @endphp\n <tr>\n <td class=\"can_filter\">{{ $event->id }}</td>\n <td class=\"can_filter\">{{ $event->your_name }}</td>\n <td class=\"can_filter\">{{ $event->email }}</td>\n <td class=\"can_filter\"><a href=\"{{ route('participants.create', $event->id) }}\"\n data-toggle=\"popover\"\n title=\"{{ print_r($array) }}\n \"> {{ $event->title }} </a></td>\n <td class=\"can_filter\">{{ $event->location }}</td>\n <td class=\"can_filter\">{{ $event->description }}</td>\n <td class=\"can_filter\">{{ $event->date }}</td>\n <td>\n <a href=\"{{ route('events.edit', $event) }}\" class=\"btn btn-primary\">Edit</a>\n </td>\n <td>\n <form action=\"{{ route('events.destroy', $event->id) }}\" method=\"post\">\n @csrf\n @method('DELETE')\n <button class=\"btn btn-danger\" type=\"submit\" name=\"btn\">Delete</button>\n </form>\n </td>\n </tr>\n @endforeach\n </tbody>\n </table>\n\n\nSo what I expected is by $(\"#myTable tr\").filter(function() { I'm filtering table rows, and this2 turns on/off each row. and this3 decides what to compare. I think it's comparing this3=row == value so I'm trying change this3 to .can_filter or add return $(this).toggle($(this).has('.btn').length < 1 ? true : $(this).toggle(this).text().toLowerCase().indexOf(value) > -1); so that I can except button from being searched. which is not working."
] | [
"jquery"
] |
[
"Ubuntu cron shebang not working",
"I have a script with this as the shebang #!/usr/bin/env node.\n\nWhen cron runs my script, I get this error /usr/bin/env: node: No such file or directory.\n\nWhen i run the script as my user the script runs fine, just not as cron. I'm guessing it's because node is not on the PATH of the user that runs cron?\n\nHow can I get this shebang to work with cron?\n\n$ which node gives me\n/home/myuser/.nvm/v0.11.14/bin/node"
] | [
"linux",
"node.js",
"ubuntu",
"cron",
"ubuntu-14.04"
] |
[
"karate | xml post method exeuction",
"I’m having issue with xml post request where post method is not executed. When I try to post same request body in post man it worked.My test is success with 200 but actual request is not executed.\nPlease let me know if I’m missing\n\nTo pass the request body,I’m calling through java object and payload is correctly constructed and printed.In execution test is success and doesn’t print response.But actually test is not executed.\nOnly headers are printed.\n\n***************** create-user.feature***************** \n\nFeature: create ims user for provided country\n Requires country code, \n\nBackground:\n\n# load secrets from json\n* def createuser = Java.type('com.user.JavaTestData')\n* def create = createuser.createUser(\"US\")\n\n\nScenario: get service token\n\nGiven url imscreateuserurl\nAnd request create\nWhen method post\nThen status 200\n* print response\n***************** create-user.feature***************** \n\n\n\nHere is java class \n\npublic class JavaTestData {\n\n private static final Logger logger = LoggerFactory.getLogger(JavaTestData.class);\n\n public static String createUser(String countryCodeInput) {\n logger.debug(\"create user for country code input\", countryCodeInput);"
] | [
"karate"
] |
[
"Vuejs how to change element content using innerHtml",
"Hello there I would like to know how can I change the <h3 id=\"score\"> innerHtml when the button is clicked.\n\n\n\nIn Vanilla Javascript I can access the element with:\n\nconst score = document.querySelector('#score');\n\nand change it by doing this:\n\nscore.innerHtml = \"13\";\n\nsomething like that.\n\n<template>\n <div id=\"scoreboard\">\n <h4>{{header_my}}</h4>\n <button v-on:click=\"changeH3()\">Change</button>\n <h3 id=\"score\">0</h3>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"scoreboard\",\n data() {\n return {\n header_my: \"Hello Wolrd\"\n };\n },\n methods: {\n changeH3() {\n const h3 = document.querySelector(\"#score\");\n h3.innerHtml = \"12\";\n }\n }\n};\n</script>\n\n\nHow can I do this, when changeH3 is called? The innerHtml of h3 with id of score must change to 12."
] | [
"javascript",
"vue.js",
"vuejs2",
"vue-cli-3"
] |
[
"Hide and show div with links",
"So I have this code that I will put in jsfiddle link bellow. Im making hide/show divs by clicking on links. Only problem is when I want to view a div (second, third or fourth div), lets say the third one, it doesnt show up on top but benith the first and second invisible divs. Anybody got any idea how to make this right and put any selected div on the top of the page?\n\n<body>\n <div class=\"col-md-2\">\n <ul class=\"nav nav-pills nav-stacked\" id=\"menu\">\n <li><a href=\"javascript:show('link1')\" id=\"link1\">Felge</a></li>\n <li><a href=\"javascript:show('link2')\" id=\"link2\">Gume</a></li>\n <li><a href=\"javascript:show('link3')\" id=\"link3\">Branici</a></li>\n <li><a href=\"javascript:show('link4')\" id=\"link4\">Farovi</a></li>\n </ul>\n </div>\n\n <div class=\"col-md-3\">\n <div class=\"div\" id=\"content1\">\n <p>BBS</p>\n <p>ENKEI</p>\n <p>KONIG</p>\n </div>\n\n <div class=\"div\" id=\"content2\">\n <p>Michelin</p>\n <p>Hankook</p>\n <p>Sava</p>\n </div>\n\n <div class=\"div\" id=\"content3\">\n <p>AMG</p>\n <p>Brabus</p>\n <p>Original</p>\n </div>\n\n <div class=\"div\" id=\"content4\">\n <p>Angel Eyes</p>\n <p>Devil Eyes</p>\n <p>Original</p>\n </div>\n </div>\n\n\n\n\n`<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-latest.js\"></script>\n\n\n \n\n\n\nfunction show(id) {\n\n if (id == 'link1') {\n document.getElementById(\"content1\").style.visibility = 'visible';\n document.getElementById(\"content2\").style.visibility = 'hidden';\n document.getElementById(\"content3\").style.visibility = 'hidden';\n document.getElementById(\"content4\").style.visibility = 'hidden';\n }\n else if (id == 'link2') {\n document.getElementById(\"content1\").style.visibility = 'hidden';\n document.getElementById(\"content2\").style.visibility = 'visible';\n document.getElementById(\"content3\").style.visibility = 'hidden';\n document.getElementById(\"content4\").style.visibility = 'hidden';\n }\n else if (id == 'link3') {\n document.getElementById(\"content1\").style.visibility = 'hidden';\n document.getElementById(\"content2\").style.visibility = 'hidden';\n document.getElementById(\"content3\").style.visibility = 'visible';\n document.getElementById(\"content4\").style.visibility = 'hidden';\n }\n else if (id == 'link4') {\n document.getElementById(\"content1\").style.visibility = 'hidden';\n document.getElementById(\"content2\").style.visibility = 'hidden';\n document.getElementById(\"content3\").style.visibility = 'hidden';\n document.getElementById(\"content4\").style.visibility = 'visible';\n }\n}\n\nfunction init() {\n\n var divs = document.getElementsByTagName(\"div\");\n for (i = 0; i < divs.length; i++) {\n if (divs[i].className == \"div\") {\n divs[i].style.visibility = 'hidden';\n }\n }\n var a = document.getElementsByTagName(\"a\");\n a.onclick = show;\n}\n\nwindow.onload = init;\n\n\n`\n\nhttps://jsfiddle.net/4qq6xnfr/"
] | [
"javascript",
"jquery",
"html",
"css"
] |
[
"Insert query where table name is textbox text",
"I have a problem in button1 click event of inserting data into a table which table name be determined by whatever text is in textbox1\n\nShould mean something like that:\n\ntablename = textbox1.text;\n\nsql = \"INSERT INTO tablename ([itemserial], [itemname], [itemcount],[itemimage]) VALUES (@itemserial, @itemname, @itemcount, @itemimage)\";"
] | [
"c#",
"sql",
"textbox"
] |
[
"global variables in Python using in multiple routes/pages",
"Hi I'm wondering if it's possible to use a global variable between routes (I'm using flask)\n\nBasically I have one page/route that loads multiple choice questions and stores the correct answer in a variable answer, and I want another route to use that answer variable. \n\nI tried creating a global variable and then assigning it to the value of the answer inside the first route, but I can't get it to work.\n\nHere's the relevant code --\n\nglobal glob_answer\nglob_answer = \"Answer\" # initialized to this value for testing (I get nothing)\n\[email protected]('/quiz')\ndef quiz():\n cursor = g.conn.execute(\"select actor_name, categ, a_name, year, title from win_actor order by random() limit 1\")\n\n c_names = []\n category = \"\"\n alias = \"\"\n year = \"\"\n title = \"\"\n for name in cursor:\n c_names.append(name[0]) # can also be accessed using result[0]\n\n#SETTING GLOBAL VARIABLE EQUAL TO ANSWER\n answer = name[0]\n glob_answer = answer\n category = name[1]\n year = str(name[3])\n title = name[4]\n cursor2 = g.conn.execute(\"select alias from awards where a_name = \" + \"'\" + name[2] + \"'\" + \" limit 1\")\n for columns in cursor2:\n alias = columns[0]\n cursor2.close()\n cursor.close()\n cursor = g.conn.execute(\"select * from actor limit 4\")\n for name in cursor:\n if name[0] not in c_names:\n c_names.append(name[0]) # can also be accessed using result[0]\n cursor.close()\n shuffle(c_names)\n context = dict(data = c_names, categ = category, award_name = alias, year = year, title = title, answer = answer)\n return render_template(\"quiz.html\", **context)\n\n#Second Route\[email protected]('/answer')\ndef answer():\n#TRYING TO PASS VALUE TO NEW LOCAL VARIABLE\n global glob_answer \n answer = glob_answer \n return render_template(\"answer.html\")\n\n\nWhen I display the 'answer' variable in my html, nothing shows up"
] | [
"python",
"flask",
"routes",
"global-variables"
] |
[
"Typescript disable all elements within specific ID that has a class",
"I have a function that is toggling the enabled / disabled statuses of input fields within a div. This div has a unique ID and the div contains inputs that have the same class name.\n\nconst el = document.getElementById('slice_' + slice).getElementsByClassName('shiftSlice');\n for (let i = 0; i < el.length; i++) { \n el[i].disabled = true;\n }\n\n\nWhen I try this, typescript is telling me that [ts] Property 'disabled' does not exist on type 'Element'.\n\n\nDo I need to cast this element in some way to be able to access the disabled property?"
] | [
"javascript",
"typescript"
] |
[
"Angular8: Run oninit or onchanges for components referenced in response text",
"I have MathJacks loaded and working when the text is put into a template. But I am retrieving a large body of text from the server. This text is in HTML as it is heavily parsed and setup on the server. \n\n(FYI I'm using the sanitizer on the returned content, bypassSecurityTrustHtml. I have tried without sanitizing and get the same result.)\n\nUsing the inspector I can confirm the code is there in the DOM:\n<mathjax [content]=\"$a = {\\frac{v-u}{t}} $\" class=\"box\"></mathjax>\n\nI have fed the equation text via both variable and static text in the template as a text and it works on initial load.\n\nThe only thing I can figure is that the component isn't being interpreted as its not native to the template and is injected after the server call resolves. \n\nHow can I run the initialisation or onchanged function for the components once they have been injected?\n\nThank you"
] | [
"angular",
"ngoninit",
"ngonchanges"
] |
[
"Designing app that use node editor approach",
"By Node Graph app I mean, something like: Blender's Node Editor, Unity Shader Graph, https://www.draw.io/\n\nI want to develop app to design and simulate logic gate (Something like https://academo.org/demos/logic-gate-simulator/ https://sciencedemos.org.uk/logic_gates.php https://simulator.io/), how do I approach such goal?\n\nWhat framework should I use, is there an open source example, or some reading material"
] | [
"graph"
] |
[
"XSLT: Copy a node of XML and change namespace",
"I need copy a node of XML, remove all prefix namespaces and change the namespace, below the an example of the \"orignal\" XML and the expected outcome.\n\nOriginal:\n\n\r\n\r\n<service:Body xmlns:service=\"xxx.yyy.zzz\" xmlns:schema=\"aaa.bbb.ccc\">\r\n <schema:MAIN>\r\n <schema:Message>\r\n <schema:XXXXX0>\r\n <schema:XXXXX010>XXXXX0</schema:XXXXX010>\r\n <schema:XXXXX020>I</schema:XXXXX020>\r\n <schema:XXXXX030>8888</schema:XXXXX030>\r\n <schema:XXXXX040>08</schema:XXXXX040>\r\n <schema:XXXXX050>0002</schema:XXXXX050>\r\n <schema:XXXXX060>01</schema:XXXXX060>\r\n <schema:XXXXX090>00</schema:XXXXX090>\r\n <schema:XXXXX100>20190830122000</schema:XXXXX100>\r\n <schema:XXXXX110>1.0</schema:XXXXX110>\r\n <schema:XXXXX120>A</schema:XXXXX120>\r\n <schema:XXXXX130>AAA</schema:XXXXX130>\r\n <schema:XXXXX140>1</schema:XXXXX140>\r\n <schema:XXXXX150>PTT</schema:XXXXX150>\r\n </schema:XXXXX0>\r\n </schema:Message>\r\n </schema:MAIN>\r\n</service:Body>\r\n\r\n\r\n\n\nExpected outcome\n\n\r\n\r\n<ns0:Message xmlns:ns0=\"hhh.kkk.yyy\">\r\n <XXXXX0>\r\n <XXXXX010>XXXXX0</XXXXX010>\r\n <XXXXX020>I</XXXXX020>\r\n <XXXXX030>8888</XXXXX030>\r\n <XXXXX040>08</XXXXX040>\r\n <XXXXX050>0002</XXXXX050>\r\n <XXXXX060>01</XXXXX060>\r\n <XXXXX090>00</XXXXX090>\r\n <XXXXX100>20190830122000</XXXXX100>\r\n <XXXXX110>1.0</XXXXX110>\r\n <XXXXX120>A</XXXXX120>\r\n <XXXXX130>AAA</XXXXX130>\r\n <XXXXX140>1</XXXXX140>\r\n <XXXXX150>PTT</XXXXX150>\r\n </XXXXX0>\r\n</ns0:Message>"
] | [
"xml",
"xslt",
"xslt-1.0",
"xslt-2.0"
] |
[
"Loop through categories in a column and perform interpolation on only those records",
"I have a data frame, with sampling locations.\nI would like to select data for each unique species, so loop through all the unique species names, and create an interpolated layer for each species. Then name the result by species name. The interpolation part is working fine….I just can’t figure out how to loop through each species name and do the naming…..\nI've pasted the working code below for selecting one species name and creating an interpolated layer.\n\n SP_NAME sno swgt latdd londd\n1 ILLEX ILLECEBROSUS 33.7542857 2.94582857 43.28667 -60.99367\n2 CHLOROPHTHALMUS AGASSIZI 13.2971429 0.09205714 43.28667 -60.99367\n3 ILLEX ILLECEBROSUS 0.9657143 0.16417143 43.94750 -58.72417\n4 ZOARCES AMERICANUS 0.9657143 0.02897143 43.94750 -58.72417\n5 AMBLYRAJA RADIATA 2.0457143 1.00240000 43.86483 -59.19717\n6 MYOXOCEPHALUS OCTODECEMSPINOSUS 1.0228571 0.10228571 43.86483 -59.19717\n\n\nsetwd(\"C:/Michelle/Michelle/R/WCTS/Boundaries\")\nstrata <- readOGR(\".\", \"SurveyStrataWGS84\")\nstrata<-spTransform(strata,CRS(\"+proj=utm +zone=20 ellps=WGS84\"))\n\nes_tows1 <- es_tows[which(es_tows$SP_NAME == \"HIPPOGLOSSOIDES PLATESSOIDES\"),]\n\next = extent(strata)\nrb <- raster(ext, ncol=554, nrow=279)\nstratar <- rasterize(strata, rb)\nplot(stratar)\nidw.grid<- rasterToPoints(stratar, spatial=TRUE)\ngridded(idw.grid) <- TRUE\nproj4string(es_tows1) <- CRS(\"+proj=utm +zone=20 ellps=WGS84\")\n\nidw(log(es_tows1$swgt+ 0.00001) ~1 , es_tows1, idw.grid)\n\npal <- colorRampPalette(rev(brewer.pal(11, \"Spectral\")))(100)\nspplot(idw.out, \"var1.pred\", col.regions=pal)"
] | [
"r",
"loops",
"gis",
"interpolation"
] |
[
"iOS Local Notifications vs Remote",
"I am currently working on an app which has a \"Blog-reader\" section. I want to send notifications whenever there is a new post in the backend which is set up using Firebase. \n\nAt this point I have setup the remote notifications in AppDelegate and everything works just fine with a few caveats: \n\nThe app does not have a authentication / user profiles so whenever I receive a notification from Firebase with a badge payload set to \"1\" the app always displays 1 badge regardless of how many new posts are there. I have really no idea how to store somehow the badges locally and then append the count whenever there is a new notification. \n\nGiven the knowledge-related issue above I was thinking of using local notifications and displaying badges based on the count of how many items posts objects array has in it and compare it to the previous stored value. \n\nI have a gut feeling that this might not be the best solution at all, unfortunately this is my first ever iOS / Swift project (and real app ever built). \n\nSo, in a nutshell, does anyone have any suggestions if my proposed local notifications approach is a good idea, otherwise how do I handle the \"badge count\" from Firebae if I do not have user profiles? \n\nThanks in advance for any help! \n\nBest regards, \n\nSebastian"
] | [
"ios",
"swift3",
"push-notification"
] |
[
"Probabilty that a document is relevant than the other base on number of keyword",
"I have 2 documents X and Y. If a user searches for the word \"Computer\" and I want to display the most relevant document base on the keyword \"Computer\". My algorithm chooses the most relevant document base on the number of time the keyword appears in the document. The only problem is document X has 10 words with the word \"Computer\" appearing twice while document Y has 1000 words with the word \"Computer\" appearing 100 times. It is not right to say that document Y is more relevant than document X looking at the number of words in them.\n\nHow do I normalize this to get the most accurate relevant document."
] | [
"statistics",
"probability"
] |
[
"quick sort an Array of characters (string) C programming",
"I have a character array\n\nchar word[30]; \n\n\nthat keeps a word that the user will input and I want to sort the letters\nfor example if the word is \"cat\"\nI want it to make it a \"act\"\nI suppose is rather easy task but as a beginner in C programming i find the examples on the internet rather confusing.\n\nThis is my code trying to do the bubble sort...\n\nStill doesn't work\n\n#include <stdio.h>\n#include<string.h>\n\n#define MAX_STRING_LEN 30\n\nmain()\n{\nchar w1[30], w2[30];\nchar tempw1[30], tempw2[30];\nint n,i,k;\nchar temp; \n printf(\"Give the first word: \");\n scanf(\"%s\",&w1);\n printf(\"Give the second word: \");\n scanf(\"%s\",&w2);\n if(strlen(w1)==strlen(w2)) /* checks if words has the same length */\n {\n strcpy(tempw1,w1); /*antigrafei to wi string sto tempw1 */ \n strcpy(tempw2,w2); /*antigrafei to w2 string sto tempw2 */ \n n=strlen(w1);\n\n\n for (i=1; i<n-1; i++)\n {\n for (k=n;k>i+1;k--)\n {\n if (w1[k] < w1[k-1])\n {\n temp=w1[k-1];\n w1[k-1]=w1[k];\n w1[k]=temp;\n }\n }\n }\n for (i=1; i<n-1; i++)\n {\n for (k=n;k>i+1;k--)\n {\n if (w2[k] < w2[k-1])\n {\n temp=w2[k-1];\n w2[k-1]=w2[k];\n w2[k]=temp;\n }\n }\n } \n printf(\"%s \\n\",tempw1);\n printf(\"%s \\n\",w1);\n printf(\"%s \\n\",tempw2);\n printf(\"%s \\n\",w2);\n /* call qsort */\n /* call compare */\n }\n else printf(\" \\n H lexh %s den einai anagrammatismos tis lexhs %s\",w1,w2);\n return 0;St"
] | [
"c",
"arrays",
"character",
"short"
] |
[
"How to extract data from dynamic collapsing table with hidden elements using Selenium in Python",
"I try to scrape these 20 classifications from https://patents.google.com/patent/JP2009517369A/en?oq=JP2009517369, from which the first is displayed and the others are hidden in an expandable section.\n\nI already tried to get the first visible one with\n\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support import expected_conditions as EC\n\nWebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, \"//div[@class='style-scope classification-tree' and not(@hidden)]/state-modifier[@class='code style-scope classification-tree']/a[@class='style-scope state-modifier']\"))).get_attribute(\"innerHTML\") \n\n\nHowever, it raises an exception and I don't know why. So I figured that scraping the whole table would be easier but most of the elements are folded. \n\nIs there any approach on how to scrape dynamic hidden tables?\nThank you for your help!"
] | [
"python",
"selenium",
"selenium-chromedriver"
] |
[
"How to apply pattern in conditional if else?",
"My goal is to avoid using Else as I always do in Javascript code\n\nIn the example below, is there a solution?\n\npublic void initView() {\n ContextCompat.startForegroundService(this, new Intent(MainActivity.this, ViewService.class));\n\n finish();\n}\n\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CODE_DRAW_OVER_OTHER_APP_PERMISSION) {\n if (resultCode == RESULT_OK) {\n initView();\n } else {\n Toast.makeText(this, \"Permission not available\", Toast.LENGTH_SHORT).show();\n finish();\n }\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n}"
] | [
"java",
"design-patterns",
"conditional-statements"
] |
[
"React Native - Failed to build DependencyGraph:Cannot read property 'root' of null",
"I'm trying to get React Native to run their hello world app (AwesomeProject) for the first time, and I'm getting this error in the console:\n\nFailed to build DependencyGraph: Cannot read property 'root' of null\nTypeError: Cannot read property 'root' of null\n at index.js:16:60\n at tryCallOne (/Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/promise/lib/core.js:37:12)\n at /Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/promise/lib/core.js:123:15\n at flush (/Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/asap/raw.js:50:29)\n at _combinedTickCallback (node.js:370:9)\n at process._tickCallback (node.js:401:11)\n~\nProcess terminated. Press <enter> to close the window\n\nFirst of all I'm a mobile developer (native ios and android) and I know squad about node.\n\nI followed the Getting Started page of React Native, got npm installed with npm install and npm install -g\n\nWhen I try to start the node server alone, with node server I get this:\n\n$ node server\nmodule.js:341\nthrow err;\n^\n\nError: Cannot find module '/Users/Eduardo/Documents/Code/Personal /ReactNative/AwesomeProject/server'\nat Function.Module._resolveFilename (module.js:339:15)\nat Function.Module._load (module.js:290:25)\nat Function.Module.runMain (module.js:447:10)\nat startup (node.js:141:18)\nat node.js:933:3`\n\n\nHere's a screenshot of what I get in the iOS emulator, and the console when trying to run the app:\n\n\n\nFor what's worth, I'm running this on a Mac OS 10.10.5 with Xcode 7.2, and NativeScript creates a simple app without issues.\n\nAny suggestions on what to do on this?\n\nI currently just want to get my feet wet with React Native.\nThanks!"
] | [
"ios",
"node.js",
"npm",
"react-native"
] |
[
"Print sets of lines from multiple folders as rows, not columns?",
"I have .out files in multiple folders. \n\nLet's say I am in a directory containing folders A, B, C, D. I use the command below to print a specific value from the 8th column of lines containing the keyword VALUE in all .out files in folders A, B, C, D \n\nawk '/VALUE/{print $8}' ./*/.out\n\n\nMy result would look like: \n\noutput1_A\noutput2_A\noutput3_A\n\noutput1_B\noutput2_B\noutput3_B\n\noutput1_C\noutput2_C\noutput3_C \n\n\nIs there a way I could get my output to look like what is shown below instead?\n\noutput1_A output2_A output3_A \noutput1_B output2_B output3_B \noutput1_C output2_C output3_C \n\n\nIn other words, have a space separate outputs from the same folder, and not a linebreak?"
] | [
"unix",
"awk"
] |
[
"Groovy NullPointerException on \"gradle appRun\"",
"I am trying to run the plain Java Auth0 starter which is a gradle app started with ./gradlew clean appRun.\n\nI'm receiving the error which is certainly groovy related:\n\nException in thread \"main\" java.lang.NullPointerException: Cannot invoke method getText() on null object\n at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)\n at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)\n at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\n at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)\n at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\n\n\nBefore this I've received the warnings:\n\nWARNING: An illegal reflective access operation has occurred\nWARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/xijinping/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.11/52a60df8b4cbfe39469171a42ca77a3e4eb4e737/groovy-2.4.11.jar) to method java.lang.Object.finalize()\nWARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass\nWARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\nWARNING: All illegal access operations will be denied in a future release\n\n\nI'm running Java 13:\n\n$ java --version\nopenjdk 13 2019-09-17\nOpenJDK Runtime Environment (build 13+33)\nOpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)\n$ javac --version\njavac 13\n\n\nI'm not sure if this is a bug on my side or something to do with gradle."
] | [
"java",
"gradle",
"groovy",
"nullpointerexception"
] |
[
"ASP.Net Web Site Administration Tool Link",
"I'd like to include the ASP.net Web Admin tool in a web site when a user logs in as an local manager of the web site, this will be on the LAN and not public.\n\nI can obtain the link in Visual Studio ie\n\nhttp://localhost:54397/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=D:\\DATA\\Projects\\WebIV\\WebSite\\&applicationUrl=/WebSite\n\nHowever this changes from server to server and the physical path will change\n\nis there a way to launch it via a relative link? or some other way to get its URL at run time?\n\nhttp://msdn.microsoft.com/en-us/library/yy40ytx0(VS.85).aspx"
] | [
".net",
"asp.net",
"administration"
] |
[
"Task blocks UI from refreshing in WPF",
"I am building a WPF application that converts a powerpoint to WPF elements when you select one from a list.\nI am using MVVM light to bind a ViewModel to my view and to add communication between ViewModels.\n\nI have two views: OpenLocalView and PresentationView. When I select a powerpoint in the OpenLocalView, a message will be sent by MVVM light to the ViewModel of PresentationView and the MainViewModel with the path to that powerpoint. The MainViewModel switches the view to the PresentationView, and the PresentationViewModel executes this code to convert the powerpoint, and when that is finished, set the current slide so it is shown in the PresentationView:\n\n public void StartPresentation(string location)\n {\n var scheduler = TaskScheduler.FromCurrentSynchronizationContext();\n Loading = true;\n Task.Factory.StartNew(() =>\n {\n var converterFactory = new ConverterFactory();\n var converter = converterFactory.CreatePowerPointConverter();\n _slides = converter.Convert(location).Slides;\n }, \n CancellationToken.None, \n TaskCreationOptions.LongRunning, \n scheduler).ContinueWith(x =>\n {\n Loading = false;\n CurrentSlide = _slides.First();\n }, \n CancellationToken.None, \n TaskContinuationOptions.OnlyOnRanToCompletion, \n scheduler);\n }\n\n\nWhen the Loading property is set, the view gets updated with a \"loading\" message, to make the UI more responsive:\n\n public Boolean Loading\n {\n get { return _loading; }\n set\n {\n _loading = value;\n RaisePropertyChanged(\"Loading\");\n }\n }\n\n\nThe problem is, this executes properly the first time when I load a powerpoint: The view switches to the PresentationView, the \"loading\" message is displayed, and after the converting is finished, the message disappears and the slide is shown. But when I go back to the OpenLocalView, and choose another powerpoint, the OpenLocalView hangs and it switches to the PresentationView after the converter is finished, not showing the \"loading\" message at all.\n\nFor reference, I will add some more relevant code.\n\nThis is executed when a powerpoint is selected in the OpenLocalViewModel:\n\n private void PerformOpenPresentation(string location)\n {\n Messenger.Default.Send<OpenPowerPointMessage>(new OpenPowerPointMessage {Location = location});\n }\n\n\nThe MainViewModel is subscribed to the messenger and switches the view:\n\nMessenger.Default.Register<OpenPowerPointMessage>(this,\n delegate\n {\n if (_presentation == null) _presentation = new PresentationView();\n CurrentView = _presentation;\n });\n\n\nThe PresentationViewModel is subscribed to the messenger as well and executes the method shown above:\n\nMessenger.Default.Register<OpenPowerPointMessage>(this, message => StartPresentation(message.Location));\n\n\nSo, what am I doing wrong? Again, it executes fine one time, then after that not anymore, although the same code is executed."
] | [
"c#",
"wpf",
"mvvm-light",
"task-parallel-library"
] |
[
"Using the White Checkmark accessory when row not selected",
"I have a UITableView which enables multiple selection of rows. I am using the CheckMark accessory to indicate selected rows and also a gradient background.\n\nWhen I tap a cell the UITableView shows it as selected with the blue gradient and a white checkmark, but when i let go of the tap the checkmark accessory goes to a dark blue colour. \n\nMy question is does anyone know how I can get a white checkmark rather than the blue one.\n\nThe reason i need this is that for the selected rows I have a dark blue background and you cannot see the checkmark clearly. I know I can create an image as the accessory view with a white checkmark which is fine, but I just wondered if there was a way to use the inbuilt white checkmark which appears when tapping a row?\n\nThanks"
] | [
"iphone",
"uitableview"
] |
[
"unknown error: Failed to get convolution algorithm",
"Traceback (most recent call last):\nFile "trash.py", line 273, in\ntrain(model)\nFile "trash.py", line 178, in train\nmodel.train(dataset_train, dataset_val,\nFile "C:\\Users\\najmi\\Desktop\\trash\\wade-ai\\Trash_Detection\\mrcnn\\model.py", line 2357, in train\nself.keras_model.fit(\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\keras\\engine\\training_v1.py", line 789, in fit\nreturn func.fit(\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\keras\\engine\\training_generator_v1.py", line 577, in fit\nreturn fit_generator(\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\keras\\engine\\training_generator_v1.py", line 259, in model_iteration\nbatch_outs = batch_function(*batch_data)\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\keras\\engine\\training_v1.py", line 1088, in train_on_batch\noutputs = self.train_function(ins) # pylint: disable=not-callable\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\keras\\backend.py", line 3956, in call\nfetched = self._callable_fn(*array_vals,\nFile "C:\\Users\\najmi\\AppData\\Roaming\\Python\\Python38\\site-packages\\tensorflow\\python\\client\\session.py", line 1480, in call\nret = tf_session.TF_SessionRunCallable(self._session._session,\ntensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.\n(0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.\n[[{{node conv1/Conv2D}}]]\n[[proposal_targets/strided_slice_17/_4493]]\n(1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.\n[[{{node conv1/Conv2D}}]]\n0 successful operations.\n0 derived errors ignored.\nHi,\nI am getting the error as mentioned above while training MRCNN and the training process is freezing at 1 Epoch.\nCan one help with this error?"
] | [
"deep-learning"
] |
[
"Possible to get the stored procedure call for debugging?",
"While using Visual Studio 2010 for my ASP.NET website, we have code for a stored procedure call:\n\nSqlDataAccess sqlDataAccess = new SqlDataAccess();\n\nSqlParameter[] parameters =\n{\n new SqlParameter(\"@R\", rptType.Replace(\"'\", \"''\")),\n new SqlParameter(\"@M\", hybrDct[\"mod\"].ToString().Replace(\"'\", \"''\")),\n new SqlParameter(\"@C\", hybrDct[\"CG\"].ToString().Replace(\"'\", \"''\")),\n new SqlParameter(\"@Ts$\", hybrDct[\"TFields\"].ToString().Replace(\"'\", \"''\")),\n};\n\nsqlDataAccess.ProcName = \"MyStoredProc\";\nsqlDataAccess.Parameters = parameters;\n\n\nIs it possible to get the execute printed out for debugging purposes instead of finding out each individual SqlParameter and typing it in individually?\n\nThanks."
] | [
"c#",
".net",
"stored-procedures",
"ado.net"
] |
[
"Passing Array to model function query codeigniter",
"Here is my function I want to put array values in IN() clause but it is not working\n Here $ids is the array passing to it. \n\n function get_school_students_data($ids){\n $query=$this->db->query(\"SELECT * FROM screening_answers where uid \n IN(\".implode(',',$ids).\")\");\n $result=$query->result_array();\n return $query->num_rows();\n }"
] | [
"php",
"mysql",
"codeigniter"
] |
[
"Hide input after append(after)",
"I am trying to create input fields with button. But what I want is, when input field is created, I want hide created input field with the same button. I tried slideToggle function, but that didn't worked very well.\n\n<button type=\"button\" id=\"addEmail\" \"class1\"></button>\n\n$('#addEmail').one('click', function () {\n var dummy = '<input type=\"text\">';\n $('.email').after(dummy); //creating input after class 'email'\n $(this).addClass('less-inputs'); //Changing buttons css\n});"
] | [
"javascript",
"jquery"
] |
[
"Concrete5 Failed opening required",
"Currently setting up an existing concrete5 website. After running MAMP and running composer install I get the following error:\n\nSymfony\\Component\\ClassLoader\\MapClassLoader::loadClass(): Failed opening required '/Users/xxx/xxx/xxx/packages/components/controller.php' (include_path='/Users/xxx/xxx/xxx/concrete/vendor:.:/Applications/MAMP/bin/php/php7.1.19/lib/php')\n\n\nIt seems like the folder components which it is looking in for the controller.php inside packages does not exist. How can I fix this?"
] | [
"concrete5"
] |
[
"A composer's package doesn't exist anymore, and I have a copy. What can I do?",
"Time ago, I installed a dependency on a Symfony project. It was the package mograine/calendar-bundle, but now this project doesn't exist anymore and has disappeared from github. It was a fork of another package with some modifications that I need for the project I'm working on.\n\nOf course, I have a copy of the package (under vendor/mograine folder). But, currently I'm unable to run the composer install order, because this package doesn't exist.\n\nAnd my question is: What can I do to solve this problem? Can I tell composer that this package is installed locally? If so, what should I do to install the package locally? Or I must create a github account and upload all the original files?"
] | [
"composer-php"
] |
[
"Stuck with restkit mapping",
"newbie with restkit problems here :(\n\nthis is my json response for trades that belong to an exchange and a currency:\n\n{\n \"exchange\": \"symbol\",\n \"currency\": \"USD\",\n \"trades\": [\n {\n \"maxPrice\": \"684.00\",\n \"minPrice\": \"683.10\",\n \"price\": \"683.28\",\n \"timestamp\": \"1390451006\",\n \"volume\": \"1.0\"\n }\n ]\n}\n\n\nI have an array of trades that belong to an exchange defined in the root of this response, trades can be 1..n.\n\nMy exchange class has 2 attributes\n\n{\n \"displayName\": \"name\",\n \"symbol\": \"symbol\"\n}\n\n\nMy currency class has 2 attributes.\n\n{\n \"symbol\": \"$\",\n \"code\": \"USD\" \n}\n\n\nA proper JSON response and a easyout would be\n\n{\n \"trades\": [\n {\n \"maxPrice\": \"684.00\",\n \"minPrice\": \"683.10\",\n \"price\": \"683.28\",\n \"timestamp\": \"1390451006\",\n \"volume\": \"1.0\",\n \"exchange\": {\n \"displayName\": \"name\",\n \"symbol\": \"symbol\"\n },\n \"currency\": {\n \"symbol\": \"$\",\n \"code\": \"USD\"\n }\n }\n ]\n}\n\n\nsince all these trade belong to a single exchange and a currency i specified them at the root of the JSON response, i'm lost as to how i can map these relationship in restkit.\n\nMy Entities\n\nExchange\n-displayName\n-symbol\n-trades(Exchange -->>Trade | 1:n)\n\nCurrency\n-code\n-symbol\n-trades(Currency -->> |1:n)\n\nTrade\n-maxPrice\n-minPrice\n-price\n-tradeDate\n-volume\n-currency(Trade >-->Currency |n:1)\n-exchange(Trade >-->Exchange |n:1)\n\n\nAny pointers or ideas would be sincerely appreciated.\n\nThanks for your help."
] | [
"core-data",
"restkit"
] |
[
"Failed to load databse information: SAP Crystal Reports ActiveX Designer",
"I am having this issue again and again after applying multiple solutions like update app.config file and many others. As i want to add database fields to report using ADO.Net datasets it give this error message. Screen shot is attached..."
] | [
"visual-studio-2015",
"crystal-reports"
] |
[
"Python counting string",
"I have to define a function called letterCount in which it returns an integer for the number of times there is a string in the function. For some reason, it returns 2 and I am supposed to return 7\n\ndef letterCount(text,collection):\n for collection in text:\n if collection in text:\n return len(collection) + 1\nseuss = 'The cat in a hat came back'\nletters = 'ac'\nprint(letterCount(seuss,letters))"
] | [
"python",
"string",
"for-loop"
] |
[
"HTML5 / Javascript Web Audio API",
"Im getting started with the web audio API and for som reason this code only play the oscillator one time, what am I missing?\n\n <select class=\"osc1\">\n <option value = \"sawtooth\">Sawtooth</option>\n <option value = \"square\">Square</option>\n <option value = \"triangle\">Triangle</option>\n <option value = \"sine\">Sine</option>\n </select>\n <button id=\"play-btn\">Play</button>\n\n <script>\n var ac = new (window.AudioContext || window.webkitAudioContext)();\n\n function createOsc(ac, elclass)\n {\n var osc = ac.createOscillator();\n osc.frequency.value = 110;\n osc.type = document.getElementsByClassName(elclass)[0].value;\n osc.connect(ac.destination);\n\n osc.start();\n osc.stop(2);\n }\n\n document.getElementById(\"play-btn\").addEventListener(\"click\", function(e){\n createOsc(ac, 'osc1');\n });\n </script>\n\n\nSOLUTION\n\nI managed to find the solution by myself, when calling the method stop it expects as argument the context current time plus number of seconds in a floating point.\n\n osc.stop(ac.currentTime + 2.0);"
] | [
"javascript",
"html",
"webkit"
] |
[
"Checking if view controller has been loaded before",
"I am trying to checking if a certain view has been loaded ever before in the lifetime of the app. I have implemented the following code but not quite sure why it isn't working. It is being done in the viewDidLoad method only of the view controller (perhaps this is the problem). If anyone can let me know what my mistake is, it would be appreciated. Thanks!\n\n NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n BOOL hasRunBefore = [defaults boolForKey:@\"FirstRun\"];\n if (hasRunBefore) {\n NSLog (@\"not the very first time this controller has been loaded\");\n [defaults setBool:YES forKey:@\"FirstRun\"];\n [defaults synchronize];\n }\n else if (!hasRunBefore) {\n [defaults setBool:NO forKey:@\"FirstRun\"];\n NSLog (@\"the very first time this controller has been loaded\");\n [defaults synchronize];\n }"
] | [
"objective-c",
"ios",
"xcode"
] |
[
"Speeding up a SQL query that must compute Euclidean Distance",
"I have a rather complex and long sql query. Essential I want the row with the smallest euclidean distance in the table from some given value. The catch is the vector has 27 dimensions so it is a rather expensive calculation and then it needs to be done on all columns.\n\nI've considering adding an alternate table that each row maps to and this table will be a bucket. Pre determined values and then I would use the triangle inequality to limit how many rows I have to perform the calculation.\n\nAnother is making the columns I need to perform the calculations with indexs, but I don't know how much that will help.\n\nAny suggestions appreciated."
] | [
"sql",
"sql-server",
"euclidean-distance"
] |
[
"To retreive sharepoint list data using client context",
"I am trying to retrieve Sharepoint list data using Microsoft.Sharepoint.Client library using vb.net windows form.\n\nBelow is the vb.net code for reference.\n\nImports Microsoft.SharePoint.Client\n\nPublic Class sharepoint_list\n Private client_context As ClientContext\n\n Private Sub sharepoint_list_Load(sender As Object, e As EventArgs) Handles MyBase.Load\n client_context = New ClientContext(\"[email protected]\")\n Dim web_ As Web = client_context.Web\n client_context.Credentials = New SharePointOnlineCredentials(\"[email protected]\", GetPassword(\"[email protected]\", \"mypass@123\"))\n client_context.Load(web_)\n client_context.ExecuteQuery()\n MsgBox(web_.Title)\n\n End Sub\n\n Public Function GetPassword(username As String, password As String) As Security.SecureString\n Dim keyinfo As ConsoleKeyInfo\n Dim securePass As Security.SecureString\n securePass = New Security.SecureString\n For Each c As Char In password\n securePass.AppendChar(keyinfo.KeyChar)\n Next\n Return securePass\n End Function\nEnd Class\n\n\nWhenever I try to run this piece of code, It throws an error with the following message\n\n\n '.', hexadecimal value 0x00, is an invalid character.\n\n\nand the following message on the console\n\n\n A first chance exception of type 'System.ArgumentException' occurred\n in System.Xml.dll\n\n\nAny help would be appreciable.\n\nThanks in advance."
] | [
"vb.net",
"winforms",
"sharepoint"
] |
[
"NetLogo: network- spring layout with 2 breeds",
"I'm new to NetLogo and having trouble adding 'layout spring'. \n\nTwo of my main issues are:\n\n\nNodes can be too close to the edges of the world (I want them to be randomly allocated, but not so close to the edges)\nNodes create links that go over the world boundaries.\n\n\nbreed [A-agents A-agent]\nbreed [B-agents B-agent]\n\nto setup\n clear-all\n reset-ticks\n spawn-A\n spawn-B\n connect-spawns\nend\n\nto spawn-A ;; create one intial A-agents and add to setup\n create-A-agents 1\n [ set shape \"triangle\"\n set size 0.75\n set color 44\n setxy random-xcor random-ycor\n ]\nend\n\nto spawn-B ;; create one initial B-agents and add to setup\n create-B-agents 1\n [ set shape \"circle\"\n set size 0.5\n set color red\n setxy random-xcor random-ycor\n ]\nend\n\nto connect-spawns ;; create a link between B and A agent\n ask B-agents [create-links-with A-agents [set color green]]\nend\n\nto go ;; create a new node based on the emprical user distribution of A-agents/B-agents\n let p random-float 100 ;; create a random number between 1-100\n if (p > 96) [create-A-agents 1\n [ set shape \"triangle\"\n set size 0.75\n set color 44\n setxy random-xcor random-ycor\n let thisA self\n let test-num random-float 1\n ifelse test-num > 0.58\n [ create-link-with one-of other B-agents [set color green]]\n [ create-link-with one-of other A-agents [set color 44]]]\n ]\n if (p <= 96) [create-B-agents 1\n [ set shape \"circle\"\n set size 0.5\n set color red\n setxy random-xcor random-ycor\n let thisB self\n let test-num random-float 1\n ifelse test-num >= 0.56\n [ create-link-with one-of other B-agents [set color red]]\n [ create-link-with one-of other A-agents [set color cyan]]]\n ]\n tick\nend"
] | [
"layout",
"netlogo"
] |
[
"How to count only the continuous repetitive sub-string in a given string python",
"def count_overlapping(sequence, sub):\n counts = 0\n n = len(sub)\n while sub in sequence:\n counts += 1\n sequence = sequence[(sequence.find(sub) + n-1):]\n return counts\n\n\ninput: sequence = agatabttagataagataagatagatabagata\n\ninput: sub = agata\n\noutput: 3\n\nThis is the required output but my program is giving out 4.How do I ignore the non repetitive ones.\n\nSomeone please guide me here."
] | [
"python",
"substring"
] |
[
"Using javascript to take HTML form inputs",
"I would like to use javacript to simply look at a specific HTML form (i.e. radio button), find the user's selection and then respond in various ways.\n\nIs there a way javascript can read user input or selected responses for a form?"
] | [
"javascript",
"html",
"forms"
] |
[
"Controller not getting response from service when put in a function",
"I am new to angular and am stuck on an issue. I have created a controller which calls a service and the data is populating the screen. However, I am trying to execute functions after the first function has been called using .then and I am not receiving any data as if it doesn't exist. Why is my console statement empty?\n\napp.service('UserOperations',function($http, $q){\n $http.defaults.useXDomain = true;\n\n this.getStores = function(user_id){\n var userStores;\n var stores = [];\n $http.get(\"http://localhost/shoploot_api/api/get-user-stores?user_id=\" + user_id + \"&&action=get_user_stores\")\n .then(function (res) {\n userStores = res.data;\n angular.forEach(userStores, function(value, key){\n $http.get(\"http://localhost/shoploot_api/api/get-store?store_id=\" + value.store_id + \"&&action=get_store\")\n .then(function (store) {\n $http.get(\"http://localhost/shoploot_api/api/get-points?store_id=\" + value.store_id + \"&&user_id=\" + user_id)\n .then(function (points) {\n if(points.data[0]['points']){\n store.data[0]['points'] = points.data[0]['points'];\n }else{\n store.data[0]['points'] = 0;\n }\n store.data[0]['newMessage'] = 'hello';\n stores.push(angular.merge(userStores[key],store.data[0]));\n });\n }); \n });\n });\n return stores;\n };\n\n this.getMessages = function(user_id,store_id){\n return 'working';\n }\n});\n\napp.controller('userStoresCtrl', function($scope, $q, UserOperations){\n var getStores = function(user_id){\n var defer = $q.defer();\n $scope.stores = UserOperations.getStores(user_id);\n defer.resolve($scope.stores);\n return defer.promise;\n }\n\n getStores(1).then(function(){\n console.log($scope.stores);\n });\n\n //$scope.stores = stores\n});"
] | [
"angularjs"
] |
[
"Show Popup after 10min of inactive",
"Hello,\ncan't find a code :x Can someone post, or explain how can i make a Popup after 10minutes of inactive ?\n\nWhen member is inactive of 10minutes after Page is loaded, the members will get a Popup with some Buttons and Text\n\n<div>\n <p>Away from keyboard?</p>\n <ul class=\"button\">\n <li><a href=\"#0\">I'm Back!</a></li>\n </ul>\n</div>"
] | [
"javascript",
"time",
"popup"
] |
[
"Using datasource connection of weblogic server",
"I have wrote Java Client application (bean for Oracle form) to access the data through \"jdbcdatasource\" created on Weblogic 12c. It works fine when I am running on desktop, but when I am embedding on oracle forms as a bean, it gives following error:\njava.lang.ClassNotFoundException: weblogic.jdbc.common.internal.RmiDataSource_12210_WLStub\n\njava bean is an executable jar file includes all the dependency jar file, and it is executed independently by double click.\n\nHere is a code:\n\nContext ctx = null;\nHashtable ht = new Hashtable();\nht.put(Context.INITIAL_CONTEXT_FACTORY, \"weblogic.jndi.WLInitialContextFactory\");\nht.put(Context.PROVIDER_URL, \"t3:\" + url + \":7001\");\nif(sUser != null && sPwd != null){\nht.put(Context.SECURITY_PRINCIPAL, sUser); \nht.put(Context.SECURITY_CREDENTIALS, sPwd);\n}\nctx = new InitialContext(ht);\nSystem.out.println(\"!!! WebLogic Server Connection Done!\");\njavax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup(\"myDatasource\");\njava.sql.Connection conn = ds.getConnection();\nSystem.out.println(\"!!! DataSource Connection Done!\"); \n\n\nIn the environment of Oracle forms it connect to the weblogic server but could not access the data source by displaying above error.\n\nAny suggestion?"
] | [
"java",
"weblogic12c"
] |
[
"Java Parse Json Byte Array",
"Im developing an Android application which are using an webservice to fetch an image that are going to be displayed in the application.\n\nI'm using JSON as my format. The whole connection process works like a charm but i need help with parsing the response from the webservice request.\n\nThis is my result:\n\n[255,12,87,183,232,34,64,121,182,23]\n\n\nOf course this is not the real data, im just trying to explain how the data looks like when i receive it. So my question is, how do i parse this data into an byte array?\n\nHere is my connection code this far:\n\nHttpResponse response = httpClient.execute(request);\nHttpEntity responseEntity = response.getEntity();\nInputStream stream = responseEntity.getContent();\nString string_result= convertStreamToString(stream);\n\n\nThis works great and the variable 'string_result' contains the data that was received.\nSo if someone know how to simply parse this JSON String Containing An Byte Array i would appreciate some help."
] | [
"java",
"android",
"json",
"bytearray"
] |
[
"hazelcast instance and group name : best practices",
"I have configured hazelcast for dev and QA environment and kept hazelcast instance name same but different group name ( in each yml files ). Is this correct ? Also, is there any way to limit the cluster members. It will just join the explicitly configured members with port no. Could you guide to some sample examples.\n\nThanks."
] | [
"hazelcast",
"hazelcast-imap"
] |
[
"Architecture for http client",
"I am developing application, with http client, and I wonder to make some elegant issue.\nThis is standard java http client whose work in background thread, and passing data by event's (witch realized by override methods). I have special class for background requests, that implements method sendRequest()\n\nprotected void sendRequest(final String url) {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n URI website = null;\n try {\n website = new URI(url);\n } catch (URISyntaxException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n HttpGet request = new HttpGet();\n request.setURI(website);\n HttpResponse response = null;\n try {\n response = client.execute(request, httpContext);\n } catch (IOException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n if (response != null)\n {\n HttpEntity entity = response.getEntity();\n try {\n InputStream is = entity.getContent();\n if (Debug.isDebuggerConnected()==true)\n {\n String data = convertStreamToString(is);\n int code = response.getStatusLine().getStatusCode(); \n if (httpEvent!=null)\n httpEvent.HttpResponseArrived(data, code);\n }\n else\n httpEvent.HttpResponseArrived(convertStreamToString(is),response.getStatusLine().getStatusCode());\n }\n catch (IOException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n }\n });\n t.start();\n }\n\n\nAnd also child class, for API to web server, wich have methods like that:\n\npublic void getSomeData(SomeParams param)\n {\n sendRequest(\"http://xxx.yy\"+gson.toJson(param));\n httpEvent = new HttpHandler()\n {\n @Override\n public void HttpResponseArrived(String data, int code)\n {\n switch (code)\n {\n case 200:\n //some code\n break;\n case 401:\n //some code\n break;\n\n }\n }\n };\n }\n\n\nAnd my question: how elegant to handle server errors, for example 401? I need to do this in one place, in method that sending requests - sendRequest(). At first sight it is very easy: just handle 401, and if it's because expired cookie - call method Login() (in my design, it's look like getSomeData). But I want, not just login again, I need to request data, that I failed to get because the error. Of course, I can implement calling Login() method in every switch, like this:\n\ncase 401:\n {\n Login(CurrentContext.AuthData.Login, CurrentContext.AuthData.Password);\n break;\n }\n\n\nBut the login event implemented in Login() method;\nAlso, I can just write sendRequest(string authdata), subscrube for HttpHandler and by recursion call method thats implements this code. But I thind, it's not very good decision.\nI really hope, that somebody already solve this problem, and there is the way, to turn it's in beautiful code!\nThanks, if you could to read this to the end:)"
] | [
"java",
"android"
] |
[
"class added dynamically doesn't respond touched in swift",
"I declare TestClass contain button and textField and constraint it and then add this class to view controller \n\nimport Foundation\nimport UIKit\n\nclass TestClass : UIView {\n\n let testButton : UIButton = {\n let button = UIButton()\n button.setTitle(\"Test\", for: .normal)\n button.setTitleColor(.red ,for:.normal)\n return button\n }()\n\n let testInput : UITextField = {\n let input = UITextField()\n input.placeholder = \"type here\"\n return input\n }()\n\n\n override init(frame: CGRect) {\n super.init(frame: frame)\n setupView()\n }\n\n func setupView(){\n\n addSubview(testButton)\n addSubview(testInput)\n\n testButton.translatesAutoresizingMaskIntoConstraints = false\n testInput.translatesAutoresizingMaskIntoConstraints = false\n\n testButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 20).isActive = true\n testButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 20).isActive = true\n testButton.heightAnchor.constraint(equalToConstant: 30).isActive = true\n testButton.widthAnchor.constraint(equalToConstant: 50).isActive = true\n\n testInput.topAnchor.constraint(equalTo: self.topAnchor, constant: 70).isActive = true\n testInput.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 20).isActive = true\n testInput.heightAnchor.constraint(equalToConstant: 30).isActive = true\n testInput.widthAnchor.constraint(equalToConstant: 100).isActive = true\n\n }\n\n\n\n required init?(coder: NSCoder) {\n fatalError(\"init(coder:) has not been implemented\")\n }\n\n\n}\n\n\n\nin the viewDidLoad I add this class and it appeared .\nbut when I tap on textField or button it doesn't respond \n\nclass ViewControll : UIViewController {\n\n let newClass : TestClass = {\n let view = TestClass()\n return view\n }()\n\n override func viewDidLoad() {\n super.viewDidLoad()\n view.addSubview(newClass)\n newClass.frame.size = CGSize(width: 200, height: 200)\n newClass.translatesAutoresizingMaskIntoConstraints = false\n newClass.topAnchor.constraint(equalTo: contView.topAnchor, constant: 300).isActive = true\n newClass.leadingAnchor.constraint(equalTo: contView.leadingAnchor, constant: 30).isActive = true\n newClass.testButton.addTarget(self, action: #selector(prnt), for: .touchUpInside)\n\n }\n @objc func prnt(){\n print(\"bla bla bla\")\n }\n}\n\n\nwhen I click on button or tap on textField nothing happened \ncan anyone help me please"
] | [
"ios",
"swift",
"programmatically"
] |
[
"post_max_size in php.ini not found",
"I'm trying to change the file upload settings in Apache \n\nI typed the follow commands:\n\nsudo nano /etc/php5/apache2/php.ini\n\n\n(file opend successful)\n\nCtrl + W \"post_max_size\"\nbut here I get answer : not found\n\nalso \"upload_max_filesize\" not found\n\nPlz help"
] | [
"php",
"linux",
"apache"
] |
[
"How do I replace the contents of an existing XML file in C#.NET?",
"When trying to replace the content of an XML file in C#.NET with a snippet like this:\n\nstring file = Path.GetTempFileName(); // pretend this is a real file\nstring tmpFile = Path.GetTempFileName();\n\nusing (var writer = XmlWriter.Create(File.Create(tmpFile)))\n{\n writer.WriteStartElement(\"root\");\n for (int i = 0; i < 100; i++)\n {\n writer.WriteElementString(\"test\", null, \n \"All work and no play makes Jack a dull boy\");\n }\n writer.WriteEndElement();\n}\n\nFile.Delete(file);\nFile.Move(tmpFile, file);\n\n\n... I get a System.IO.IOException claiming that the file is already opened by another process."
] | [
"c#",
".net",
"xml",
"file",
"locking"
] |
[
"common mule data weave function that can be called from multiple data weave scripts",
"In flow 1, i have a data weave script like this\n\n%output application/java\n%function fun1(str)\n xxxx //do some steps \n---\npayload map ((payload01 , indexOfPayload01) -> {\nelement1 : fun1(payload01.element1)\n}\n\n\nIn flow 2, i have a data weave script like this\n\n%output application/java\n%function fun1(str)\n xxxx //do some steps \n---\npayload map ((payload01 , indexOfPayload01) -> {\nentity1 : fun1(payload01.entity1)\n}\n\n\nfun1 is repeated in data weave in flow 2.. How can i make fun1 a common data weave function so that i can call from data weave in both flow 1 and flow 2?"
] | [
"mule",
"mule-component",
"dataweave"
] |
[
"What is the best way to convert an array of strings into an array of objects in Angular 2?",
"Let's say I have an array as follows:\n\ntypes = ['Old', 'New', 'Template'];\n\n\nI need to convert it into an array of objects that looks like this:\n\n[\n {\n id: 1,\n name: 'Old'\n },\n {\n id: 2,\n name: 'New'\n },\n {\n id: 3,\n name: 'Template'\n }\n]"
] | [
"javascript",
"typescript"
] |
[
"How to do calculation on pandas dataframe that require processing multiple rows?",
"I have a dataframe from which I need to calculate a number of features from. The dataframe df looks something like this for a object and an event:\n\nid event_id event_date age money_spent rank\n1 100 2016-10-01 4 150 2\n2 100 2016-09-30 5 10 4 \n1 101 2015-12-28 3 350 3\n2 102 2015-10-25 5 400 5 \n3 102 2015-10-25 7 500 2\n1 103 2014-04-15 2 1000 1\n2 103 2014-04-15 3 180 6\n\n\nFrom this I need to know for each id and event_id (basically each row), what was the number of days since the last event date, total money spend upto that date, avg. money spent upto that date, rank in last 3 events etc.\n\nWhat is the best way to work with this kind of problem in pandas where for each row I need information from all rows with the same id before the date of that row, and so the calculations? I want to return a new dataframe with the corresponding calculated features like\n\nid event_id event_date days_last_event avg_money_spent total_money_spent\n1 100 2016-10-01 278 500 1500\n2 100 2016-09-30 361 196.67 590 \n1 101 2015-12-28 622 675 1350\n2 102 2015-10-25 558 290 580 \n3 102 2015-10-25 0 500 500\n1 103 2014-04-15 0 1000 1000\n2 103 2014-04-15 0 180 180"
] | [
"python",
"python-2.7",
"pandas"
] |
[
"Ubuntu does not detect second nVidia GPU",
"I have 2 GPUs installed on my system: a GTX660 and a 8800GTS. Both are detected and run perfectly under Windows 8, and Ubuntu 12.04 32bits.\nI've now installed Ubuntu 12.04 64bits on the same system, with the latest drivers from nVidia (304.64 in 64bits). In console mode (CTR + ALT + F1), I can detect and use both cards (through, e.g., a CUDA application).\nIn X-mode (I use the standard lightdm server), the same application only detects the GTX660. Running lspci from an X terminal shows both GPUs (the GTX660 is referred to as a "VGA compatible controller" while the 8800GTS is clearly referenced in plain).\nIt seems to me to be related to the X-server, more than anything.\nAny idea how to fix this?"
] | [
"ubuntu",
"cuda",
"gpu",
"nvidia"
] |
[
"What is the difference between python and ipython console?",
"I am new to python. I am using spyder editor. I did basic print out the values of total and average. But, When i ran this code on python console, i got the error \"num1 is not defined\". However, when i ran this code on i-python console, it worked perfectly. I am asking why do I get error on python console. \n\ndef problem1(num1,num2,num3):\n total = num1+num2+num3\n average = total/3\n print(\"The sum of numbers are: \",total)\n print(\"The average of numbers are: \",average)\n return(total,average)\n\nnum1 = eval(input(\"Enter the number 1: \"))\nnum2 = eval(input(\"Enter the number 2: \"))\nnum3 = eval(input(\"Enter the number 3: \"))\n\nproblem1(num1,num2,num3)"
] | [
"python"
] |
[
"Extracting information from textfile through regex and/or python",
"I'm working with a large amount of files (~4gb worth) which all contain anywhere between 1 and 100 entries with the following format (between two *** is one entry):\n\n***\nType:status\nOrigin: @z_rose yes\nText: yes\nURL: \nID: 95482459084427264\nTime: Mon Jul 25 08:16:06 CDT 2011\nRetCount: 0\nFavorite: false\nMentionedEntities: 20776334 \nHashtags: \n***\n***\nType:status\nOrigin: @aaronesilvers text\nText: text\nURL: \nID: 95481610861953024\nTime: Mon Jul 25 08:12:44 CDT 2011\nRetCount: 0\nFavorite: false\nMentionedEntities: 2226621 \nHashtags: \n***\n***\nType:status\nOrigin: @z_rose text\nText: text and stuff\nURL: \nID: 95480980026040320\nTime: Mon Jul 25 08:10:14 CDT 2011\nRetCount: 0\nFavorite: false\nMentionedEntities: 20776334 \nHashtags: \n***\n\n\nNow I want to somehow import these into Pandas for mass analysis, but obviously I'd have to convert this into a format Pandas can handle. So I want to write a script that converts the above into a .csv looking something like this (User is the file title):\n\nUser Type Origin Text URL ID Time RetCount Favorite MentionedEntities Hashtags\n4012987 status @z_rose yes yes Null 95482459084427264 Mon Jul 25 08:16:06 CDT 2011 0 false 20776334 Null\n4012987 status @aaronsilvers text text Null 95481610861953024 Mon Jul 25 08:12:44 CDT 2011 0 false 2226621 Null \n\n\n(Formatting isn't perfect but hopefully you get the idea)\n\nI've had some code working that worked on the basis of it regularly being information in segments of 12, but sadly some of the files contain several whitelines in some fields. What I'm basically looking to do is:\n\nfields[] =['User', 'Type', 'Origin', 'Text', 'URL', 'ID', 'Time', 'RetCount', 'Favorite', 'MentionedEntities', 'Hashtags']\nstarPair = 0;\nUser = filename;\nread(file)\n#Determine if the current entry has ended\nif(stringRead==\"***\"){\n if(starPair == 0)\n starPair++;\n if(starPair == 1){\n row=row++;\n starPair = 0;\n }\n}\n#if string read matches column field\nif(stringRead == fields[])\n while(strRead != fields[]) #until next field has been found\n #extract all characters into correct column field\n\n\nHowever the issue arises that some fields can contain the words in fields[].. I can check for a \\n char first, which would greatly reduce the amount of faulty entries, but wouldn't eliminate them.\n\nCan anyone point me in the right direction?\n\nThanks in advance!"
] | [
"python",
"regex",
"data-analysis"
] |
[
"Failing to execute plantuml in emacs",
"I am using GNU Emacs 25.3.1 (x86_64-w64-mingw32), on Windows 10, plantuml 1.4.1, and the following .emacs:\n\n(package-initialize)\n\n(require 'package)\n(add-to-list 'package-archives\n '(\"MELPA Stable\" . \"http://stable.melpa.org/packages/\") t)\n\n(custom-set-variables\n '(package-selected-packages (quote (plantuml-mode ## flycheck company)))\n '(plantuml-default-exec-mode (quote jar))\n '(plantuml-jar-path \"C:\\\\Users\\\\tc000210\\\\AppData\\\\Roaming\\\\plantuml.jar\"))\n\n\n\nI execute plantuml-mode, and when I try plantuml-preview on this PlantUML code:\n\n@startuml\nA *-- B\n@enduml\n\n\nI get the message error in process sentinel: PLANTUML preview failed: exited abnormally with code 1\n\nDoes anyone know how to fix this?\n\nThanks!"
] | [
"emacs",
"plantuml"
] |
[
"return the most frequent value within columns",
"I have a table in SAS where is for example a customer_id and 5 columns with his monthly statuses. There is 6 different statuses for customer. \nFor example\n\ncustomer_id month1 month2 month3 month4 month5 \n12345678 Waiting Inactive Active Active Canceled\n\n\nI want return a value from columns month1 - month5 which is the most frequent. In this case it is the value Active.\nSo result will be \n\ncustomer_id frequent\n12345678 Active \n\n\nIs there any function in SAS? I have some idea how to do it with sql but it will be very complicated with a lot of case conditions etc. I am new in SAS so I suppose there will be some better solution."
] | [
"sql",
"sas",
"proc-sql"
] |
[
"Got \"two named subpatterns have the same name\" when combining 2 regex into one",
"I'm trying to combine 2 different regex with the same names into one and got the error message like this:\n\n\n Warning: preg_match(): Compilation\n failed: two named subpatterns have the\n same name at offset 276 ...\n\n\nOne regex looks like this:\n\n'%<div class=\"artikkelen\">[\\s\\S]*?<h2>(?P<title>[\\s\\S]*?)</h2>%'\n\n\nThe other looks like this:\n\n'%<div id=\"article\">[\\s\\S]*?<h1>(?P<title>[\\s\\S]*?)</h1>%'\n\n\nI could combine them in the following way without problem:\n\n'%(<div class=\"artikkelen\">[\\s\\S]*?<h2>(?P<title>[\\s\\S]*?)</h2>|<div id=\"article\">[\\s\\S]*?<h1>(?P<title2>[\\s\\S]*?)</h1>)%'\n\n\nBut I don't like this way because I use 2 names. I'm wondering whether there is a better way to solve this problem. Thanks in advance.\n\nBest Regards,\nBox (boxoft...Simple & Great)"
] | [
"php",
"regex"
] |
[
"Homomorphic encryption using Palisade library",
"To all homomorphic encryption experts out there:\nI'm using the PALISADE library:\nint plaintextModulus = 65537;\nfloat sigma = 3.2;\nSecurityLevel securityLevel = HEStd_128_classic;\nuint32_t depth = 2;\n\n//Instantiate the crypto context\nCryptoContext<DCRTPoly> cc = CryptoContextFactory<DCRTPoly>::genCryptoContextBFVrns(\n plaintextModulus, securityLevel, sigma, 0, depth, 0, OPTIMIZED);\n\ncould you please explain (all) the parameters especially intrested in ptm, depth and sigma.\nSecondly I am trying to make a Packed Plaintext with the cc above.\ncc->MakePackedPlaintext(array);\n\nWhat is the maximum size of the array? Because on my local machine when the array is large than ~ 8000 int64 I get some weird error for example free(): invalid next size (normal)"
] | [
"cryptography",
"lattice"
] |
[
"Azure MobileApp Controller returns 500 only if return type is IQueryable",
"My azure mobile app backend is presenting a strange behavior.\nIf my controller action returns an IQueryable<T> and the entity type has a navigation property, it returns 500.\n\nA simple example:\n\nModel\n\npublic class ProductHierarchy : EntityData\n{\n public string Name { get; set; }\n\n public string Description { get; set; }\n\n public DateTime ValidFrom { get; set; }\n\n public DateTime ValidTo { get; set; }\n\n public string BrandId{ get; set; }\n [ForeignKey(\"BrandId\")]\n public virtual Brand Brand { get; set; }\n\n public ProductStatus Status { get; set; }\n\n public int CreatedBy { get; set; }\n\n public int ModifiedBy { get; set; }\n}\n\n\nController Action\n\n[HttpGet]\n [Route(\"api/ProductHierarchies/FromBrand/{brandId}\")]\n public IQueryable<ProductHierarchy> FromBrand(int brandId)\n {\n var hierarchies = Query().Where(hi => hi.Brand.OldBrandId ==brandId);\n return hierarchies;\n }\n\n\nWhen I make a request to this action, with the solution running on my local machine, everything works fine, however when I publish the solution to azure, the FromBrand action starts to return 500, with the generic message \n\n\"An error has occurred.\"\n\n\nIn addition, Azure Logs shows me the following exception when I make a request to the action:\n\nDetailed Error Information: Module\n__DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule,Microsoft.Owin.Host .SystemWeb, Version=3.0.1.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35_19e9f0a3-023d-4d8b-83ef- 180a415e7921 Notification PreExecuteRequestHandler Handler ExtensionlessUrlHandler-Integrated-4.0 Error Code 0x00000000\n\n\nI've found two changes that can avoid the error:\n\n1) When I decorate the Brand property of the Model with JsonIgnore, the Brand property is ignored and everything works fine\n\n2) When I change the action return type to List<ProductHierarchy>, keeping the Brand property of the model without the JsonIgnore atribute, everything works fine too.\n\nIt leads me to conclude that the problem is happening serializing IQueryable<T> when T have a property with another entity as type.\n\nI didn't found anyone having the same issue, so I started to look into my nuget packages looking for wich package Works or Interact with the serialization proccess, and my suspicious are all over Newtonsoft Json and AutoMapper.\n\nAnyone have some clue about how to look under the hood of these packages and determine the origin of the problem?"
] | [
"c#",
"azure",
"azure-mobile-services",
"iqueryable",
"http-status-code-500"
] |
[
"python regex reading parts of text file",
"I'm having a .txt file that look like\n\n'type': 'validation', 'epoch': 91, 'loss': tensor(294.8862, device='cuda:0'), 'acc': tensor(1.00000e-02 *\n 9.9481), 'kl': tensor(292.5818, device='cuda:0'), 'likelihood': tensor(-2.3026, device='cuda:0')}{'type': 'train', 'epoch': 92, 'loss': tensor(51.1491, device='cuda:0'), 'acc': tensor(1.00000e-02 *\n 9.9642), 'kl': tensor(48.8444, device='cuda:0'), 'likelihood': tensor(-2.3026, device='cuda:0')}\n\n\nI would like to read out the acc to plot it. What is wrong with my code here?\n\n acc = list(map(lambda x: x.split(\" \")[-1], re.findall(r\"(acc: \\d.\\d+)\", file)))\n\n print(re.findall(r\"(acc: \\d.\\d+)\", file))\n\n train = acc[0::3]\n valid = acc[1::3]\n return np.array(train).astype(np.float32), np.array(valid).astype(np.float32)\n\n\nThanks for your help!"
] | [
"python",
"regex"
] |
[
"Client ws can't connect to nodejs websocket server hosted on Azure app service?",
"Anybody knows how to setup a websocket server nodejs (npm package ws) app service on Azure ?\nMy ws client can't connect to the ws server... Thank you for any hint!"
] | [
"node.js",
"azure",
"websocket",
"ws"
] |
[
"How to list all categories in MediaWiki main/home page",
"How to show all categories in MediaWiki Main or home page?"
] | [
"mediawiki",
"mediawiki-api",
"mediawiki-extensions"
] |
[
"Divs are not staying in the same place and re sizing when screen shrinks",
"Hi guys i am using bootstrap and media queries to make my website mobile responsive. For some reason those it keeps mucking up my desgin. I am curretnly trying to make this happen: \n\n\n\nThe big div behind is an image. Then on the left hand side we have a div with buttons, the div in the middle is anther image and then the divs on the right is some more small images. Now i have created this desgin, but everytimne u start to shrink the screem the divs on the right end up below the middle div and then the middle div ends up below the left div. Its very weird. Any help in fixing this would be great. \n\nFiddle example here: Code\n\nI am guessing its something to do with my main Div \n\n.Mainimage {\n\n}\n\n\nSo i am using bootstrap with the cold-mid 2 etc and then using some media queries to try and make it better when it become smsall but its not working at all, any help would be great . \nThanks"
] | [
"html",
"twitter-bootstrap",
"css"
] |
[
"Counting occurrences in an expression",
"I'm pretty new to Haskell and I have an assessment which involves a manipulator and evaluator of boolean expressions.\n\nThee expression type is:\n\ntype Variable = String\ndata Expr = T | Var Variable | And Expr Expr | Not Expr \n\n\nI've worked through a lot of the questions but i am stuck on how to approach the following function. I need to count the occurences of all the variables in an expression\n\naddCounter :: Expr -> Expr\naddCounter = undefined\n\nprop_addCounter1 = addCounter (And (Var \"y\") (And (Var \"x\") (Var \"y\"))) == \n And (Var \"y1\") (And (Var \"x2\") (Var \"y1\"))\nprop_addCounter2 = addCounter (Not (And (Var \"y\") T)) == \n Not (And (Var \"y1\") T)\n\n\nI'm not looking for an answer on exactly how to do this as it is an assessment question but I would like some tips on how I would go about approaching this? \n\nIn my head I imagine incrementing a counter so that I can get the y1, x2 part but this isn't really something that is possible in Haskell (or not advised to do anyway!) Would I go about this through recursion and if so how do I know what number to add to the variable?"
] | [
"haskell",
"functional-programming"
] |
[
"Deny Permissions programmatically - Android",
"How can I deny granted permission programmatically in Android.\nI can Add the run time permission,\nIs there any way to deny the permissions on button click."
] | [
"android",
"permissions"
] |
[
"3D sparse datastructure or database in python for easy calling",
"I'm coding up an optimisation problem in Python. The base object is a variable-object with 3 degrees of freedom. \n\nW_(order, machine, time)\n\nevery order number between the first and the last will be populated (there will be no sparseness). However every order does not need every machine. For simplicity at this time every order-machine combo will have the entire time-dimension populated but this could change. \n\nI would like to easily call things like: \n\n\nAll orders using machine 1 and 3 \nAll machines used by orders 1 and 5.\nAll time variables of machines 2 and 3\n\n\nand be returned nice iterable types (like a list) so that I can add the necessary constraints and whatnot. \n\n ----------------------- /| \n M | - - 4 - - | |\n A | 3 - - - - | |\n C | 2 - - 2 2 | |\n H | - 1 - - 1 | | \n | - - 0 - - |/ Time\n ----------------------- \n 0 1 2 3 4 \n ORDERS <--> \n\n\nThe simplest thing I can think of that will work is creating a 3D list in python and filling the blank spaces with Nulls? I'm not sure how well this will work with iterating. Or more complicated calls like:\n\ntime variables between 2..5 for orders 1 and 3 etc.\n\nAny help appreciated!"
] | [
"python",
"database",
"optimization",
"data-structures"
] |
[
"URL routing confusion while deploying Django Rest Framework backend + React web app?",
"I currently have a backend server built with Django Rest Framework and a frontend app built in React. When I run the server (with python manage.py runserver . waitress-serve app.wsgi:application or gunicorn app.wsgi:application), I can't access the admin page by appending /admin to the url. For some reason, my React app's url routing takes care of the routing and returns a 404.\nproject.urls.py\nurlpatterns = [\n path('admin/', admin.site.urls),\n path('api-auth/', include('rest_framework.urls')),\n path('rest-auth/', include('rest_auth.urls')),\n path('rest-auth/registration/', include('rest_auth.registration.urls')),\n path('accounts/', include('allauth.urls')),\n \n path('api/', include('items.urls')),\n re_path('.*', views.FrontendAppView.as_view()),\n]\n\nviews.py\nimport os\nimport logging\nfrom django.http import HttpResponse\nfrom django.views.generic import View\nfrom django.conf import settings\n\n\nclass FrontendAppView(View):\n """\n Serves the compiled frontend entry point (only works if you have run `npm run build`).\n """\n index_file_path = os.path.join(settings.FRONTEND_DIR, 'build', 'index.html')\n\n def get(self, request):\n try:\n with open(self.index_file_path) as f:\n return HttpResponse(f.read())\n except FileNotFoundError:\n logging.exception('Production build of app not found')\n return HttpResponse(\n status=501,\n )\n\nWhat's causing this issue?"
] | [
"django",
"reactjs",
"deployment",
"django-rest-framework"
] |
[
"How to make Combobox retain its selected value in JavaFx while calling from another class?",
"I wish to access value of selected item from the Combobox of one controller class in other controller class.\n\nI am having three values \"Easy\", \"Medium\" and \"Difficult\" in the combobox observablelist of one controller class. Lets say, I select \"Easy\" option and proceed to other class, then I wish to access its value which is 'Easy' in this case.\n\nI have declared my Combobox in the first class as follows : \n\npublic ComboBox combobox = new ComboBox();\n\n\nIn other class, I am writing following code to access its value on a button click :\n\nHomefxmlController hfc = new HomefxmlController();\nSystem.out.println(hfc.combobox.getSelectionModel().getSelectedItem());\n\n\nIt returned NULL\n\nI further tried to access it using a method with return type \"String\", but got a NullPointerException instead.\n\nCan anyone tell me how to resolve it and access its item value from a completely different class ?\n\nFYI : This has no relation between changing scenes and accessing other FXML controller class, I am having problem on accessing object values."
] | [
"java",
"javafx",
"combobox",
"selecteditem"
] |
[
"Can't bind to since it isn't a known property of selector component",
"I want to pass a variable from one component to another and I'm using @input\n\nThis is my parent component :\n\n@Component({\n selector: 'aze',\n templateUrl: './aze.component.html',\n styleUrls: [('./aze.component.scss')],\n providers: [PaginationConfig],\n})\n\nexport class azeComponent implements OnInit {\n public hellovariable: number = 100;\n}\n\n\nThis is the template of the parent component:\n\n<app-my-dialog [hellovariable]=\"hellovariable\"></app-my-dialog>\n\n\nThis is my child component :\n\n@Component({\n selector: 'app-my-dialog',\n templateUrl: './my-dialog.component.html',\n styleUrls: ['./my-dialog.component.css']\n})\n\nexport class MyDialogComponent implements OnInit {\n @Input() hellovariable: number;\n constructor() { }\n\n ngOnInit() {\n console.log(hellovariable);\n }\n\n\nThis is the child template:\n\n <h3>Hello I am {{hellovariable}}<h3>\n\n\nAnd this is the app.module.ts:\n\n\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n MyDialogComponent\r\n\r\n ],\r\n entryComponents: [\r\n MyDialogComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n routing,\r\n NgbModule,\r\n BrowserAnimationsModule,\r\n ToastrModule.forRoot(),\r\n RichTextEditorAllModule,\r\n FullCalendarModule,\r\n NgMultiSelectDropDownModule.forRoot(),\r\n LeafletModule.forRoot(),\r\n NgxGalleryModule,\r\n HttpClientModule,\r\n MatDialogModule,\r\n ReactiveFormsModule\r\n ],\r\n\r\n\r\n\n\nWhen I show my parent component template I get this error:\n\n\n Can't bind to 'hellovariable' since it isn't a known property of 'app-my-dialog'.\n\n\nAny idea on how to fix this?"
] | [
"javascript",
"angular",
"typescript",
"angular8"
] |
[
"Angular.js: How to change div width based on user input",
"I have an input box which accepts the value for div width. \nUsing angular.js, How can you change div's width based on user input?\nI have implemented following code after referring this fiddle.http://jsfiddle.net/311chaos/vUUf4/4/ \n\nMarkup: \n\n <input type=\"text\" id=\"gcols\" placeholder=\"Number of Columns\" ng-model=\"cols\" ng-change=\"flush()\"/>\n\n<div getWidth rowHeight=cols ng-repeat=\"div in divs\">{{$index+1}} aaaaaa</div>\n\n\ncontroller.js\n\nvar grid = angular.module('gridApp', []);\n\ngrid.controller('control', ['$scope', function ($scope) {\n\n /* code for repeating divs based on input*/\n $scope.divs = new Array();\n $scope.create=function(){ //function invoked on button's ng-click\n var a = $scope.cols;\n for(i=0;i<a;i++)\n {\n $scope.divs.push(a);\n }\n alert($scope.divs);\n };\n\n\n}]);\n\ngrid.directive('getWidth', function () {\n return {\n restrict: \"A\",\n scope: {\n \"rowHeight\": '='\n },\n link: function (scope, element) {\n\n scope.$watch(\"rowHeight\", function (value) {\n console.log(scope.rowHeight);\n $(element).css('width', scope.rowHeight + \"px\");\n }, false);\n }\n }\n});\n\nfunction appCtrl($scope) {\n $scope.cols = 150; //just using same input value to check if working\n\n\n}\n\n\nUPDATE\nMy ultimate goal is to set width of that div. When I call inline CSS like following I achieve what I want.\n\n<div get-width row-height=\"{{cols}}\" ng-repeat=\"div in divs\" style=\"width:{{cols}}px\">{{$index+1}} aaaaaa</div>\n\n\nBut this wouldn't be always efficient if number of divs goes high. So, again question remains, how to do this via angular script?"
] | [
"javascript",
"html",
"css",
"angularjs"
] |
[
"using a View in a Named Query",
"I have a named Query that uses a view. I am unable to create a class mapping because this view does not have a Id column. I created a named query and set it to return it as a class, defining all the return values. However, I still receive a KeyNotFound Exception. If I set all of the columns to It returns the List. How can you tell NHibernate to map this to a class.\n\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\">\n <sql-query name=\"GetAvailablePermissions\" read-only=\"true\">\n <return alias=\"perm\" class=\"Domain.AcsAvailablePermission, Domain\">\n <return-property name=\"Id\" column=\"PermissionId\"/>\n <return-property name=\"Code\" column=\"Code\"/>\n <return-property name=\"Category\" column=\"Category\"/>\n <return-property name=\"Description\" column=\"Description\"/> \n </return>\n <![CDATA[\n SELECT\n [PermissionId]\n , [Code]\n , [Category]\n , [Description]\n FROM [dbo].[vw_Permission]\n WHERE\n [SiteId] = :SiteId\n ]]>\n </sql-query>\n</hibernate-mapping>"
] | [
"nhibernate",
"nhibernate-mapping"
] |
[
"Calling function from iframe not loading",
"I am trying to call a parent function from inside of an iframe to remove the container div however it seems to be failing and I am unsure why. I am wondering if it is because the iframe loads before the parent window and so the function is not yet defined.\n\nHere is my parents html:\n\n<div align=\"center\" id=\"review-embed-container\" style=\"position: relative;\">\n <iframe frameBorder=\"0\" id=\"review-embed-iframe\" src=\"http://www.trampolinesshop.co.uk/review/Review-Embed.php?code=1&prod_name=test\" scrolling=\"no\" width=\"100%\">\n </iframe>\n</div>\n\n\nAnd the parents jQuery:\n\nfunction InjectIframeReview() {\n $(\"#review-embed-container\").hide();\n};\n\n\nNow inside the Iframe page I have php that checks to see if reviews are placed, if there are no reviews it calls this javascript:\n\n<script type=\"text/javascript\">\n window.parent.InjectIframeReview();\n</script>\n\n\nI can't seem to find out why the function is not firing correctly, you can see the full website it is loaded on here:\n\nWebsites JQuery (function is on line 387):\nhttp://www.trampolinesshop.co.uk/acatalog/custom.js\n\nA page that has no reviews (iframe on line 902 of source code):\nhttp://www.trampolinesshop.co.uk/acatalog/8ft_Skyhigh_Trampoline_and_Safety_Enclosure.html\n\nThe Iframe that gets loaded (no review for product so just has javascript):\nhttp://www.trampolinesshop.co.uk/review/Review-Embed.php?code=3271d&prod_name=8ft%20Skyhigh%20Trampoline%20and%20Safety%20Enclosure\n\nA page that has a review:\nhttp://www.trampolinesshop.co.uk/acatalog/8ft_Fun_Pink_Trampoline.html\n\nThe Iframe that gets loaded (has review so does not use javascript):\nhttp://www.trampolinesshop.co.uk/review/Review-Embed.php?code=3269&prod_name=8ft%20Skyhigh%20Pink%20Trampoline%20and%20Safety%20Enclosure"
] | [
"javascript",
"jquery",
"iframe"
] |
[
"Summary of log types per day",
"tbl_logs has the following columns:\n\nlogtimestamp, level, message\n\nWhere 'level' can be: error, warning, info, ok\n\nI would like to create a query that returns a summary of log quantities of each level per day:\n\nlogdate, error_qty, warning_qty, info_qty, ok_qty\n\n\nCan this be done in a single query?\n\nI tried:\n\nSELECT DATE(logtimestamp) as logdate, count(*) as qty, level\nFROM tbl_logs\nGROUP BY logdate, level\nORDER BY logdate DESC\n\n\nBut this query returns one ROW per logdate/level combination (dates will be repeated).\n\nI also attempted to create a query using UNION:\n\nSELECT count(*) as error_qty ... WHERE level = 'error'...\nUNION \nSELECT count(*) as warning_qty ... WHERE level = 'warning'...\n...\n\n\nbut couldn't make it work.\n\nCan this be done in one single query, or do I need to do several queries and combine the outputs on my application?"
] | [
"mysql",
"group-by",
"summary"
] |
[
"Spring Data JPA - Unable to reuse parameter",
"I'm attempting to use spring-data-jpa to select an entity containing all of the provided parameter values.\n\nMy Entity looks as follows:\n\n@Entity\n@Table(name = \"books\", schema = Constants.BENCHMARKS)\n@NamedEntityGraph(name = \"BookEntity.all\", attributeNodes = @NamedAttributeNode(\"aliases\"))\npublic class BookEntity\n{\n @Id\n private String isbn = UUID.randomUUID().toString();\n\n @Column(name = \"title\")\n private String title;\n\n @Column(name = \"description\")\n private String description;\n\n @CollectionTable(schema = Constants.BENCHMARKS, name = \"book_tags\", joinColumns = @JoinColumn(name = \"book_isbn\"))\n @ElementCollection(fetch = FetchType.EAGER)\n private List<String> aliases;\n}\n\n\nMy method looks as follows\n\n@EntityGraph(value = \"BookEntity.all\", type = EntityGraphType.LOAD)\n@Query(\"SELECT x FROM BookEntity x \" + \n \"WHERE x IN (\" + \n \" SELECT y FROM BookEntity y\" + \n \" INNER JOIN y.aliases yt\" + \n \" WHERE yt IN (\" + \n \" :aliases\" + \n \" )\" + \n \" GROUP BY y\" + \n \" HAVING COUNT( DISTINCT yt) = COUNT(\" + \n \" :aliases)\" + \n \" )\")\nIterable<BookEntity> findAllByAliasesContainsAll(@Param(\"aliases\") Collection<String> aliases); \n\n\nWhen I run the method I get the following exception\n\nCaused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: : near line 1, column 139 [select b from org.cubrc.example.hibernate.books.BookEntity b where :aliases member of b.aliases group by b.isbn having count(b) >= count( :aliases )]\n\n\nI've already looked at How do I reuse a parameter witha Spring-Data-JPA Repository? which is where I got my original syntax. I've also looked at a number of other posts, but none of them are actually attempting to reuse a parameter in their query. Certainly none of them are working on as basic of an example (I'm not even mixing entities here).\n\nI guess to sum things up with an actual question, what is wrong with my query syntax that is causing it to parse in correctly?\n\nResponse: Try including the parameter a second time\n\nPassing in the parameter a second time did not change the result, it still complains about the colon, leading me to believe that it's not actually a reuse issue so much as an issue with count\n\nResponse: Try using SIZE instead of COUNT\n\nChanging count to SIZE resulted in a new error \n\nCaused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Unexpected expression ? found for collection function size [SELECT x FROM org.cubrc.example.hibernate.books.BookEntity x WHERE x IN ( SELECT y FROM org.cubrc.example.hibernate.books.BookEntity y INNER JOIN y.aliases yt WHERE yt IN ( :aliases ) GROUP BY y HAVING COUNT( DISTINCT yt) = SIZE( :aliases) )]\n\n\nWorking Workaround:\n\nI tried using the size manually, as in the following\n\n@EntityGraph(value = \"BookEntity.all\", type = EntityGraphType.LOAD)\n@Query(\"SELECT x FROM BookEntity x \" + \n \"WHERE x IN (\" + \n \" SELECT y FROM BookEntity y\" + \n \" INNER JOIN y.aliases yt\" + \n \" WHERE yt IN (\" + \n \" :aliases\" + \n \" )\" + \n \" GROUP BY y\" + \n \" HAVING COUNT( DISTINCT yt) = (\" + \n \" :aliasesSize)\" + \n \" )\")\nIterable<BookEntity> findAllByAliasesContainsAll(@Param(\"aliases\") Collection<String> aliases, @Param(\"aliasesSize\") long aliasesSize);\n\n\nDoing so worked, so I'll use it for now. However, it'd be nice to avoid making the user pass in two parameters when I should really only need one."
] | [
"hibernate",
"spring-data-jpa"
] |
[
"Is this normal in CSS?",
"The background of the BODY tag extends to fit the sidebar, but the background of the #wrap element doesn't. Why?\n\nHTML:\n\n<div id=\"wrap\">\n <div id=\"side\"> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> test <br> </div>\n</div> \n\n\nCSS:\n\nbody{\n background: #333; \n}\n\n#wrap{\n position: relative;\n background: #cc4; \n}\n\n#side{\n position: absolute;\n top: 0;\n left: 0;\n}\n\n\n#Fiddle"
] | [
"html",
"css"
] |
[
"Importing cyrillic text to illustrator via xml variable",
"I'm working on a a little project that takes information from sql through php and saves into xml files which are then imported into illustrator.\n\nThe problem is that when using Cyrillic text in the xml file it does not appear once imported into illustrator just a blank space.\n\nbelow is a simple one variable xml file I have been using to try to crack the problem.\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20001102//EN\" \"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd\" [\n <!ENTITY ns_graphs \"http://ns.adobe.com/Graphs/1.0/\">\n <!ENTITY ns_vars \"http://ns.adobe.com/Variables/1.0/\">\n <!ENTITY ns_imrep \"http://ns.adobe.com/ImageReplacement/1.0/\">\n <!ENTITY ns_custom \"http://ns.adobe.com/GenericCustomNamespace/1.0/\">\n <!ENTITY ns_flows \"http://ns.adobe.com/Flows/1.0/\">\n<!ENTITY ns_extend \"http://ns.adobe.com/Extensibility/1.0/\">\n]>\n<svg>\n<variableSets xmlns=\"&ns_vars;\">\n <variableSet varSetName=\"binding1\" locked=\"none\">\n <variables>\n <variable category=\"&ns_flows;\" varName=\"Variable1\" trait=\"textcontent\"></variable>\n </variables>\n <v:sampleDataSets xmlns:v=\"&ns_vars;\" xmlns=\"&ns_custom;\">\n <v:sampleDataSet dataSetName=\"Data Set 1\">\n <Variable1>\n <p>Пена Для Ванн</p>\n </Variable1>\n </v:sampleDataSet>\n </v:sampleDataSets>\n </variableSet>\n</variableSets>\n</svg>\n\n\nany help would be greatly appreciated, this has been holding the project up for days now!"
] | [
"xml",
"adobe",
"adobe-illustrator"
] |
[
"Numpy to QImage Crashing",
"The following code crashes on clicking the button or after a few clicks when the signal is emitted from thread and caught in the main gui.\nfrom PyQt5 import QtCore, QtGui, QtWidgets\nfrom PyQt5.QtGui import QPixmap, QImage\nfrom PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QThread\nimport numpy as np\nimport time\nfrom PyQt5.QtWidgets import QApplication, QDialog, QPushButton, QVBoxLayout\n\n\ndef convert_np_qimage(cv_img , width, height):\n h, w, ch = cv_img.shape\n bytes_per_line = ch * w\n qim = QtGui.QImage(cv_img.data, w, h, bytes_per_line, QtGui.QImage.Format_RGB888)\n print(qim.size())\n return qim\n\nclass VideoThread(QThread):\n change_qimage_signal = pyqtSignal(QImage)\n \n def __init__(self):\n super().__init__()\n\n def run(self):\n print("run")\n width = 1280\n height = 1280\n \n cv_img = np.zeros([height,width,3],dtype=np.uint8)\n cv_img.fill(255)\n print("image shape: ", cv_img.shape)\n\n qimg = convert_np_qimage(cv_img, width, height)\n self.change_qimage_signal.emit(qimg)\n print("emitted")\n\n \n def stop(self):\n self.wait()\n\nimport sys\n\nclass Dialog(QDialog):\n\n def __init__(self):\n super(Dialog, self).__init__()\n Dialog.resize(self, 640, 480)\n \n button=QPushButton("Click")\n button.clicked.connect(self.startThread)\n \n mainLayout = QVBoxLayout()\n mainLayout.addWidget(button)\n \n \n self.setLayout(mainLayout)\n self.setWindowTitle("QImage Example")\n \n def startThread(self):\n self.thread = VideoThread()\n self.thread.change_qimage_signal.connect(self.getPixmap)\n self.thread.start() \n \n def getPixmap(self, qimg):\n print("got qimage")\n qpixmap = QPixmap.fromImage(qimg)\n \n\nif __name__ == '__main__':\n app = QApplication(sys.argv)\n dialog = Dialog()\n sys.exit(dialog.exec_())\n\nThe program doesn't crash if height and width are set to small number say 3.\nThe program also doesn't crash if we convert qimage to qpixmap before emitting and change the signal\ntype to QPixmap.\nThe program was originally written to get images from webcam using opencv. The numpy array created\nby opencv crashes too for big image sizes.\nThe OS used is Windows10, pyqt version is 5.12.3\nAny idea what might be the reason for the crash?"
] | [
"numpy",
"pyqt5",
"qthread",
"qtgui",
"qimage"
] |
[
"How do I get the start and end character indices of an HTML element?",
"Trying to figure out how to get the range of characters affected by an element in an overall HTML document using JavaScript. I only need webkit compatible code.\n\nI'm thinking I'm just not searching for the right terms?\n\nHere is an example of what I'll be working with:\n\n<body>\nThis is the way we \n<span class=\"highlight\"><img src=\"image.png\" />\nsearch the <span class=\"heavy\">text</span>\n</span>, \nsearch the text, search the text, \nearly in the morning!\n</body>\n\n\nIf I get a reference to the span with the class highlight...\nI want to know the start and end index of the characters that the highlight span contains, including the text in it's child spans, but, of course, NOT the characters that are part of the element declarations themselves, such as \"<\", \">\" or anything between them."
] | [
"javascript",
"html"
] |
[
"rpcapd - what is the password when not using null authentication",
"I'm running rpcapd on a Raspberry which serves as a WiFi access point to trace/sniff network traffic by WiFi users.\n\nI can run rpcapd in null authentication mode and access the interfaces from my windows machine using wireshark and it works perfect.\n\nHowever, I'd like to expose these capture interfaces to multiple users and i thought it might be good to not use null authentication but have at least a little barrier for unwanted users.\n\nIf i don't use the \"-n\" argument, what is the user/pass? I searched Google but i can not really find a source which leads me to the answer.\n\nI tried creating a second user which has a password and ran rpcapd from this users but still if i use these users Linux credentials, wireshark tells me it can not find any interfaces. When i re-run rpcapd with the -n argument everything works.\n\nSo... i must have overseen something!? What is the username and password for non null authentication operation or where can i specify one?\n\nThanks a lot!\n\nLet me know if you need further info to help. Thanks!"
] | [
"authentication",
"networking",
"raspberry-pi",
"wireshark"
] |
[
"elevateZoom not quite working in rails",
"I'm using a front-end template that I downloaded for my rails app, and mostly it works fine, but I can't get the elevateZoom functionality to work properly.\n\nHere's their code:\n\n<div class=\"thumbnails-show grid_6 omega\">\n <img src=\"images/details-thumb-1.jpg\" data-zoom-image=\"images/details-1.jpg\" />\n</div>\n\n\nand here's mine:\n\n<div class=\"thumbnails-show grid_6 omega\">\n <img src=\"<%= image_tag(@product.avatar.url(:medium)) %>\" data-zoom-image=\"<%= image_tag(@product.avatar.url(:large)) %>\" />\n</div>\n\n\nThis is the relevant js:\n\nvar zoom_config = {zoomWindowFadeIn: 500,\n zoomWindowFadeOut: 500,\n lensFadeIn: 500,\n lensFadeOut: 500,\n tint:true,\n tintColour:'#ebebeb',\n tintOpacity:0.5,\n borderSize: 0,\n zoomWindowWidth:100,\n zoomWindowHeight:300,\n lensBorderSize: 3,\n lensBorderColour: '#66bdc2', };\n\n $('.thumbnails-show img').elevateZoom(zoom_config);\n\n $('.thumbnails a').click(function(){\n var img = $('img', $(this)).clone();\n img.attr('data-zoom-image', $(this).attr('href'));\n\n img.elevateZoom(zoom_config);\n\n $('.thumbnails-show').html(img);\n return false;\n });\n\n\nBasically what's happening is this text is still displayed in the view: \" data-zoom-image=\"\" /> along with the image for an unfound image, and the second 'zoomed' image isn't displaying properly.\n\nCan anyone see where I'm going wrong or show me how to make it behave properly as in the original template? It seems as though a mysterious extra \" is being added in somehow but I can't tell why or how.\n\nThanks for any help..."
] | [
"jquery",
"ruby-on-rails",
"zooming"
] |
[
"Flutter Updated Listview from FCM Push Notifications?",
"So far I am able to retrieve a single push notification from Firebase Cloud Messaging and display it on the screen. But I'd like to save all push notifications as a listview. So each time a new push notification is received, the listview is rebuilt and updated with the latest push notification at the top. Ideally, the user should be able to scroll back and see all the push notifications they've ever received.\nIs this possible? Here's the code for displaying a single notification;\nimport 'package:flutter/material.dart';\nimport 'package:fcm_config/fcm_config.dart';\n\nFuture<void> _firebaseMessagingBackgroundHandler(\n RemoteMessage _notification) async {\n\n String title = _notification.data["title_key"];\n String body = _notification.data["body_key"];\n FCMConfig.displayNotification(title: title, body: body);\n}\n\nvoid main() async { FCMConfig.init(onBackgroundMessage: _firebaseMessagingBackgroundHandler).then((value) {\n FCMConfig.subscribeToTopic("test_fcm_topic");\n });\n\n runApp(MyHomePage());\n}\n\nclass MyHomePage extends StatefulWidget {\n MyHomePage({Key key}) : super(key: key);\n @override\n _MyHomePageState createState() => _MyHomePageState();\n}\n\nclass _MyHomePageState extends State<MyHomePage>\n with FCMNotificationMixin, FCMNotificationClickMixin {\n RemoteMessage _notification;\n final String serverToken ='myservertoken';\n\n @override\n void initState() {\n super.initState();\n }\n\n @override\n Widget build(BuildContext context) {\n return MaterialApp(\n home: Scaffold(\n body: Center(\n child: Column(\n mainAxisAlignment: MainAxisAlignment.center,\n children: <Widget>[\n ListTile(\n title: Text("title"),\n subtitle: Text(_notification?.notification?.title ?? ""),\n ),\n ListTile(\n title: Text("Body"),\n subtitle: Text(\n _notification?.notification?.body ?? "No notification"),\n ),\n if (_notification != null)\n ListTile(\n title: Text("data"),\n subtitle: Text(_notification?.data?.toString() ?? ""),\n )\n ],\n ),\n ),\n ),\n );\n }\n\n @override\n void onNotify(RemoteMessage notification) {\n _firebaseMessagingBackgroundHandler(notification);\n setState(() {\n _notification = notification;\n });\n }\n\n @override\n void onClick(RemoteMessage notification) {\n setState(() {\n _notification = notification;\n });\n print(\n "Notification clicked with title: ${notification.notification.title} && body: ${notification.notification.body}");\n }\n}"
] | [
"flutter",
"listview",
"dart",
"firebase-cloud-messaging"
] |
[
"When to use imshow over pcolormesh?",
"I often find myself needing to create heatmap-style visualizations in Python with matplotlib. Matplotlib provides several functions which apparently do the same thing. pcolormesh is recommended instead of pcolor but what is the difference (from a practical point of view as a data plotter) between imshow and pcolormesh? What are the pros/cons of using one over the other? In what scenarios would one or the other be a clear winner?"
] | [
"python",
"matplotlib"
] |
[
".htaccess Redirect 404 Error",
"I've been trying to get this right for 1 or 2 hours now, searching for similar problems and trying the solutions. This is probably is one of those thing again where the answer is really obvious.\n\nI am trying to redirect everyone who is accessing domain.com/title/whatever and domain.com/title/anotherpage to a PHP script, but it is giving me a 404 error when I try to access the page.\n\nI am using this code in my htaccess file:\n\nRewriteEngine on\nRewriteRule ^/plugins/(.*)$ /yourscript.php?plugin=$1 [L]\n\n\nHere is a full copy of my .htaccess file.\n\nErrorDocument 404 /error/404.php\n\n#Prevent full listing of files\nOptions -Indexes \n\n#Redirect plugins\n<IfModule mod_rewrite.c>\nRewriteEngine on\nRewriteRule ^/plugins/(.*)$ /foobar.php?plugin=$1 [NC,L]\n</IfModule>\n\n#Hide .php extension\n<IfModule mod_rewrite.c>\nRewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME}\\.php -f\nRewriteRule ^(.*)$ $1.php [NC,L]\n</IfModule>\n\n#compress\nAddOutputFilterByType DEFLATE text/plain\nAddOutputFilterByType DEFLATE text/html\nAddOutputFilterByType DEFLATE text/xml\nAddOutputFilterByType DEFLATE text/css\nAddOutputFilterByType DEFLATE application/xml\nAddOutputFilterByType DEFLATE application/xhtml+xml\nAddOutputFilterByType DEFLATE application/rss+xml\nAddOutputFilterByType DEFLATE application/javascript\nAddOutputFilterByType DEFLATE application/x-javascript \n\n\nI've tried placing the foobar.php script in both the root folder and in a folder name plugins.\n\nThank you in advance for any help."
] | [
".htaccess"
] |
[
"Sorting by an item first in javascript array",
"This is an example of my array :\n[\n 1: { name: 'blablabla', difficulty: 'A2' },\n 2: { name: 'bla', difficulty: 'A1' },\n 3: { name: 'blablablabla', difficulty: 'B1' },\n 4: { name: 'blablablabla', difficulty: 'B2' },\n 5: { name: 'blablablabla', difficulty: 'A2' }\n]\n\nmy_level: 'B2'\n\nI want to sort the array so that my level of difficulty is the first item, i tried to use sort() but it's only to sort by 'ASC' or 'DESC', anyone have an idea of how to do it ? Thanks !"
] | [
"javascript",
"arrays",
"sorting"
] |
[
"How to get min and max number from selected rows of table?",
"This refers to my previous question.\n\nHow to highlight/color multiple rows on selection?\n\n<table id=\"toppings\" border=\"1\" cellpadding=\"2\">\n <tr id=\"id1\">\n <td>3</td>\n <td>row12</td>\n <td>row13</td>\n </tr>\n <tr id=\"id2\">\n <td>12</td>\n <td>row22</td>\n <td>row23</td>\n </tr>\n <tr id=\"id3\">\n <td>15</td>\n <td>row32</td>\n <td>row33</td>\n </tr>\n <tr id=\"id4\">\n <td>22</td>\n <td>row42</td>\n <td>row43</td>\n </tr>\n <tr id=\"id5\">\n <td>23</td>\n <td>row52</td>\n <td>row53</td>\n </tr>\n <tr id=\"id6\">\n <td>55</td>\n <td>row62</td>\n <td>row63</td>\n </tr>\n</table>\n\n\nJavascript Code:\n\n//Get list of rows in the table\nvar table = document.getElementById(\"toppings\");\nvar rows = table.getElementsByTagName(\"tr\");\n\nvar selectedRow;\n\n//Row callback; reset the previously selected row and select the new one\nfunction SelectRow(row) {\n if (selectedRow !== undefined) {\n selectedRow.style.background = \"#d8da3d\";\n }\n selectedRow = row;\n selectedRow.style.background = \"white\";\n}\n\n//Attach this callback to all rows\nfor (var i = 0; i < rows.length; i++) {\n var idx = i;\n rows[idx].addEventListener(\"click\", function(){SelectRow(rows[idx])});\n}\n\n\nBut this time I have added an event to table for row selection and trying to get min and max value from selected rows (first column). Like above table, if I select middle four rows, i should get min = 12 and max = 23. How can this be implemented?"
] | [
"javascript",
"html-table"
] |
[
"How to separate a dataframe in 2 different ones based on variable datatypes in R",
"I have a dataframe with numeric variables and categorical factors and i want to separate the dataframe into 2: one with the numeric variables and one with the categorical factors.I am new to R and i am lost.I have tried the split function but i can't work it out.I tried using for loops for checking the variables with is.factor but nothing seems to work!Please help!"
] | [
"r",
"dataframe"
] |
[
"Setting position of JQuery dialog buttons causes buttonpane background color issue",
"I have created a JQuery dialog in my web page, and in it I have set up a couple of buttons. I wanted to ensure that the \"Register Me\" button appeared in the left corner of the buttonpane, and that the \"Maybe Later\" button appeared in the right corner, so I put in some code to handle this. Here's the complete code of the .dialog() declaration:\n\n $(\"#register\").dialog({\n create : function(ev, ui) {\n $(this).parent().find('.ui-dialog-buttonpane').css('background-color', '#ffffff;');\n },\n appendTo: \"form\",\n autoOpen: false,\n show: { effect: \"fadeIn\" },\n hide: { effect: \"fadeOut\" },\n modal: true,\n draggable: false,\n minWidth: 750,\n minHeight: 400,\n resizable: false,\n dialogClass: \"no-close\",\n buttons:\n [\n {\n class: \"firstButton\",\n text: \"Register Me\",\n click: function () {\n $.ajax({\n url: \"/services/register.asmx\",\n timeout: 30000,\n type: \"POST\",\n data: $('#modalform').serialize(),\n dataType: 'json',\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n alert(\"An error has occurred making the request: \" + errorThrown)\n },\n success: function (data) {\n $(this).dialog(\"close\");\n }\n })\n }\n },\n {\n class: \"lastButton\",\n text: \"Maybe Later\",\n click:function () {\n $(this).dialog(\"close\");\n }\n }\n ]\n });\n\n\nAs you can see from the button declarations, I added a class for each one that floats the button to the left or right as desired. This all works, and the buttons appear on the left and right corners of the dialog as I expected.\nThe problem is that as long as I don't try to position the buttons, they appear on a white background as part of the \"buttonpane\" of the dialog. The moment I set the positioning of the buttons though, the background of the underlying buttonpane goes transparent, so now the buttons appear to float below the dialog, like this:\n\n\n\nIf you look at the dialog code, you'll see that I tried to resolve this by intercepting the create event in the dialog declaration to override jquery styling:\n\n$(this).parent().find('.ui-dialog-buttonpane').css('background-color', '#ffffff;');\n\n\nThis, however, doesn't seem to work. So I decided to try to change it after creation of the dialog by adding this code:\n\n $('.ui-dialog-buttonpane').css('background-color', 'white');\n\n\nNo joy on this either. I've tried setting up code in my stylesheet to achieve this as well, using this:\n\n.ui-dialog-buttonpane {\n background-color:#ffffff !important;\n}\n\n\nIt also has no effect. Can anyone tell me what I'm missing here, because I'm out of ideas. Thanks!"
] | [
"jquery",
"css",
"jquery-ui",
"jquery-ui-dialog"
] |
[
"Debugging a Python Script (With Flags) in Spyder",
"Forgive me, I'm coming from a MATALB background, and I'm still a litte confused at how the Python \"modules\" all work together. \n\nI installed Anaconda, and I'm using the Spyder IDE with the default IPython console (I think I said that all right). I'm going through the Google Education lessons, and I'm presented with the challenge of calling a particular code like so:\n\n./wordcount.py {--count | --topcount} file\n\n\nI figured out (thanks to this thread) that I could run this from IPython within Spyder:\n\n%run wordcount.py --count alice.txt\n\n\nThe problem that I'm having is that when I call wordcount.py in this way from the console, it disregards any of the breakpoints I have set and I need to line-by-line step through my code. Alternatively, if I try to run the dubugger that's part of Spyder, I can't seem to specify any of those flag command line arguments.\n\nWhat am I missing? Thanks!"
] | [
"python",
"breakpoints",
"spyder"
] |
[
"Can't remove a directory in Unix",
"I've got a seemingly un-deletable directory in Unix that contains some hidden files with names that start with .panfs. I'm unable to delete it using either of these commands:\n\nrm -R <dir>\nrm -Rf <dir>\n\n\nDoes anyone have any suggestions?"
] | [
"linux",
"unix",
"directory",
"rm"
] |
[
"NodeJs and Apache2 project",
"Can both run on same https? Will I face conflicts and if I do which in server and which in code? Should I need additional configuration or any specific approach or tactics?"
] | [
"node.js",
"apache2"
] |
[
"asking red turtles to avoid other turtles and move to one of its neighbor which is empty and has highest conc",
"I'm new to Netlogo. Here I'm trying ask red turtles to move towards the hight conc. patches. yellow turtles do not move. I did that! but I also want to ask the red turtles to avoid the patches which have yellow or red turtles on them and move to the neighbor of high conc.. In my code I asked them to stop once they become next to an occupied patch just because I couldn't do it. I also want to avoid getting 2 turtles on the same patch at any time. Any one could help me with that please?\n\n patches-own [conc] \n\nto set-up\nclear-all\nask patch random-pxcor random-pycor [\nset conc 200\nset pcolor scale-color red conc 0 1]\ncrt 5 [setxy random-xcor random-ycor set shape \"circle\" set color red]\ncrt 20 [setxy random-xcor random-ycor set shape \"circle\" set color yellow]\nreset-ticks\nend\n\n\n\n\nto go\ndiffuse conc 0.1\nask patches [set pcolor scale-color red conc 0 1]\nask turtles with [color = red]\n[ifelse not any? turtles-on neighbors\n[if [conc] of max-one-of neighbors [conc] > conc [\nface max-one-of neighbors4 [conc]\n move-to max-one-of neighbors4 [conc]]]\n\n[stop]\n\n]\n\ntick\n\nend"
] | [
"netlogo"
] |
[
"OpenWRT looking for files in staging_dir at compile time",
"I'm trying to compile some OpenWRT packages, A and B, where B depends on some header files from A.\n\nThese packages use automake, and when I compile A, it copies its header files to build_dir/../package/include/...\n\nThe problem is that now I need to use them in package B, and when I add the command someheaders_HEADERS, OpenWRT looks for them in staging_dir/.../usr/include.\n\nI could copy these files over on the \\install phase of the OpenWRT compile process, but that seems a bad approach.\n\nHow can this be correctly solved?\n\nThanks!"
] | [
"autotools",
"automake",
"openwrt"
] |
[
"POST or GET selected value from select option before submit (same page)",
"I have done searching this question here but there is no suitable answer for my problem. So to be more specific, I have 2 select option which is floor and room. Both selection displayed based on database. So is there a syntax that can get the selected floor id so I can do my query to display the specific room for the selected floor before submit? Here's my code :\n\n<form name=\"form\" method=\"POST\"> \n <div class=\"form-group\">\n <div><label>Floor Name</label></div>\n <select class=\"form-control\" id=\"floorid\" name=\"existfloorname\">\n <option>None</option>\n <?php \n $result = $conn->query(\"select * from floors\");\n while ($row = $result->fetch_assoc()) \n {\n ?><option id=\"<?php echo $row['floorid'];?>\" value=\"<?php echo $row['floorname']; ?>\"><?php echo $row['floorname']; ?></option><?php\n } \n ?>\n </select>\n </div>\n\n\n <div class=\"form-group\">\n <div><label>Room Name</label></div>\n <select class=\"form-control\" name=\"existroomname\">\n <option>None</option>\n <?php \n $result = $conn->query(\"select * from rooms where floorid = '\".GETSELECTEDFLOORID.\"'\");\n while ($row = $result->fetch_assoc()) \n {\n ?><option value=\"<?php echo $row['roomname']; ?>\"><?php echo $row['roomname']; ?></option><?php\n }\n ?>\n </select>\n </div>\n <input type=\"submit\" name=\"delete\" value=\"Delete\">\n</form>\n\n\nThis is how the form looks like"
] | [
"php",
"jquery",
"ajax"
] |
[
"Is it possible to upgrade the version of less compiler in sails.js",
"Hi Im using sails in my application (version 0.9.16).\n\nHow do I know the version of the less compiler in sails.js? I've tried to look it in a package inside the node_modules, but none of them could indicated the less compiler version. Is it also possible to upgrade the less-compiler (not the whole sails.js)?\n\nMany thanks"
] | [
"less",
"sails.js"
] |
[
"Find out where a GitHub repo was forked from",
"In this picture, you are told where the repo was forked from. I've been looking through the github2 api and I can't seem to find a way to get this information. Any ideas?"
] | [
"git",
"github"
] |
[
"AES 256 Encryption support in Java 5",
"I have seen that AES 256 Encryption Decryption works on Java 6 and above.\n\nHow can i achieve the same thing in Java 5 (apart from policy files)"
] | [
"java",
"encryption"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.