texts
sequence
tags
sequence
[ "Is it possible to generate a color?", "I know there has already been posts on this, but I still don't quite get it.. I want to have a script that automatically generates a color code ({color:Lighter}) which would be a lighter version of {color:Links}. I would want the script to take the colorcode of {color:Links} use the hex code, (it has to be hex) and make it like 10 times lighter. Very close to white, but off white enough so that you can still see the color. Can someone please provide me with a code?" ]
[ "javascript", "colors" ]
[ "Nested tables in database", "I am working on a project, that has multiple processes and each process has different data items to process. Data items (For different processes) have different columns (but always the same columns for the same process).\n\nAt first, I assumed that it would be fine to have a table for all of the processes and then, whenever a new process is created, another table with the item data could be created as well, but it turns out, that there would be a new process way to often to create new tables all the time. Then I was looking into nested tables but found out that there is no concept of the nested tables in MySQL. (I've heard that this could be done with MariaDB. Has anyone worked with it?)\n\nTo make it a bit more clear here is the current concept (columns and values here are only approximate to make the concept more clear):\n\nprocess_table:\n\nID | process_name | item_id | ...\n---------------------------------\n1 | some_process | 111 | ... \n2 | other_process| 222 | ... \n3 | third_process| 333 | ... \n4 | third_process| 444 | ...\n...\n\n\nitem_tables:\n\nitem_table_1:\nID | Column1 | Column2 | process_name | ...\n--------------------------------------\n111| val1 | val2 | some_process | ...\n...\n\nitem_table_2:\nID | Column4 | Column5 | process_name | ...\n--------------------------------------\n333| val1 | val2 | third_process| ...\n444| val3 | val4 | third_process| ...\n...\n\n\nSo then for each new process, there would be new item_table and for each process, it needs to have different column names, and in item table, the specific item would be linked to 'item_id' column in the process table.\n\nI think that the easiest solution (when creating new tables all the time is not an option) for this would be nested tables, where, in the process table, there could be another column, that would hold the item_table values and then those could have different columns based on the process itself.\n\nSo the big question is: Is there at least anything similar to nested tables or anything else in MySQL that would help me implement structure like this without creating new tables all the time, and if not, then maybe there are some tips or reviews about MariaDB? Maybe someone has already implemented nested tables with it (If that is possible at all)\n\nOne of the solutions would be to have one table for the 'item_table' and then have one column for all the different values for processes, that would be stored in JSON format for example, but this would make it a lot harder to read the table.\n\nFor example:\n\nitem_table:\nID | process_name | data\n--------------------------------------\n111| some_process | {values: {column1:val1,column2:val2,...}}" ]
[ "mysql", "database", "mariadb", "nested-table" ]
[ "C# WUA IUpdate, Obtain MD5 Checksum before downloading Updates?", "Is it possible to obtain MD5 Checksum for a windows update file that has not been downloaded yet?\n\nThe reason for this is to somehow obtain that checksum, download the file from the link provided by Microsoft, then check against that hash to ensure the file is OK.\n\nI was searching in: IUpdate Properties\n\nBut didn't find any particular property that will include this information." ]
[ "c#" ]
[ "ExtJS:: Grid's event after data show?", "I need to scrollByDeltaY after data is loaded. What event I need to take? All events, I found, works before data is shown, and scroll doesn't work." ]
[ "javascript", "extjs" ]
[ "Inserting values from JavaScript directly into MySQL database", "I'm using this JS function to grab visitor geolocation and show it on the page. This works great.\n\n function onGeoSuccess(location) {\n console.log(location);\n var strLocation = '<b>Latitude:</b> ' + location.coords.latitude + '<br />' +\n '<b>Longitude:</b> ' + location.coords.longitude + '<br />' +\n '<b>City:</b> ' + location.address.city + '<br />' +\n '<b>Country:</b> ' + location.address.country + '<br />' +\n '<b>Country Code:</b> ' + location.address.countryCode + '<br />' +\n '<b>Region:</b> ' + location.address.region + '<br />' +\n '<b>Accuracy:</b> ' + location.coords.accuracy + '<br />' +\n '<br />'\n document.getElementById('geofound').innerHTML = strLocation;\n }\n//The callback function executed when the location could not be fetched.\nfunction onGeoError(error) {\n console.log(error);\n}\n\nwindow.onload = function () {\n //geolocator.locateByIP(onGeoSuccess, onGeoError, 2, 'map-canvas');\n var html5Options = { enableHighAccuracy: true, timeout: 6000, maximumAge: 0 };\n geolocator.locate(onGeoSuccess, onGeoError, true, html5Options, 'geo-details');\n};\n\n\nNow I would like to save this information into a MySQL database upon each call. Something like:\n\nvar strLocation = '$addtodb = \"mysql_query('INSERT INTO gpsdb (lat, lon, city, country, code, region, accuracy) values (location.coords.latitude, location.coords.longitude, ...))\"'\n\n\nbut I don't think this is the correct way to do so. What would be the correct way to enter info into a database directly from JS? I do not need to echo the info as it is doing now in JS, I would rather pull that from the DB once it is entered there. The JS would be used only to insert into DB." ]
[ "javascript", "mysql", "insert", "geolocation" ]
[ "Ag Grid Cell Renderer Icons are not Clickable React", "I have a simple cell renderer that returns an icon:\n\nimport React from 'react'\nfunction ActionRenderer(params) {\n const editRedirect = (e) =>{\n console.log(\"Clicked\");\n }\n return (\n <div>\n <span class=\"actionIcons editIcon\">\n <i onClick={editRedirect} class=\"fas fa-edit\" href=\"/details\"></i>\n </span>\n </div>\n )\n}\nexport default ActionRenderer\n\n\nWhen I create my AgGrid component, I also defined a onRowClicked event.\n\n <AgGridReact\n columnDefs={columnDefs}\n defaultColDef={{ width: 160 }}\n rowData={rowData}\n frameworkComponents={frameworkComponents}\n onRowClicked={rowClicked}\n ></AgGridReact>\n\n\nAs a result, my icons are not clickable, but the row below them is. How do I make it so that the icons are clickable, but if a row is clicked outside of the icons, then the rowClicked function runs? In other words, the row click is overriding my icon click, and I was to change that.\n\nconst frameworkComponents = {\n // buttonRenderer: ButtonRenderer,\n progressBarRenderer: ProgressBarRenderer,\n actionRenderer: ActionRenderer,\n }\n\n const columnDefs = [\n {\n headerName: 'Full Name',\n field: 'name',\n unSortIcon: true,\n sortable: true,\n filter: true,\n lockPosition: true,\n },\n {\n headerName: 'Actions',\n field: 'actions',\n width: 140,\n lockPosition: true,\n cellRenderer: 'actionRenderer',\n },\n ]" ]
[ "reactjs", "onclick", "icons", "ag-grid", "ag-grid-react" ]
[ "store chat history in xmpp server in ios application", "Is there any way to save chat history to xmpp server permanently.\ni.e if i uninstall the application and install it again i am able to restore all the chat from the server?\n\nI am using below code :- \n\n XMPPMessageArchivingCoreDataStorage *_xmppMsgStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];\n\n NSManagedObjectContext *moc = [_xmppMsgStorage mainThreadManagedObjectContext];\n NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@\"XMPPMessageArchiving_Message_CoreDataObject\"\n inManagedObjectContext:moc];\n NSFetchRequest *request = [[NSFetchRequest alloc]init];\n [request setEntity:entityDescription];\n // [request setFetchLimit:20];\n\n NSError *error;\n NSString *predicateFrmt = @\"bareJidStr == %@\";\n NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateFrmt, userJid];\n request.predicate = predicate;\n NSArray *messages = [moc executeFetchRequest:request error:&error];\n\n\nBut in this case if i uninstall the application the messages get deleted." ]
[ "ios", "xmpp" ]
[ "Using jQuery, how can I get specific text from a remote HTML file?", "Using jQuery, I'm trying to get some text that lives in a remote HTML file. \n\nI'm using filter() with a class of 'copy' to specify which text in the remote file I want to get.\n\nThis is my code:\n\n$.get('/article.html', function(data) {\n\n console.log($(data).filter('.copy').text());\n\n});\n\n\nThis seems to work if the element with the class \"copy\" has no parent. However, if the element has a parent I am unable to get the text. Why is that? And is there a way to filter the response if the element has a parent?" ]
[ "jquery", "html", "filter", "get" ]
[ "Invalid resource directory name in android", "I am using android studio, I added gms library in my android project. And after build I got error \n\nError:Execution failed for task ':app:mergeDebugResources'.\n> D:\\Android\\Mejodo\\app\\src\\main\\res\\values-11: Error: Invalid resource directory name\n\n\nI read in other articles that, these folders are for different screen sizes. But I have only three values folders (values, values-11, values-v11), So >=11 version handle with values-11 folder.\n\nBut I don't know how to solve it.\nCan I delete these folders ?\n Please suggest something." ]
[ "android", "android-mapview", "gmsmapview" ]
[ "Writing SQL query: slightly complicated", "I have a table with primary key ID and two columns Order and Status. The value for Status could be any of 'A', 'P', 'S', 'O' or 'C'. I need to to find the values of Order for which the status is only 'A' or 'C'. How should I write an SQL query that does that? I know some basic SQL but I am unable to get my results using that.\n\nSample table:\n\nID Order Status\n\n1 1234 A\n\n2 2343 P\n\n3 4351 S\n\n4 8675 C\n\n5 9867 A\n\n6 9867 C\n\n7 1234 A\n\n8 2343 A\n\nExpected result:\n\n1234\n\n8675\n\n9867" ]
[ "sql" ]
[ "Protractor - Angular Goes out of sync for feature modules", "I am trying to run angular e2e tests using protractor.\nHere is my angular project looks like:\nAngular Project\n\nMain module\n\nHR module (Feature module)\nRegister Module (Feature module)\n\n\n\nFor my e2e tests they are running fine if I try to execute tests on main module, but for the feature modules it goes out of sync.\nThe error I am receiving is -\nAngular is not defined. and some times element is not visible within specified timeout\nSpec code:\ndescribe('Page name', () => {\n\n it('should be able to load page', async () => {\n \n navigateToPage('hr/csvimport');\n \n browser.waitForAngular();\n \n const settingsName = generateRandomNumber();\n \n let btnAdd = element(by.id('btnAdd'));\n await btnAdd.click();\n //expect condition\n });\n});\n\nNavigate to page code:\nexport const navigateToPage = async (path) => {\n console.log('set location ' + path);\n if (path === '/' || path === '') {\n await browser.get('/');\n } else {\n await browser.waitForAngular().then(() => {\n browser.get('/' + path);\n }); \n } \n};\n\nMy best guess is that because of the feature module having different script loading it some how goes out of sync with angular. currently its frozen on click only and tests stops.\nQuestion: how to make it sync with the angular?" ]
[ "angular", "protractor", "angular8", "angular-e2e" ]
[ "How to download a file from FTP and store it locally with Cordova?", "I'm struggling for some days to do that. Without success.\n\nI've found two ways that I think reasonably to follow:\n\n1: Plugin cordova-sftp-plugin.\n\nI see that it is writted to deal with 'secure ftp', but why wouldn't work in an ordinary non secure ftp? Nothing was metioned about it.\n\nI've tried so, applying the 'Use Example' from the official page, the code fells in the success callback function, but when I list the local directory, nothing was changed! It gives me no clue about what goes wrong! In true, the software does not detect nothing wrong.\n\nBefore the previous steps, I did not forget to precautionally install and enable the 'cordova-plugin-file', 'cordova-plugin-file-transfer' and 'cordova-plugin-network-information' and to add the <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /> in the AndroidManifest.xml. Tryied to save files in cordova.file.externalRootDirectory and cordova.file.externalRootDirectory + \"/Downloads/. Nothing worked.\n\n2. The macdonst FtpClient plugin.\n\nSearching for my issue, one of the first pages that appears is How to ftp a file over to a server from PhoneGap/webapp?, and beyond some further search I've found another one in a relatively old post mentioned the successful use this plugin in a Cordova application. So I can consider this plugin as a stable choice.\n\nThe problem with this method comes earlier: I coundn't even build the application after a manual installation proccess. May it is a problem in the manual installation proccess.\n\nThe official plugin documentation teachs to install it in a PhoneGap application, and not a Cordova. The steps was not replicable to Cordova, due to some differences in paths and configuration, and some others links also supports the plugin installation solely in Phonegap, not Cordova.\n\nI also tryied follow the steps in the http://antonylees.blogspot.com.br/2015/01/how-to-manually-add-cordova-plugins-to.html and Manually install Device plugin (and others) into cordova 3.0 to manually add the plugin. The steps in the first link also was not well replicable, and although the second one are more straitfoward, also does not solved the issue.\n\nBuilding it gives me a java error compilation. The first error output (what uses to cause all the following errors are):\n\nE:\\danilo\\Documentos\\projetos_cordova\\ftpDownload3\\platforms\\android\\src\\com\\phonegap\\plugins\\ftpclient\\FtpClient.java:27: \nerror: package org.apache.cordova.api does not exist\nimport org.apache.cordova.api.CallbackContext;\n\n\nVery strange. May I have to search for the org.apache.cordova.api jar file and put in the lib folder? Also, I did not forget to put the commons-net-2.2.jar in the project libs folder.\n\nCan anyone have some suggestion to succeed this? I just want to download a file through ftp protocol and save locally and so, if there's an alternative method to succeed, it will be appreciated too.\n\nThanks in advance." ]
[ "android", "cordova", "plugins", "ftp", "cordova-plugins" ]
[ "regex for N (1 to 3 digit) numbers in square brackets with commas+spaces between them", "I'm going to try to phrase this clearly... (I'm pretty new at regex). I'm working on a PDF document, with a program called AutoBookmark (from Evermap). I'm trying to set it up to link numbered citations to numbered references in a bibliography.\n\nThe goal is to match each numbered citation within brackets, and return that number within brackets, alone. In other words, if I have [85], I'd just return [85]. If I have [85, 93], I'd return both [85] and [93]. If there are more numbers in brackets, up to N numbers, I'd return N of them (in brackets). If there is a range, i.e., [85-93], I only need to return the first. \n\nSo it seems to me I'm asking this: the number (1 to 3 digits), only if preceded by EITHER an opening bracket, OR another number followed by a comma and a space, but only if that number is preceded by an opening bracket OR by a number followed by a comma and a space, but only if... you get the picture. Iterate until you hit a bracket (then return the number) or a non-number, in which case, don't return the number.\nIs this something even reasonable to ask of a regular expression? Or, since I'm doing this in a PDF, must I do a Javascript routine? (which BTW, I also don't know how to do!)\nThanks! I know I'm a newbie at this, and I'm grateful for any thoughts." ]
[ "javascript", "regex", "citations" ]
[ "How to update database based on variable api result?", "I would like to get your help to get the best and cleanest way to update my video database (MySQL).\n\nThose videos are ordered into folders and I can only grab those folders one by one.\n\nMy server in using an external api to grab thousands of videos (each video including an unique id, folder id, title, url...).\n\nAs I want to make as less api call as possible, I would like to run a daily cron job to browse each folder and add the new videos, and remove the removed video.\n\nAt the moment I can browse all the folders, looping trough each video and adding it to the database.\n\nwhile (true){\n$videos = video_get($oid, $offset, $count);\n$videos = $videos['response']['items'];\n\n$results = count($videos);\necho $results . ' || ' . $offset;\n\nif ($results > 0){\n $offset += $results;\n\n foreach ($videos as $video) {\n $i++;\n echo \"<br>Number : \" . $i;\n echo \"<br>\";\n $data = Array (\n \"id\" => $video['id'],\n \"folder_id\" => $video['folder_id'],\n \"title\" => $video['title'],\n \"url\" => $video['url']\n );\n $db->insert('videos', $data);\n }\n}\nelse {break;}\n}\n\n\nWhat I am asking is, cosidering that there are about 100000 videos, aranged into around 20 folders, would it be better to add all the video and remove the duplicate, or check if the video exist and then add it into the db in case it is a new one?\n\nAnd more important, what would be the best way to remove the video that wont be present anymore in the api request?\n\nI hope I have been clear enough, but just in case: \n\nVideos are ordered by folder.\n\nVideos can be added/removed at any time on the api side.\n\nI want to keep all the videos into my database, and update them based of if they have been new/removed videos on the api side, in order to avoid having to call the api too often.\n\nThank you for your help." ]
[ "php", "mysql", "logic" ]
[ "Need to have self-closing elements in SOAP request to web service", "I'm working on a C# client that consumes a third-party web service. I have the wsdl and xsd from them, and almost everything works fine. The only problem I'm running into is that the service expects self-closing elements within an array argument, but the SoapHttpClientProtocol (which VS used as the inherited class when creating the web reference class from the wsdl) is sending empty elements instead. I've tested this using soapUI and verified that the service will accept self-closing elements within the array or a self-closing element with the name of the array (and thus no child elements), but throws an error when it receives empty elements.\n\nHow can I set the SOAP factory to use self-closing elements when no data are present? I've searched the web and it seems this question hasn't been asked before." ]
[ "c#", "soap", "soaphttpclientprotocol" ]
[ "Split comma separated string ignore comma in single quotes and empty quotes", "I want to split comma separated string ignoring single quotes. I know its a repeated question but it didn't help me. Below is line from file, I am trying to import SQl file which consists of columns values as follows:\n\nline>>>>>\n127229,988,2,127247,'1',NULL,'/m','0',0,0,'0',NULL,NULL,'2015-02-16 06:59:37','2015-04-17 14:43:43','Resource Level','0',10523.52,0,0,10523.52,NULL,NULL,NULL,'color800000','','','N','969696',152,' ',NULL,0,0,0,',B,I'\n\nlast column value must be ',B,I' but with my code Its 'I' only \n\nI have used code\n\nString[] temp = data.split(\",(?=([^\\']*\\'[^\\']*\\')*[^\\']*$)\");\n\n\nbut unfortunately it didn't worked." ]
[ "java" ]
[ "Passing parameter with @html.beginform and dropdownlist to controller", "I have problem to submit a parameter to a controller. I want one of the parameters to the controller to be injected with the value from the dropdownlist. \n\ncode:\n\n @Html.BeginForm(\"ChangeUserNewsdesk\",\"UserList\", new { id = Model.Id , newsdeskId = VALUE FROM LIST}, FormMethod.Post) \n {\n @Html.DropDownListFor(m => m.List, Model.List)\n }\n\n\ncode for controller getting injected:\n\npublic ActionResult ChangeUserNewsdesk(Guid id, string newsdeskId)\n {\n\n }\n\n\nThe list shows up fine but i need to add a button and when its clicked, populate newsdeskId with the correct value from the Dropdownlist.\n\nThanks in advance!" ]
[ "asp.net", "view", "controller", "viewmodel" ]
[ "cannot import name 'delayed' from 'sklearn.utils.fixes'", "How should the cannot import name 'delayed' from 'sklearn.utils.fixes be solved? I have already updated sklearn and upgraded conda as well.\n~\\.conda\\envs\\base2\\lib\\site-packages\\sklearn\\metrics\\pairwise.py in <module>\n 30 from ..utils._mask import _get_mask\n 31 from ..utils.validation import _deprecate_positional_args\n ---> 32 from ..utils.fixes import delayed\n 33 from ..utils.fixes import sp_version, parse_version\n 34 \n \n ImportError: cannot import name 'delayed' from 'sklearn.utils.fixes'`" ]
[ "python", "scikit-learn", "conda" ]
[ "Is there a way to search for the contents in a dictionary in another dictionary in Python?", "Writing a program that searches through a file, containing names and addresses, and based on the user input takes certain names from the file and stores it in a dictionary and then the program reads another file, containing names and salaries, and stores the entire file in a dictionary. That part of the program seems to work fine but I need the program to search for the names in the first dictionary in the second dictionary but I am struggling to figure that part out and done a lot of research on it but have found nothing that solves my problem." ]
[ "python", "dictionary" ]
[ "Regex to separate end of string after comma for apache rewrite", "I have a working rewrite rule which extracts two numeric values as $1:\n\nexample URL: http://somedomain.tld/fixedtext-1,2-anytext\n\nRewriteRule ^fixedtext-([0-9\\,]+).+$ /skript.php?id=$1\n\n\nSo id fills up with 1,2 which is fine\n\nI need to add another value at the END of the string, separated by \",\" \n\nexample URL: http://somedomain.tld/fixedtext-1,2-anytext,3\n\nSo how is the solution to access \"3\" as $2?\n\nRewriteRule _____________ /skript.php?id=$1&other_id=$2\n\n\nOn the other hand, the regex must also work if the last parameter is not given so\n\n/fixedtext-1,2-anytext\n\nshould still work.\n\nI tried \n\nRewriteRule ^fixedtext-([0-9\\,]+).+,([0-9]+)$ /skript.php?id=$1&other_id=$2\n\n\nwhich only works if the last parameter ist set\n\nUPDATE:\n\nOk, meanwhile I have two solutions, both work on apache 1.3, but not on apache2:\n\nRewriteCond %{REQUEST_URI} (,([0-9]+))?/?$\nRewriteRule ^fixedtext-([0-9,]+) /skript.php?id=$1&other_id=%2 [L,QSA]\n\n\nor\n\nRewriteRule ^fixedtext-([0-9\\,]+).+,([0-9]+)$ /skript.php?id=$1&other_id=$2 [L]\nRewriteRule ^fixedtext-([0-9\\,]+).+$ /skript.php?id=$1 [L]\n\n\nSo there is still a solution needed which works on both apache versions." ]
[ "regex", "apache", ".htaccess", "mod-rewrite", "apache-1.3" ]
[ "Javascript jQuery - the method onchange() does not work", "my is problem is.. i try to make a form where i check if the email has the regular expression..when it haves then nothing must happen..but when it not haves ..it must set the feld empty with the method on change()..\ni try and must write the code with javascript and jQuery..but nothing happens with my code..\ni hope you can help me with this problem\nthx..\nHere my code:\n\n <div id=\"formular\">\n <p>Hier wird überprüft, ob die angegebene E-Mail Adresse korrekt ist.</p>\n <form>\n E-Mail: <input id=\"mail\" type=\"text\" name=\"mail\" onchange=\"check();\"/>\n </form>\n\n <script>\n function check(){\n var feld= $(\"#mail\");\n if(feld.value.search(/^([A-Za-z0-9_/\\.-]){1,}\\@([A-Za-z0-9]){1,}\\.([A-Za-z]){2,4}$/)===-1){\n feld.val(\"\");\n }\n }\n </script>\n\n <hr>\n </div>" ]
[ "javascript", "jquery", "html" ]
[ "Pandas list of dict in multiple excel sheets", "I have multiple lists of dict that converge to one list of dict to an excel file. The idea is to make an excel sheet for each dict, key(web1, web2), name and have the correct info in each sheet.\nThe problem of the code below is that it make a excel file of one sheet.\nAny idea on how should I do it?\n\nimport pandas as pd\n\nweb1 = [{\n 'country': 'NL',\n 'id': '56655',\n 'title': 'some 1',\n 'date': 'today',\n 'description': 'something else here',\n 'web': 'http://'\n },\n {\n 'country': 'IE',\n 'jobid': '45862',\n 'title': 'some 2',\n 'date': 'today',\n 'description': 'something else here',\n 'web': 'http://'\n }]\n\nweb2 = [{\n 'country': 'IT',\n 'id': '77878',\n 'title': 'some 3',\n 'date': 'today',\n 'description': 'something else here',\n 'web': 'http://'\n },\n {\n 'country': 'NE',\n 'id': '45862',\n 'title': 'some 4',\n 'date': 'today',\n 'description': 'something else here',\n 'web': 'http://'\n }]\n\ndata =[{\n 'website1': web1\n },\n {\n 'website1': web2\n }]\n\n\nfor x in data:\n z = str(*x).capitalize()\n for y in x.values():\n cx = pd.DataFrame(y, columns = ['country', 'title', 'date', 'id', 'web','description'])\n writer = pd.ExcelWriter('test.xlsx')\n cx.to_excel(writer, sheet_name=f'{z}')\n\n workbook = writer.book\n worksheet = writer.sheets[f'{z}']\n align_r = workbook.add_format({'align': 'right'})\n bold = workbook.add_format({'bold': True})\n color_format = workbook.add_format({'bg_color': 'green'})\n condi_color = worksheet.conditional_format('G:G', {\n 'type': 'text',\n 'criteria': 'containing',\n 'value': 'red',\n 'format': color_format})\n # set column spacing, format\n worksheet.set_column('A:A', 3)\n worksheet.set_column('B:B', 2, bold)\n worksheet.set_column('C:C', 40, bold)\n worksheet.set_column('D:D', 10, align_r)\n worksheet.set_column('G:G')\n\n\nwriter.save()" ]
[ "python", "excel", "pandas" ]
[ "jQuery dataTables - how to render id from fnRender function", "In dataTables, how to render id from fnRender function \n\nfunction filltable() {\n var oTable = $('#table').dataTable({\n \"bProcessing\": true,\n \"sAjaxSource\": \"AjaxHandler.aspx?action=get&getmethod=activity\",\n \"sAjaxDataProp\": \"aaData\",\n \"aoColumns\": [\n { \"mDataProp\": \"DesignationID\" },\n { \"mDataProp\": \"DesignationName\" },\n { \"mDataProp\": \"DesignationShortName\"},\n { \"mDataProp\": null,\n \"sTitle\": \"Activity-Action\",\n \"bSearchable\": false,\n \"bSortable\": false,\n \"fnRender\": function (oObj) {\n return \"<a href='#' name='lnkEditActivity' id='\" + oObj.aData[\"DesignationID\"] + \"' class='sepV_a' title='Edit'><i class='icon-pencil'></i></a> <a href='#' title='Delete' name='lnkDeleteActivity' id='\" + oObj.aData[\"DesignationID\"] + \"'><i class='icon-trash'></i></a>\";\n }\n }\n ]\n });\n }\n\n\nHow To Grab id from fnRender Function..I am not able to grab id from fnRender function..help" ]
[ "jquery", "jquery-datatables" ]
[ "MediaWiki API not returning depictions in languages other than English", "I was using the API https://commons.wikimedia.org/w/api.php?action=help&modules=wbsearchentities to fetch depictions In Wikimedia Commons.\n\nOn modifying the attributes language/strictlanguage should return depiction in the corresponding language\n\nI found that none of the calls\n\n\nhttps://commons.wikimedia.org/w/api.php?action=wbsearchentities&format=json&language=hi&search=Q528943\nhttps://commons.wikimedia.org/w/api.php?action=wbsearchentities&format=json&language=hi&strictlanguage=1&search=Q528943\n\n\n... returns depiction in the desired language." ]
[ "mediawiki-api", "wikimedia", "wikimedia-commons", "wikibase" ]
[ "How to deploy delphi exe output to artifactory using jenkins", "I use a script in Jenkins to build delphi projects and I want to deploy their .exe outputs to Artifactory server but I dont know how. Is there any plugin to deploy exe files to Artifactory? \nIs it a good idea to deploy them to Artifactory?" ]
[ "delphi", "jenkins", "deployment", "artifactory" ]
[ "Use onBackPressed to save a file", "I want to allow users to save a list of favourite items from a list, so I display the full list using a Listview with checkboxes, and the user will check or uncheck items in the list.\n\nWhen the user presses the back button, I want to be able to save the checked items out to a separate file on the SD card.\n\nI'm using the following method in my Activity:\n\n@Override\n public void onBackPressed() {\n // TODO Auto-generated method stub\n\n }\n\n\nHowever, the list that I create within my OnCreate method is not available within the onBackPressed method - ie it's out of scope.\n\nIf I try and pass the list into the onBackPressed method as follows:\n\n@Override\n public void onBackPressed(ArrayList<HashMap<String, Object>> checked_list) {\n // TODO Auto-generated method stub\n\n }\n\n\nThen I get the error:\n\n\"The method onBackPressed(ArrayList>) of type SetFavourites must override or implement a supertype method\" and Eclipse prompts to remove the @Override.\n\nBut when I do this, then the onBackPressed method never gets called.\n\nHow can I pass variables into the onBackPressed method so that I can perform actions on data within my Activity before exiting?\n\nThanks" ]
[ "android" ]
[ "jquery dynamically add input checkbox with disabled and uncheck", "it is strange! \n\nwhen i create a dynamic input(checkbox type), i can control checked is true or false, but when i create it with disable default, it sets input to checked!\n\nhere is my code: \n\nvar theInput = new $('<input>', {\n id: 'myCheckbox',\n name: 'myCheckbox',\n type: \"checkbox\",\n disabled: true,\n checked: false\n});\ntheInput.uniform();\n\n\nit adds disabled but checked input, \n\nvar theInput = new $('<input>', {\n id: 'myCheckbox',\n name: 'myCheckbox',\n type: \"checkbox\",\n disabled: true,\n checked: true\n});\ntheInput.uniform();\n\n\nif i set checked to true, then it adds disabled and unchecked input why?\n\ni changed \"checked\" to checked, but there is no diffrence.\n\ni complete my code, problem is in uniform, when i uniform it, it changed property!" ]
[ "javascript", "jquery" ]
[ "Problem drawing graphics to user control", "My application pops a form as a child of the main form. On the form is\nUser Control with a Panel where Graphics are rendered. When executed\nfrom Visual Studio in debug mode the drawing is often rendered as expected,\nimagine a simply XY graph. If the panel's graphic aren't drawn then adding\ntwo or three break points to the drawing routines usually fix the problem.\n\nWhen executed inside Visual Studio in release mode, or from the.exe in any mode,\nthe graphics are never rendered, although the user control's Paint method is\ncalled. Resizing the form cause the repaint to be called again, of course,\nand the image is now rendered correctly.\n\nCan anyone give me some insight as to why there's a difference in the behavior\nbetween Debug and Release modes, from execution within VS and out side VS,\nany why are the break points sometimes fixing things? And how can I get the\ngraphics to be consistently visible.\n\nThanks,\n\nRick\n\nalt text http://img160.imageshack.us/my.php?image=profilebeforeresizeti4.pngalt text http://img512.imageshack.us/my.php?image=profileafterresizenw2.png" ]
[ "visual-studio", "graphics", "user-controls", "release-mode" ]
[ "JQuery Flot - Grid lines not showing through filled lines", "I'm trying to create one real-time flot and my problem is that I can't get to see the flot grid through the filling of my data's lines..\n\nIf you have any idea to get my filling a bit transparent like the picture below, I'd like to apply it as well on my Fiddle!\n\n\n\nWhat I'm trying to achieve is something like that:\nPicture of what I try to get\n\nHere is the Fiddle on what I'm working: \nMy flot on Fiddle\n\nCode:\n\n\n\n$(function () {\n\n getRandomData = function(){\n var rV = [];\n for (var i = 0; i < 10; i++){\n rV.push([i,Math.random() * 10]);\n }\n return rV;\n }\n\n getRandomDataa = function(){\n var rV = [];\n for (var i = 0; i < 10; i++){\n rV.push([i,Math.random() * 10 + 5]);\n }\n return rV;\n }\n\n getSeriesObj = function() {\n return [\n {\n data: getRandomDataa(),\n lines: { \n show: true, \n fill: true,\n lineWidth: 5,\n fillColor: { colors: [ \"#b38618\", \"#b38618\" ] },\n tickColor: \"#FFFFFF\",\n tickLength: 5\n }\n }, {\n data: getRandomData(),\n lines: {\n show: true,\n lineWidth: 0,\n fill: true,\n fillColor: { colors: [ \"#1A508B\", \"#1A508B\" ] },\n tickColor: \"#FFFFFF\",\n tickLength: 5\n }\n }];\n }\n\n update = function(){\n plot.setData(getSeriesObj());\n plot.draw();\n setTimeout(update, 1000);\n }\n\n var flotOptions = { \n series: {\n shadowSize: 0, // Drawing is faster without shadows\n tickColor: \"#FFFFFF\"\n },\n yaxis: {\n min: 0, \n autoscaleMargin: 0,\n position: \"right\",\n transform: function (v) { return -v; }, /* Invert data on Y axis */\n inverseTransform: function (v) { return -v; }, \n font: { color: \"#FFFFFF\" },\n tickColor: \"#FFFFFF\"\n },\n grid: {\n backgroundColor: { colors: [ \"#EDC240\", \"#EDC240\" ], opacity: 0.5 }, // \"Ground\" color (May be a color gradient)\n show: true,\n borderWidth: 1,\n borderColor: \"#FFFFFF\",\n verticalLines: true,\n horizontalLines: true,\n tickColor: \"#FFFFFF\"\n }\n }; \n\n var plot = $.plot(\"#placeholder\", getSeriesObj(), flotOptions);\n\n setTimeout(update, 1000);\n});\n\n\nThanks a lot!" ]
[ "javascript", "jquery", "html", "css", "flot" ]
[ "Powershell Expand-Archive Cyrillic names", "I have this zip which contains one file with cyrillic name\n\n\n\nwhen I extract this archive using PS D:\\Temp> Expand-Archive .\\arc.zip I have this:\n\n\n\nIf I extract this archive not using powershell - all ok, russian name becomes readable.\n\nHow can I setup encoding using Expand-Archive?" ]
[ "powershell" ]
[ "C# DataGridView Event to Catch When Cell (ReadOnly) Value has been changed by user", "I have a Winforms app written in C#.\n\nIn DataGridView, I have set a column(DataGridViewTextBoxColumn) called 'Name' to ReadOnly = true.\n\nWhen the user right click on a Cell of the 'Name' column -> Display a form to set a value -> I want the application to know: Cell's value of the 'Name' column has been changed.\n\nI have tried many events but can not do, such as CellEndEdit, CellValueChanged\n\nI'm only interested in catching user changes to data in the 'Plan' column where ReadOnly = true.\n\nWhich is the best event to use for this?\nI attach information as below:\n\n① Image Description\n\n② Source Code" ]
[ "events", "datagridview", "cell" ]
[ "Change the server URL with tabris iOS client?", "it is possible to change the server URL of the Tabris iOS Client in an other way like hardcoded it in XCode in the AppDelegate.m file ? \n\nThe Tabris Android client allows directly to change the URL in the app." ]
[ "ios", "eclipse", "tabris" ]
[ "DomPDF - addInfo (base64_encode) and setEncryption", "I am having an issue with DomPDF and base64_encode with setEncryption function.\n\nThis is a sample of my code.\n\n // Render the HTML as PDF\n $dompdf->render();\n\n //Encode title into base64 and add it to PDF Meta\n $title_64 = base64_encode( $title );\n $dompdf->getCanvas()->get_cpdf()->addInfo( 'Subject' , $title_64 );\n\n //Locking pdf to allow printing only\n $dompdf->getCanvas()->get_cpdf()->setEncryption( '' , '' , array( 'print' ) );\n\n // Output the generated PDF to Browser\n $dompdf->stream( $post->post_name . \".pdf\" , array( \"Attachment\" => TRUE ) );\n\n\nSo pretty much what is happening once PDF is downloaded all meta data is missing. \n\nAs soon I remove base64_encode function that is wrapping $title Meta data is back.\n\nAlso if I keep base64_encode but I remove \n\n$dompdf->getCanvas()->get_cpdf()->setEncryption( '' , '' , array( 'print' ) ); \n\nEverything seems to be working but I am able to modify PDF which I don't want.\n\nAs my end result I should be able only to print PDF which is what i have now + all Meta data to be \n\nbase64_encoded\n\nDid anyone encounter similar issue ?" ]
[ "php", "wordpress", "pdf", "pdf-generation", "dompdf" ]
[ "Keyname not found in json", "I'm trying to create my own Telegram bot as a project and don't want to use any of the libraries already out there that already do all the hard work for me as I want to do this for myself as on going self learning.\n\nI'm using CPPRESTSDK and trying to get values from the JSON back from telegram.\n\nHere is an example of the JSON\n\n{\n \"ok\": true,\n \"result\": [\n {\n \"update_id\": 534699960,\n \"message\": {\n \"message_id\": 159183,\n \"from\": {\n \"id\": HIDDEN,\n \"is_bot\": false,\n \"first_name\": \"Hawke\",\n \"username\": \"XXXXXXXX\"\n },\n \"chat\": {\n \"id\": HIDDEN,\n \"title\": \"CHANNEL_NAME_HIDDEN\",\n \"username\": \"HIDDEN\",\n \"type\": \"supergroup\"\n },\n \"date\": 1548427328,\n \"text\": \"Nope, at work\"\n }\n }\n ]\n}\n\n\nI'm trying to read the text value but I'm getting Keyname not found when trying to access result. The above JSON is stored into a file once retrieving the JSON from telegram.\n\n try {\n string_t importFile = U(\"json.txt\"); \n ifstream_t f(importFile); \n stringstream_t s; \n json::value v; \n\n if (f) {\n s << f.rdbuf(); \n f.close(); \n v = json::value::parse(s); \n\n auto results_array = v.at(U(\"result\")).as_array();\n }\n }\n catch (web::json::json_exception& excep) {\n std::cout << excep.what();\n }" ]
[ "c++", "json", "telegram", "cpprest-sdk" ]
[ "IE11 and with div or img in Javascript/dojo", "in my widgets html-template I have following a-tag:\n\n<a class=\"mylink\" href=\"\" data-dojo-attach-point=\"downloadAttach\"\n dojoattachevent=\"onclick:_download\">\n<div class=\"mylinklayout\"></div>\n</a>\n\n\nWhen clicked a file should be downloaded and the `href-attribute is set programmatically. This works fine in Chrome & Firefox, but not in IE11. The same happens wenn replacing the div-tag with a img-tag. All javascript code in the background will be executed as expected and only the download will not start (also IE11 does not prompt for saving/directly opening the file).\n\nThe download will only work when I'm not using div or img but only plain text within the a-tag (making a usual hyperlink):\n\n<a class=\"mylink\" href=\"\" data-dojo-attach-point=\"downloadAttach\"\n dojoattachevent=\"onclick:_download\">\ndownload here\n</a>\n\n\nThe javascript code remains unchanged and the href-attribute is set in the same way with the same value. Now it works in IE11.\n\nIs there a work around for IE11 to get this working with div oder img?" ]
[ "javascript", "dojo", "internet-explorer-11" ]
[ "Using tags creatively", "This question is about acts_as_taggable_on but I believe it applies to tagging in general.\n\nIs it appropriate to use tags to store little details about a user's activity, such as their interaction history?\n\nFor example: our user last wanted the demo panel closed, so we store this as a tag called home_demo_closed, which is then easily searchable on the next page load. \n\nThe alternative is adding a column to the database every time there's a new point of interaction we want to store. This seems like overkill to me - clunky, lots of work to implement, and too 'fixed' given how rapidly the front-end design can change. \n\nWhat do you think is the best way to proceed with this - is there a design flaw with using tags for 'creative' purposes like this that I'm not considering?" ]
[ "ruby-on-rails", "ruby-on-rails-3", "tags", "acts-as-taggable-on" ]
[ "jQuery ajax override global onSuccess handler", "Is it possible possible to have jQuery .ajax call to execute a global onSuccess handler (let's call it onSuccessGlobal for now) before executing the local onSuccess handler?\n\nBasically, the flow should be:\n\n\nPerform .ajax call (or .get, .post, etc)\nAssuming previous call was successfull, a global onSuccessGlobal handler is invoked, passing the resulting data from the request. This data is transformed within this method.\nAfter previous handler returns the transformed data, it's received by the local onSuccess handler which uses the data to add content to the page, etc.\n\n\nI'm aware of the existence of the Ajax events, but so AFAIK, it doesn't look that ajaxSuccess event will:\na) be called before the local success event\nb) have the modified data sent to the local event\n\nIn order to achieve something similar, I think I could use the global ajaxSend event to abort the current ajax request, create a wrapped one with the handlers I need, and then send the new wrapped request instead. But I hope someone can provide some insight as this sounds rather complicated.\n\nThanks!" ]
[ "javascript", "jquery", "ajax" ]
[ "How to reset the billing address of a quote object?", "I need to reset the billing address of a quote whenever the the customer comes to the one page checkout page. \n\nSo I extended the indexAction() method of the OnepageController and added following lines to create a new quote address object and assign it to the quote object. But debugging the code shows me that the address I get from the quote is still the old one. \n\n...\nMage::getSingleton('checkout/session')->setCartWasUpdated(false);\nMage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure'=>true)));\n\n$this->getOnepage()->initCheckout();\n\n// --- Start of my code ------------------------------\n\n// Create a new quote address object and pass it to the quote \n$newBillingAddress = Mage::getModel('sales/quote_address'); \n$this->getOnepage()->getQuote()->setBillingAddress($newBillingAddress)->save();\n\n// get address from quote to see whether is changed or not. \n// but it is still the old address. \n$billingAddress = $this->getOnepage()->getQuote()->getBillingAddress();\n\n// --- End of my code ------------------------------\n\n$this->loadLayout();\n..." ]
[ "php", "magento", "quote" ]
[ "Question regarding missing RemoveHandler in WPF application function", "We have a few scenarios in our WPF/MVVM application where a window is being instanciated and opened within the confines of a method. Very simplistic example:\n\nPrivate Sub subOpenWindow\n Dim myViewModel = New Viewmodel1 'create viewmodel that Window1 will use as datacontext\n AddHandler myViewModel.SomeEvent, AddressOf subHandleSomeEvent\n\n Dim myWindow = New Window1(ViewModel1)\n myWindow.Show\nEnd Sub\n\nPrivate Sub subHandleSomeEvent\n 'do some stuff\nEnd Sub\n\n\nNow - we are debating whether or not the use of an AddHandler without a subsequent RemoveHandler (normally a big no-no) is causing us memory issues given that the AddHandler declaration is decalred and used inside of the subOpenWindow method and there is no obvious means of performing a RemoveHandler call. We could move the viewmodel declaration to a more global level but this does not seem as clean.\n\nThe question is: is a RemoveHandler necessary in this scenario? Or will garbage collection clean up properly once the window has been closed?" ]
[ "wpf", "mvvm", "addhandler" ]
[ "How to fake an event in mootools?", "Sample code:\n\n<div id=\"first\">first div</div>\n<div id=\"second\">second div, click here or on the previous it's the same</div>\n\n\nSuppose I set an event onclick on the first div that alerts the div's content. \nHow do I call that event? In example clicking on the second div I'd like it to call the click event of the first div and alert('first div')" ]
[ "javascript", "event-handling", "mootools" ]
[ "Issue importing subprocess32", "I am trying to install subprocess32 with my python 2.7 installation via buildroot. It appeared to install correctly but when I import it on the embedded system I get an error:\n\n>>> import subprocess32\n/usr/lib/python2.7/site-packages/subprocess32.py:472: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your pro\ngram uses threads.\n \"program uses threads.\", RuntimeWarning)\n\n\nFollowing this path I tried to import _posixsubprocess\n\nimport _posixsubprocess\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nImportError: dynamic module does not define init function (init_posixsubprocess)\n\n\nsubprocess32 seems to have it's own version and it's not working in this case?\n\nHere is my make file:\n\n#############################################################\n#\n# Subprocess32 module for python\n#\n#############################################################\n\nSUBPROCESS32_VERSION = 3.2.7\nSUBPROCESS32_SOURCE = subprocess32-$(SUBPROCESS32_VERSION).tar.gz\nSUBPROCESS32_SITE = https://pypi.python.org/pypi/subprocess32\n\nSUBPROCESS32_DEPENDENCIES = python\n\ndefine SUBPROCESS32_BUILD_CMDS\n (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)\nendef\n\ndefine SUBPROCESS32_INSTALL_TARGET_CMDS\n (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)\nendef\n\n$(eval $(call GENTARGETS,package,subprocess32))\n\n\nThere is a similar post about this Python Error The _posixsubprocess module is not being used However the answer is a link in the comments which is dead. Any ideas for my problem?\n\nsetup.py:\n\n#!/usr/bin/python\n\nimport os\nimport sys\nfrom distutils.core import setup, Extension\n\n\ndef main():\n if sys.version_info[0] != 2:\n sys.stderr.write('This backport is for Python 2.x only.\\n')\n sys.exit(1)\n\n ext = Extension('_posixsubprocess', ['_posixsubprocess.c'],\n depends=['_posixsubprocess_helpers.c'])\n if os.name == 'posix':\n ext_modules = [ext]\n else:\n ext_modules = []\n\n setup(\n name='subprocess32',\n version='3.2.7',\n description='A backport of the subprocess module from Python 3.2/3.3 for use on 2.x.',\n long_description=\"\"\"\nThis is a backport of the subprocess standard library module from\nPython 3.2 & 3.3 for use on Python 2.\nIt includes bugfixes and some new features. On POSIX systems it is\nguaranteed to be reliable when used in threaded applications.\nIt includes timeout support from Python 3.3 but otherwise matches\n3.2's API. It has not been tested on Windows.\"\"\",\n license='PSF license',\n\n maintainer='Gregory P. Smith',\n maintainer_email='[email protected]',\n url='https://github.com/google/python-subprocess32',\n\n ext_modules=ext_modules,\n py_modules=['subprocess32'],\n\n classifiers=[\n 'Intended Audience :: Developers',\n 'Topic :: Software Development :: Libraries',\n 'Development Status :: 5 - Production/Stable',\n 'License :: OSI Approved :: Python Software Foundation License',\n 'Operating System :: POSIX',\n 'Operating System :: POSIX :: BSD',\n 'Operating System :: POSIX :: Linux',\n 'Operating System :: POSIX :: SunOS/Solaris',\n 'Programming Language :: Python :: 2.4',\n 'Programming Language :: Python :: 2.5',\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 2 :: Only',\n 'Programming Language :: Python :: Implementation :: CPython',\n ],\n )\n\n\nif __name__ == '__main__':\n main()" ]
[ "python", "linux", "python-2.7", "subprocess", "buildroot" ]
[ "How to add a method to ActiveStorage::Variant?", "I want to add a method to ActiveStorage::Variant How to do it?\n\nI have this for ActiveStorage::Blob and it works when I modify code without reloading the server :\n\nconfig/initializers/active_storage_direct_url.rb :\n\nmodule ActiveStorageDirectUrl\n def cloudfront_url(expires_at = nil)\n # xx\n end\nend\n\nActiveSupport.on_load(:active_storage_blob) do\n ActiveStorage::Blob.include ActiveStorageBlobCachedUrl\nend\n\n\nBut the issue is when I do it for ActiveStorage::Variant. I tried this :\n\nActiveSupport.on_load(:active_storage_blob) do\n ActiveStorage::Variant.include ActiveStorageVariantCachedUrl\nend\n\n\nActiveSupport.on_load(:active_storage_variant) do\n ActiveStorage::Variant.include ActiveStorageVariantCachedUrl\nend\n\n\nBut it in both case, in dev environment, when I modify some code and without restarting the server, it says undefined method 'direct_url' for #<ActiveStorage::Variant:0x00007fc04fa45530>\n\nWhen I reload the rails server it works though. Same thing for sidekiq, I need to reload it." ]
[ "ruby-on-rails", "ruby", "overriding", "monkeypatching", "rails-activestorage" ]
[ "Using Xamarin in Visual Studio 2015, Android emulator not working due to Java error", "I'm trying to get the android emulator to work in VS however this error keeps popping up\n\nConnection to the layout renderer failed. This may be caused by a misconfiguration of Java.\nDetails:\njava.lang.NoClassDefFoundError: com/android/utils/ILogger\nat java.lang.Class.getDeclaredMethods0(Native Method)\nat java.lang.Class.privateGetDeclaredMethods(Class.java:2701)\nat java.lang.Class.privateGetMethodRecursive(Class.java:3048)\nat java.lang.Class.getMethod0(Class.java:3018)\nat java.lang.Class.getMethod(Class.java:1784)\nat sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)\nat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)\nCaused by: java.lang.ClassNotFoundException: com.android.utils.ILogger\n at java.net.URLClassLoader.findClass(URLClassLoader.java:381)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:424)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:357)\n ... 7 more\nError: A JNI error has occurred, please check your installation and try again\nJava HotSpot(TM) Client VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0\nException in thread \"main\"" ]
[ "java", "android", "visual-studio", "xamarin" ]
[ "MongoDB: fastest way to compare two large sets", "I have a MongoDB collection with more than 20 millions documents (and growing fast). Some document have an 'user_id' (others, don't).\n\nI regularly need to check if some user_id exists in the collection. But there is a lot of 'some'. 10K to 100K.\n\nHow would you do that?\n\nThe first thought is to have a big query:\n\n$or : [ { 'user_id' : ... } , { ... } , ... ]\n\n\nWith all my 10K to 100K ids... But it's very slow, and I don't think it's the better way to do it. Someone told me about Redis' bloom filters, but it seems that Mongo does not do that.\n\nDo you see a better way to do it? Like with bloom filters, a < 100% accuracy is acceptable in my case." ]
[ "mongodb", "bloom-filter", "large-data" ]
[ "can plsql function return object", "i have encountered a problem while writing the following code:\n\ncreate or replace function getashish(dept varchar2) return emp3 as\n\nemp5 emp3;\n\nstr varchar2(300);\n\nbegin\n\nstr := 'select e.last_name,l.city,e.salary from employees e join departments d \n\non e.department_id = d.department_id join locations l on d.location_id=l.location_id where \n\nd.department_name = :dept';\n\nexecute immediate str bulk collect into emp5 using dept;\n\nend;\n\n\nemp 3 is table of an object as defined below:\n\ncreate or replace type emp1 as object (lname varchar2(10),city varchar2(10),sal number(10));\n\ncreate or replace type emp3 as table of emp1;\n\n\ni am getting the following error while executing the function: SQL Error:\n\nORA-00932: inconsistent datatypes: expected - got -\n\n\nthank you for your anticipated help and support." ]
[ "oracle", "plsql" ]
[ "configure php to connect in oracle g11 OCI8", "I am trying to configure php (7.0) to connect to Oracle 11g in a IIS7 server\n\nI uncommented the extension and php_oci8.dll php_oci8_11g but i have this problem\n\n\n PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\v7.0\\ext\\php_oci8_11g.dll' -\n n'est pas une application Win32 valide. (is not a valid Win32 application.)\n\n\nsomeone can help me.\nthanks." ]
[ "php", "oracle", "iis-7", "oci8" ]
[ "Can't get jQuery and IE to be friends", "Using jQuery and the Cycle plugin. Runs flawless in Safari, Chrome, Firefox, and the latest version of Opera. Won't run in older versions of Opera, and of course, IE. I know its running Java, because its picking up the rollovers.\n\nThis is driving me batty. Hopefully its something simple. Here's the code...\n\n$(document).ready(function() {\n $(\"#slideshow\").css(\"overflow\", \"hidden\");\n\n $(\"div#slides\").cycle({\n fx: 'scrollHorz',\n speed: 'slow', \n timeout: 0,\n prev: '#prev',\n next: '#next'\n }); \n\n\nReally appreciate the help guys." ]
[ "javascript", "jquery", "internet-explorer", "jquery-cycle" ]
[ "RealityKit – How to add a Video Material to a ModelEntity?", "I use the code to add a picture texture in RealityKit and it works fine. \n\nvar material = SimpleMaterial()\n\nmaterial.baseColor = try! .texture(.load(named: \"image.jpg\"))\n\n\nI try to use this code to add a video file to be a texture, but it crashes!!!\n\nguard let url = Bundle.main.url(forResource: \"data\", withExtension: \"mp4\") else {\n return\n}\nmaterial.baseColor = try! .texture(.load(contentsOf: url))\n\n\nHow can I add a video file?" ]
[ "swift", "augmented-reality", "arkit", "realitykit" ]
[ "Build insert query from array MySQL and PHP", "I'm writing a small web service in PHP and I'm having a bit of trouble getting my head around the following scenario.\n\nMy plan is to be able to send an array of data to a function, which would then build a query for MySQL to run. In the array I plan for the key to be the column name, and the value to be the value going in to the columns.. i.e.\n\n$myData = array('userName'=>'foo','passWord'=>'bar');\n$myClass = new users();\n\n$myClass->addUser($myData);\n\n\nThen, in my function I currently have:\n\nfunction addUser($usrData){\n foreach($usrData as $col => $val){\n\n // This is where I'm stuck..\n\n }\n}\n\n\nBasically, I am wondering how I can separate the keys and values so that my query would become:\n\nINSERT INTO `myTable` (`userName`,`passWord`) VALUES ('foo','bar');\n\n\nI know I could probably do something like:\n\nfunction addUser($usrData){\n foreach($usrData as $col => $val){\n $cols .= \",\" . $col;\n $values .= \",'\".$val.\"'\";\n }\n}\n\n\nBut I thought there might be a more elegant solution.\n\nThis is probably something really simple, but I have never came across this before, so I would be grateful for any help and direction..\n\nThanks,\n\nDave" ]
[ "php", "mysql", "arrays", "key-value" ]
[ "Web Data Scraping issues-Auto Download", "I want to automatically download all the whitepapers from this website: https://icobench.com/ico, when you choose to enter each ICO's webpage, there's a whitepaper tab to click, which will take you to the pdf preview screen, I want to retrieve the pdf url from the css script by using rvest, but nothing comes back after I tried multiple input on the nodes\n\nA example of one ico's css inspect:\n\nembed id=\"plugin\" type=\"application/x-google-chrome-pdf\" \nsrc=\"https://www.ideafex.com/docs/IdeaFeX_twp_v1.1.pdf\" \nstream-url=\"chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/9ca6571a-509f-4924-83ef-5ac83e431a37\" \nheaders=\"content-length: 2629762\ncontent-type: application/pdf\n\n\nI've tried something like the following:\n\nlibrary(rvest)\nurl <- \"https://icobench.com/ico\"\nurl <- str_c(url, '/hygh')\nwebpage <- read_html(url)\nItem_html <- html_nodes(webpage, \"content embed#plugin\")\nItem <- html_attr(Item_html, \"src\")\n\n\nor\n\nItem <- html_text(Item_html)\nItem\n\n\nBut nothing comes back, anybody can help?\n\nFrom above example, I'm expecting to retrieve the embedded url to the ico's official website for pdf whitepapers, eg: https://www.ideafex.com/docs/IdeaFeX_twp_v1.1.pdf \n\nBut as it's google chrome plugin, it's not being retrieved by the rvest package, any ideas?" ]
[ "r", "web-scraping", "css-selectors", "rvest" ]
[ "AcquireTokenSilent() fails", "I am writing a WinForms client which is connecting to an azure WebAPI.\nthe program fails to call AcquireTokenSilent with a specific account. I always get this message:\n"You are trying to acquire a token silently using a login hint. No account was found in the token cache having this login hint."\nHowever, a call of AcquireTokenInteractive with the same account works.\nHere is the preparation:\nIPublicClientApplication pca = PublicClientApplicationBuilder\n .Create(ClientID)\n .WithAuthority(AzureCloudInstance.AzurePublic, TenantID)\n .WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient")\n .Build();\nstring[] scopes = { "user.read" };\n\nAuthenticationResult result;\n\nNow this part fails:\nresult = await pca.AcquireTokenSilent(scopes, "[email protected]").ExecuteAsync();\n\nHowever, this part works:\nThe interactive dialog is showing me the same account as above, "[email protected]".\nresult = await pca.AcquireTokenInteractive(scopes).ExecuteAsync();" ]
[ ".net", "winforms", "authentication", ".net-4.7.2" ]
[ "List all NuGet packages with Id, Version, License URL and Project URL", "I would like to extract the following information out of all installed nuget packages in my solution:\nId, Version, License URL and Project URL. The nuget package manager lists all of the informations I need for each package. (see picture)\n\nWhen I take a look at all the informations stored in each object in the nuget package manager console with the command Get-Package | select * I get the following exemplary result:\n\nProjectName : WebSchnittstellen\nId : Antlr\nVersions : {3.5.0.2}\nAsyncLazyVersions : NuGet.Versioning.NuGetVersion[]\nVersion : 3.5.0.2\nAllVersions : False\nLicenseUrl : http://www.antlr3.org/license.html\n\nBy using Get-Package | select -Unique Id, Version, LicenseUrl I can extract one part of the needed information. But how can I add the Project URL to each entry?" ]
[ "visual-studio", "nuget", "nuget-package" ]
[ "Why session.getAttribute() always returning null inside JSP page textbox?", "I am always getting null value in jsp page textbox. I have defined name attribute in index.jsp page and fetching value using <%=session.getAttribute()%>.\n\nHere is index.jsp \n\n\r\n\r\n<tr>\r\n<td>First Name</td>\r\n<td>\r\n<input type=\"text\" required=\"\" name=\"firstname\" value=\"<%=session.getAttribute(\"firstname\")%>\"/>\r\n</td>\r\n</tr>\r\n\r\n\r\n\n\nIn below UploadServletClass.java, session is defined\n\n\r\n\r\npublic class UploadServletClass extends HttpServlet{\r\n PrintWriter out = null;\r\n Connection con = null;\r\n PreparedStatement ps = null;\r\n HttpSession session = null;\r\n \r\n protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{\r\n response.setContentType(\"text/plain;charset=UTF-8\");\r\n try{\r\n out = response.getWriter();\r\n session = request.getSession();\r\n ...\r\n }\r\n }\r\n} \r\n\r\n\r\n\n\nThis is loginScript.jsp\n\n\r\n\r\n<%\r\nString zfid = request.getParameter(\"zid\"); \r\nString fname = request.getParameter(\"firstname\");\r\n\r\n...\r\n\r\nif (rs.next()) {\r\nsession.setAttribute(\"zfid\", zfid); //used ${sessionScope.zfid} to display value into textbox and it is successful.\r\nsession.setAttribute(\"firstname\",fname); //failed to display value in textbox \r\n//out.println(\"welcome \" + userid);\r\n//out.println(\"<a href='logout.jsp'>Log out</a>\");\r\nresponse.sendRedirect(\"home.jsp\");\r\n}" ]
[ "sql", "jsp", "servlets" ]
[ "Can prepareStatement do the same thing like Statement?", "My DB is Oracle.\nI know Statement can mix SQL sentences(insert or delete or update) into one single batch. Here is my code.\n\nDBConnection db = new DBConnection();\nConnection c = db.getConn();\nStatement s = null ;\n\n\ntry\n{ \n String sql = \"insert into t1(id, name) values ('10', 'apple')\";\n String sql1 = \"insert into t1(id, name) values ('14', 'pie')\";\n String sql2 = \"delete from t1 where id = '10'\";\n s = c.createStatement();\n\n s.addBatch(sql);\n s.addBatch(sql1);\n s.addBatch(sql2);\n\n int[] re = s.executeBatch();...\n\n\nMy question is can PreparedStatement do this? and how?" ]
[ "java", "sql", "oracle", "prepared-statement" ]
[ "vertically center an overflow image", "I can't seem to solve my issue with the solutions I have found online. The image simply won't move.\n\nI am looking to center the image vertically in my div. So instead of it showing from the top down, it starts somewhere in the middle.\n\nHTML\n\n<article class=\"banner\">\n <button class=\"button\">Schedule your FREE assesment</button>\n <img class=\"mySlides\" src=\"images/img1.jpg\" width=\"100%\">\n <img class=\"mySlides\" src=\"images/img2.jpg\" width=\"100%\">\n <img class=\"mySlides\" src=\"images/img3.jpg\" width=\"100%\">\n <img class=\"mySlides\" src=\"images/img4.jpg\" width=\"100%\">\n</article>\n\n\nCSS\n\n.banner {\n position: relative;\n background-color: #212121;\n height: 180px;\n width: 100%;\n overflow: hidden;\n opacity: .80\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.7), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n -webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.7), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n -moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.7), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n}\n\n.button {\n position: absolute;\n margin-left: -14%; /* Anyway to make this centered more eficiently? */\n margin-top: 5%;\n border: 0;\n background-color: #C60505;\n color: white;\n padding: 15px 25px;\n font: Arial-Heavy;\n font-size: 20px;\n cursor: pointer;\n border-radius: 8px;\n text-shadow: 1px 1px #000000;\n}\n\n\nIt is worth mentioning the class attached to the images is linked to JS that has a slideshow-like effect." ]
[ "html", "css" ]
[ "Unhandled exception, while i clearly handle the exception in Java", "when i was working on a small project of mine, i stumpled upon a weird error the Java compiler gives me, when i want to compile the code. The compilar says that i have an unhandled Interruptedexception. This is because i use Thread.sleep(). Here in my code you can clearly see that i handle the exception, but still the compiler insists that i dont. Instead of doing it this way I also tried doing it by using a try/catch block, but this also did not help. The weird thing also is the compiler does not give me an error if i do buttonpress(); instead of generate.setOnAction(e -> buttonpress()); (generate is just a button). The line java complains about is the last line in my first code block. Here is my code:\n\n@FXML\n@Override\npublic void start(Stage primaryStage) throws InterruptedException, IOException {\n window = primaryStage;\n window.setTitle(\"RNG\");\n Parent root = FXMLLoader.load(getClass().getResource(\"FXML.fxml\"));\n\n lowerbound = (TextField) root.lookup(\"#lowerboundinput\");\n upperbound = (TextField) root.lookup(\"#upperboundinput\");\n output = (Text) root.lookup(\"#randomnumberoutput\");\n Button generate = (Button) root.lookup(\"#generatebutton\");\n\n generate.setOnAction(e -> buttonpress());\n\n\nHere is the buttonpress method:\n\npublic static void buttonpress()throws InterruptedException{\n if(!lowerbound.getText().equals(\"\")|| !upperbound.getText().equals(\"\")) {\n RandomNumberGenerator.JavaFXLauncher(lowerbound.getText(), upperbound.getText());\n }else{\n setOutput(\"EMPTY\");\n }\n}\n\n\nand here is the JavaFXLauncher method:\n\npublic static void JavaFXLauncher(String firstbound, String secondbound) throws InterruptedException{\n int random;\n try {\n if(inputvalidator(firstbound, secondbound)) {\n random = Integer.parseInt(firstbound) + (int) (Math.random() * ((Integer.parseInt(secondbound) - Integer.parseInt(firstbound)) + 1));\n Main.setOutput(Integer.toString(random));\n\n TimeUnit.MILLISECONDS.sleep(50);\n //some other code\n\n} catch(NumberFormatException e){\n Main.setLowerbound(\"Pick smaller number\");\n Main.setUpperbound(\"Integer overflow\");\n } catch (InterruptedException f){\n\n }\n\n}" ]
[ "java", "javafx", "exception-handling" ]
[ "Images - Radiobuttons", "I want to use images as radiobuttons.\nEverything is ok in Chrome and Firefox. But in IE it doesn't work...\nTest URL: https://webshop.haco.com/calculator1/\n\nCSS and HTML:\n\nlabel > input{ /* HIDE RADIO */\n display:none;\n\n}\nlabel > input + img{ /* IMAGE STYLES */\n cursor:pointer;\n border:2px solid transparent;\n\n}\n\n<label>\n<input type=\"radio\" name=\"shape\" value=\"round\" checked />\n<img id=\"roundShape\" src=\"css/images/round.jpg\">\n</label>" ]
[ "html", "css", "image", "radio-button" ]
[ "Python - matplotlib heatmap comparison with R", "I was trying to reproduce a R - Heatmap to Python. After some search in Google I was able to do it, but still both the heatmaps plot doesn't look the same. I am using the same 2d matrix for both. The following is the R code for plotting and saving the image:\n\nR-Code:\n\nlibrary(\"ALL\")\ndata(\"ALL\")\neset <- ALL[, ALL$mol.biol %in% c(\"BCR/ABL\", \"ALL1/AF4\")]\nlibrary(limma)\nf <- factor(as.character(eset$mol.biol))\ndesign <- model.matrix(~f)\nfit <- eBayes(lmFit(eset,design))\nsource(\"http://www.bioconductor.org/biocLite.R\")\nbiocLite(\"limma\")\nselected <- p.adjust(fit$p.value[, 2]) <0.05\nesetSel <- eset [selected, ]\nwrite.csv(exprs(esetSel[1:100,]), file=\"C://test/output.csv\", row.names=TRUE)\nheatmap(exprs(esetSel))\n\n\nThe following is the output image of R:\n\n\nThe following is the python-matplotlib code for generating the heatmap:\n\nimport scipy\nimport pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport scipy.cluster.hierarchy as sch\n%matplotlib inline\n\ndef generate_heat_map(df, cmap=\"YlGnBu\"):\n \"\"\"\n Function to generate headmaps with dendrogram\n \"\"\"\n\n # figure size\n fig = plt.figure(figsize=(10, 8))\n # need to change the line width\n # default line width doesn't look good\n matplotlib.rcParams['lines.linewidth'] = 0.5\n # axis to show where this current axis \n # need to be shown\n ax1 = fig.add_axes([0.09, 0.1, 0.2, 0.6])\n # to generate the array the will be passed\n # to dendrogram, mey\n Y = sch.linkage(df, method='centroid')\n # need to make changes in orientation to\n # make it appear in the left\n # default is top\n Z1 = sch.dendrogram(Y, orientation='left')\n # removing x and y ticks\n ax1.set_xticks([])\n ax1.set_yticks([])\n # to remove the axis\n ax1.axis('off')\n\n # top side dendogram\n ax2 = fig.add_axes([0.3, 0.71, 0.6, 0.2])\n Y = sch.linkage(df.T, method='ward')\n Z2 = sch.dendrogram(Y)\n ax2.set_xticks([])\n ax2.set_yticks([])\n ax2.axis('off')\n\n # main heatmap\n axmatrix = fig.add_axes([0.3, 0.1, 0.6, 0.6])\n # getting the index to get our required values\n # that needs to be shown in the heatmap\n idx1 = Z1['leaves']\n idx2 = Z2['leaves']\n D = df.values[idx1, :]\n D = df.values[:, idx2]\n# D = df.values\n # using matshow to display the heatmap\n # colormap: 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn'\n im = axmatrix.matshow(D, aspect='auto', \n origin='lower', cmap=cmap)\n axmatrix.set_xticks([])\n axmatrix.set_yticks([])\n\n # xticks to the right (x-axis)\n axmatrix.set_xticks(range(len(df.columns)))\n # this shows the required labels\n # in this case it is the dataframe columns\n axmatrix.set_xticklabels(df.columns, minor=False)\n axmatrix.xaxis.set_label_position('bottom')\n axmatrix.xaxis.tick_bottom()\n\n # to change the rotation of xticks\n plt.xticks(rotation=90, fontsize=8)\n\n # xticks to the right (y-axis)\n axmatrix.set_yticks(range(len(df.index)))\n # this shows the required labels\n # in this case it is the dataframe index\n axmatrix.set_yticklabels(df.index, minor=False)\n axmatrix.yaxis.set_label_position('right')\n axmatrix.yaxis.tick_right()\n\nfilepath = 'output.csv'\ndf = pd.read_csv(filepath, index_col=0)\ngenerate_heat_map(df)\n\n\nThe following is the output of Python-matplotlib:\n\n\nWhat might be the problem. Is there any way to get a Python-matplotlib heatmap plot similar to R-Heatmap. Kindly help.\n\nThanks in advance." ]
[ "python", "r", "matplotlib", "plot", "scipy" ]
[ "Is it possible to show static fields in the Unity Editor?", "I wrote little script yesterday but it isn't working. (Serialize fields isn't showing in unity and few errors eg. I can't use reference to non-static member (serialize Field)). Can You help me please.\n\nEg.\n\nusing UnityEngine;\npublic class sExample : MonoBehaviour\n{\n [SerializeField] public static GameObject gameObj;\n public void serializeUse()\n {\n //Do something with gameObj\n }\n}\npublic class serializeEx : NetworkBehaviour\n{\n public void Update()\n {\n If (!isLocalPlayer)\n {\n sExample.serializeUse()\n }\n }\n}\n\n\nThanks alot" ]
[ "c#", "unity3d" ]
[ "Command line restarts when 2 items with same attributes found", "Hi there first of all English is not my main language sorry for orthographic errors or maybe doing questions the wrong way.\n\nI'm using Clips 6.3 64bit version.\n\nI'm learning this for school but my teacher ain't giving us a lot information about the programming part, where only learning the theory behind it all, so my problem is i'm running this fine program https://github.com/JherezTaylor/cheese-classification/blob/master/wichCheese.clp on my clips to see how it works, and everything works fine except when 2 items have the same attributes, it wont keep filtering it just blanks the command line and i have to start over, more specific when i run the program and answer the 2 first questions with 1. Blue 2. Creamy it does the error i'm talking about, my first thought is that its crashing because there is more then 1 registry that start with those 2 attributes.\n\nSorry for the long text first time asking, any help is appreciated and any comment about my way of asking is well received.\n\nthanks for advance to anyone willing to help." ]
[ "64-bit", "clips", "expert-system" ]
[ "Unexpected nested route generated using Rails url_for helper", "I'm using Rails 5 and my routes look something like:\n\nRails.application.routes.draw do\n namespace :admin do\n namespace :moderation do\n resources :templates\n end\n\n resources :users, except: [:new, :create] do\n namespace :moderation do\n resources :messages, only: [:index, :show, :new, :create, :update, :edit] do\n resources :message_replies, only: [:create, :edit, :update]\n end\n resources :templates\n end\n end\n\n root \"home#index\"\n end\nend\n\n\nI have models/admin/user.rb:\n\nmodule Admin\n class User < ::User\n end\nend\n\n\nAnd models/admin/moderation/template.rb:\n\nmodule Admin\n module Moderation\n class Template < ::Moderation::Template\n end\n end\nend\n\n\nNow when I try to generate the right route using url_for helper: \n\n2.4.1 (main):0 > admin_user = Admin::User.first\n2.4.1 (main):0 > admin_moderation_template = Admin::Moderation::Template.first\n2.4.1 (main):0 > url_for([admin_user, admin_moderation_template])\nNoMethodError: undefined method `admin_user_admin_moderation_template_url' for main:Object\n\n\nInstead of getting admin_user_moderation_template_url I got admin_user_admin_moderation_template_url. Any help of how should I generate the right route in this case?" ]
[ "ruby-on-rails", "ruby-on-rails-5", "rails-routing" ]
[ "How I detect if a PDF was invalidated after signature", "I want to know how to detect if a PDF was invalidated after been signed. When I open a document with Acrobat Reader, I can see it , but i cant achive this programattically.\n\n BouncyCastleProvider provider = new BouncyCastleProvider();\n Security.addProvider(provider);\n PdfReader reader;\n reader = new PdfReader(bytes);\n AcroFields af = reader.getAcroFields();\n ArrayList<String> names = af.getSignatureNames();\n for (int k = 0; k < names.size(); ++k) {\n\n String name = (String)names.get(k);\n PdfPKCS7 pk = af.verifySignature(name);\n Calendar cal = pk.getSignDate();\n Certificate pkc[] = pk.getCertificates();\n List<VerificationException> fails = CertificateVerification.verifyCertificates(pkc, ks, null, cal);\n boolean certificateVerified = (fails.isEmpty())?true:false;\n boolean documentModified= !pk.verify();}\n\n\nFor each revision documentModified is false, but then the whole document was invalidated. How could I detect it?\nI want to get the same message as Acrobat Reader \"The document has been altered or corrupted since the signature was apllied\"" ]
[ "java", "itext" ]
[ "How do you set the encoding for console output in Azure Devops?", "My Cypress test output in CI looks like this everywhere. Is there a variable I can set to be able to read this more clearly? The output should also be colored, I'm guessing that matters too." ]
[ "azure", "continuous-integration", "cypress", "console.log" ]
[ "How to improve Solr query performance?", "I am new to solr and using solr 4.7 to obtain text based search. My solr is having single collection with uniquely indexed field. I am facing performance issue for search query. I am thinking to add either multiple core on single solr instace or multiple instance with replicated data.\nplease help me which option i need to choose to improve solr performance.\n\nCan anyone suggest me whether it will increase my search query performance by adding master-slave configuration. where Master will take care of all commits and slave will take care for search-query." ]
[ "solr" ]
[ "rules for unary operators in bison", "I am trying to write bison expression for arithmetic operations, and for unary operators. the rules for unary operator should be\n\n--6 is not accepted, but -(-6) accepted\n\n4--5 and 4+-5 are not accepted, but 4-(-5) accepted\n\n4*-5 and 4/-5 are not accepted, but 4*(-5) accepted\n\n3- is not accepted\n\n-3*4 is accepted\n\nthe rules are \n\nline\n : assign '\\n' { \n long temp=eval($1); \n LIST_EXPR[count-1].value=temp;\n LIST_EXPR[count-1].flag=1;\n printf(\" %ld\\n\", LIST_EXPR[count-1].value);\n }\n ;\n\nassign\n: VAR '=' expr { $$ = make_binop(EQUAL, BINOP_EXPR, make_var($1), $3); add_to_list_expr($3,count); count++;}\n| expr {add_to_list_expr($1,count); count++;}\n;\n\nexpr\n: expr '+' term { $$ = make_binop(PLUS,BINOP_EXPR, $1, $3);}\n| expr '-' term { $$ = make_binop(MINUS,BINOP_EXPR, $1, $3);}\n| term\n;\n\nterm\n: term '*' factor { $$ = make_binop(TIME,BINOP_EXPR, $1, $3);}\n| term '/' factor { $$ = make_binop(DIV,BINOP_EXPR, $1, $3); }\n| term '%' factor { $$ = make_binop(MOD,BINOP_EXPR, $1, $3); }\n| factor\n| pre\n;\n\npre: \n '-' factor {$$=make_binop(UMINUS,BINOP_EXPR, $2, NULL);}\n| '+' factor {$$=make_binop(UPLUS,BINOP_EXPR, $2, NULL);}\n;\n\nfactor\n: '(' expr ')' { $$ = $2; }\n| CONST { $$ = make_const($1); }\n| VAR { $$ = make_var($1); }\n| '#' factor {$$=make_binop(LINE_REF,BINOP_EXPR, $2, NULL);}\n;\n\n\nthe problem is when the unary come in the right side it is accepted, for example 3--4 it is accepted, while it should not be accepted. this problem occur just with + and - operation.\n\nDoes anyone know how to solve it" ]
[ "parsing", "compiler-errors", "compiler-construction", "bison" ]
[ "Looking for suggestions to get rid of inefficient for loop in raycasting", "I am currently working on a project to measure the volume of objects on a production line in real time using 3D depth cameras. There will be obfuscation and worse or better angles and therefore we want to simulate different camera configurations before we build a rig and test it in production. We have a large number of CT scans of these objects and based on these we want to simulate different camera views. What we want to simulate is a pointcloud as would be generated by a camera in a given position.\n\nEvery method I have found traces one ray at a time and you have to loop over the rays in a python loop. This is the slow part and I am looking for a method to get rid of this python loop. My intuition is that there should be a GPU accelerated library that can do this very quickly but I haven’t been able to find it, I usually do segmentation and registration of CT scans not 3d graphics. Below is a bit of detail on what I have tried so far.\n\nI have a camera class. Of relevance for these calculations I have a source point self.pos and a plane of points I want to project to self.points_plane these are points in 3D space. So all the rays originate in self.pos and end at one of the elements in self.points_plane. My initial attempt was to use scipy.ndimage.map_coordinates: \n\nfor point in self.points_plane:\n dist = int(np.sqrt((self.pos[0]-point[0])**2+(self.pos[1]-point[1])**2+(self.pos[2]-point[2])**2))\n z_line = np.linspace(self.pos[0],point[0],dist)\n y_line = np.linspace(self.pos[1],point[1],dist)\n x_line = np.linspace(self.pos[2],point[2],dist)\n\n stack = ndimage.map_coordinates(array,np.vstack((z_line,y_line,x_line)),order=1,cval=-1000)\n # Hounsfield value check, air is -1000 and our objects are in the range -200:1000\n intersections = np.argwhere(stack > -500) \n if intersections.size > 0:\n point_cloud.append([z_line[intersections[0][0]],y_line[intersections [0][0]],x_line[intersections [0][0]]])\n\n\nIt works, and the result looks nice but it’s too slow and we would be finished simulating next year… CuPy is a CUDA implementation of numpy/scipy and this was the next attempt since all the needed methods existed. Map coordinates was quicker but the transfer to GPU and back was slow and we still have a python loop. Not really a significant improvement, code is almost identical to the non-CUDA code. \n\nI tried VTK.vtkOBBTree() and obbTree.IntersectWithLine() methods to see if this was a good solution and it is for small number of points. The IntersectWithLine method takes a starting and end point for each line and the checks for intersections with the obbTree generated from an STL file. The method is fast as long as we are not looping over too many points, at the scale we are working it would still take about a month to simulate the relevant data. \n\nfor point in self.points_plane:\n pointsVTKintersection = vtk.vtkPoints()\n obbTree.IntersectWithLine(self.pos, point,pointsVTKintersection,None)\n pointsVTKIntersectionData = pointsVTKintersection.GetData()\n noPointsVTKIntersection = pointsVTKIntersectionData.GetNumberOfTuples()\n\n if noPointsVTKIntersection > 0:\n point_c.append(pointsVTKIntersectionData.GetTuple3(0))\n self.point_cloud = np.array(point_c)\n\n\nAny recommendations on how I can get rid of this for loop, is there a lib that does this in parallel for multiple rays?" ]
[ "python", "vtk", "raytracing" ]
[ "How to add multiple dynamic styles to a React component?", "I have a React component that already has a style attached to it:\n\n <Link onClick={handleCollapse}>\n <KeyboardArrowDownIcon className=(classes.icon) />\n Advanced Options\n </Link>\n\n\nI want to add an additional class to that component when it is clicked. So I tried:\n\n const [collapse, setCollapse] = React.useState(false);\n\n const handleCollapse = () => {\n setCollapse(prevState => !prevState);\n };\n\n <Link onClick={handleCollapse}>\n <KeyboardArrowDownIcon\n className={clsx(\n classes.icon,\n collapse ? 'classes.iconActive' : null\n )}\n />\n Advanced Options\n </Link>\n\n\nSince I am already using collapse which is a boolean I thought I could just use it to check if it's true or false.\n\nHowever, the above doesn't work.\n\nWould anyone know what I could do to get this to work?" ]
[ "reactjs", "typescript" ]
[ "django dynamic select_related in template", "I got two models: \n\nclass Location(models.Model): \n location_id=models.AutoField(primary_key=True)\n location=models.CharField(max_length=30, blank=False, null=False)\n phone_code=models.CharField(max_length=10,blank=True, null=True)\n def __str__(self):\n return self.location\n\nclass Host(models.Model): \n host_id=models.AutoField(primary_key=True)\n location=models.ForeignKey('Location', on_delete=models.CASCADE)\n host=models.CharField(max_length=30, blank=False, null=False)\n def __str__(self):\n return \"%s. %s\" % (self.location.location, self.host)\n\n\nit's a view for my template:\n\ndef index(request):\n locations=Location.objects.order_by('location')\n hosts=Host.objects.order_by('host')\n template=loader.get_template('ports/index.html')\n return HttpResponse(template.render({'locations':locations, 'hosts':hosts},request))\n\n\nI want to place two input selects in template, like this:\n\n <select class=\"form-control\" id=\"location\">\n {% for location in locations %}\n <option>{{location.location}}</option>\n {% endfor %} \n </select>\n <select class=\"form-control\" id=\"host\">\n ?????? dynamic update depending on location's select\n </select>\n\n\nAnd the second select will contain host. I need host's select to update dynamically when I change value in location's select." ]
[ "django", "model", "python-3.4" ]
[ "Create var in hive query running in Ozzie", "How to create variable in hive query running in Oozie(Hue) and pass this variable in next step of Oozie job to example Email job or Shell?\n\nI try this :\n\nset q1=select sum(br) from auth;\n\n\nAccessing q1 in Email job like this :${hiveconf:q1}\nthrow error :\n\nEL_ERROR Encountered \": q1 }\", expected one of [\"}\", \".\", \">\", \"gt\", \"<\", \"lt\", \"==\", \"eq\", \"<=\", \"le\", \">=\", \"ge\", \"!=\", \"ne\", \"[\", \"+\", \"-\", \"*\", \"/\", \"div\", \"%\", \"mod\", \"and\", \"&&\", \"or\", \"||\", \":\", <IDENTIFIER>, \"(\", \"?\"]\n\n\nMaybe I do it wrong and there is completely different solution? Or maybe itss hue error?" ]
[ "hadoop", "hive", "oozie" ]
[ "How can I allow users to get paid directly with stripe?", "I've looked at stripe connect and it forces each user to impute their Social Security number and etc. just so they accept payments for a item they want to sell.\n\nIs there a less painless method where users can sell something on my site, receive monies, and buy from other users?\n\nI tried using stripe alone and it pays me directly. Problem is I want user to sign up, sell something on the site, and get paid. I'm not sure how this can be done without having each user impute social security numbers, tax id, and other personal information if all they want to sell is a pen." ]
[ "ruby-on-rails", "e-commerce", "stripe-payments", "marketplace" ]
[ "Creating a Quote form in Django", "i am creating a django powered website. Specifically, a courier website. I need to create an application that serves as a quoting app. The user will type in the dimensions of the package into a form and after submitting the form, a price/quote will be returned , based on the dimensions inputted.\n\nI have done this so far \n(views.py)\n\nfrom django.shortcuts import render, redirect\nfrom quote.forms import QuoteForm\n\n def quoting(request):\n if request.method == 'GET':\n form = QuoteForm()\n else:\n form = QuoteForm(request.POST)\n if form.is_valid():\n Length = form.cleaned_data['Length']\n Breadth = form.cleaned_data['Breadth']\n Height = form.cleaned_data['Height']\n\n return redirect('thanks')\n return render(request, \"quote/quote.html\", {'form': form})\n\n\n(forms.py)\n\nfrom django import forms\n\nclass QuoteForm(forms.Form):\n\n Length = forms.Integer()\n Breadth = forms.Integer()\n Height= forms.Integer()\n\n\n(quote.html)\n\n{% extends \"shop/base.html\" %}\n{% block content %}\n<form method=\"post\">\n {% csrf_token %}\n {{ form }}\n <div class=\"form-actions\">\n <button type=\"submit\">Send</button>\n </div>\n</form>\n{% endblock %}\n\n\nThen i am aware i am lacking an html that would display the answer. I am not sure how to do this.\n\nThe price is determined by:\n\nprice= Shipping weight X distance\nshipping weight= (length X breadth X height) / 5000\n\nThanks in advance :)" ]
[ "python", "html", "django", "rest" ]
[ "COMPLEX Context handling in XSLT", "REPOSTING as it's a different requirement from my previous question..\n\nHi XSLT Gurus,\n\nI have a bit of a complex requirement. I need to get the values from another node while using the context from another node.\nPlease see sample below:\n\n<ObjectEvent>\n <epcList>\n <epc>111</epc>\n <epc>222</epc>\n </epcList>\n <material>ABC</material>\n</ObjectEvent>\n<ObjectEvent>\n <epcList>\n <epc>333</epc>\n </epcList>\n <material>DEF</material>\n</ObjectEvent>\n<ObjectEvent>\n <epcList>\n <epc>containerFOR111222</epc>\n </epcList>\n</ObjectEvent>\n<ObjectEvent>\n <epcList>\n <epc>containerFOR333</epc>\n </epcList>\n</ObjectEvent>\n<AggregationEvent>\n <parentID>containerFOR111222</parentID>\n <childEPCs>\n <epc>111</epc>\n <epc>222</epc>\n </childEPCs>\n</AggregationEvent>\n<AggregationEvent>\n <parentID>containerFOR333</parentID>\n <childEPCs>\n <epc>333</epc>\n </childEPCs>\n</AggregationEvent>\n\n\nThe number of parent nodes will depend on the unique materials. so in this case there will be 2. Output should be something like this:\n\n<MATERIAL>\n <BATCH>ABC</BATCH>\n <SERIES>\n <TOTAL>2</TOTAL>\n <EPCS>\n <EPC>111</EPC>\n <CONTAINER>containerFOR111222</CONTAINER>\n </EPCS>\n <EPCS>\n <EPC>222</EPC>\n <CONTAINER>containerFOR111222</CONTAINER>\n </EPCS>\n </SERIES>\n</MATERIAL>\n<MATERIAL>\n <BATCH>DEF</BATCH>\n <SERIES>\n <TOTAL>1</TOTAL>\n <EPCS>\n <EPC>333</EPC>\n <CONTAINER>containerFOR333</CONTAINER>\n </EPCS>\n </SERIES>\n</MATERIAL>\n\n\nI already got the MATERIAL, BATCH, SERIES, TOTAL, EPCS and EPC right. The problem is with the CONTAINER field. I cannot get the value of the 2nd context (containerFOR333). I'm just getting the value of the 1st context :(\n\nThis is the mapping i have now. I don't have an idea for CONTAINER:\n\n<xsl:for-each select=\"//ObjectEvent/material\">\n <MATERIAL>\n <BATCH>\n <xsl:value-of select=\"./material\"/>\n </BATCH>\n <SERIES>\n <TOTAL>\n <xsl:value-of select=\"count(./epcList/epc\"/>\n </TOTAL>\n <xsl:for-each select=\"./epcList/epc\">\n <EPCS>\n <EPC>\n <xsl:value-of select=\"./epcList/epc\"/>\n </EPC>\n <CONTAINER>???</CONTAINER>\n </EPCS>\n </xsl:for-each>\n </SERIES>\n </MATERIAL>\n</xsl:for-each>\n\n\nMy actual source, target message and mapping is much much more complex than this so hopefully ill be able to start with a simple solution then work my way up to the higher complexities\n\nThanks!!!" ]
[ "xslt" ]
[ "Get Textbox values from a datalist or repeater on postback", "I need to create a usercontrol that will have a datalist or repeater. This data control (datalist or repeater) will have all of its rows in edit mode and I need to get the values entered by the user after he submits the page that contains this usercontrol (the page will have 3 instances of the same usercontrol).\n\nHow can I do this?\n\nI'm looking for previous question on StackOverflow, but I can't find one about a data control with all rows in edit mode." ]
[ "asp.net" ]
[ "Separate project/website for mobile web pages?", "Should mobile web pages for our company website be in the same project/website as our \"normal\" pages, or should they be in their own project?\n\nI see some mobile website as http://www.company.com/mobile/default.aspx which tells me they are combined. But then I see some like http://mobile.company.com/default.aspx which tells me they are in their own project/website.\n\nWe are taught that separation of components grants more flexibility, but that usually comes with a price -- more complexity.\n\nThanks." ]
[ "mobile", "web" ]
[ "How To Get Published Test Results from TFS 2010 Build, From Visual Studio 2012", "I am using Visual Studio 2012, but TFS 2010.\n\nI have created a build with the default build template, that builds several C# solutions, runs tests, etc. At present, many of the unit tests fail. I can see from the build log that MSTEST has successfully published the build results to the TFS server.\n\nBTW, the build was a \"Partial Success\". I would like to know why. That's why I'm looking for the test results.\n\nIn Visual Studio 2010, I would have used the Test Results and Test Runs windows to load the published results. These windows are missing in Visual Studio 2012. How can I get access to my test results (preferably without installing Visual Studio 2010).\n\nAlso, the full build log is not copied to the drop folder. Is there some way for me to find out what caused the \"Partial Success\"?\n\n\n\nP.S. This is Visual Studio Professional 2012. \n\n\n\nUPDATE\n\nSo, it says \"Publishing results of test run ... to url\". How do I get to see the test results?" ]
[ "visual-studio-2012", "tfs", "mstest" ]
[ "multiple files upload - django", "I'm uploading multiple files to django and when I was saved files only it saved one.\nExecution example:\n\n------------------------------------ start files ------------------------\n<MultiValueDict: {u'patientFiles': [<InMemoryUploadedFile: Registro VFC JOSE DE LA CRUZ_16_03_2015.txt (text/plain)>, <InMemoryUploadedFile: JDTD datos vfc_27_04_2015.txt (text/plain)>]}>\n *-1-*Registro VFC JOSE DE LA CRUZ_16_03_2015.txt\n *-2-*<django.core.files.storage.FileSystemStorage object at 0xaf731aac>\n *-1-*JDTD datos vfc_27_04_2015.txt\n *-2-*<django.core.files.storage.FileSystemStorage object at 0xaf731e4c>\n *-3-*JDTD datos vfc_27_04_2015.txt\n *-4-*JDTD%20datos%20vfc_27_04_2015.txt\n --------------------------------------------------------------------------\n\n\nHow you can see it goes to 3 and 4 points one time and it doesn't save first file.\nHave you any idea about?\n\nThanks and next are code.\n\nThis is django-server code:\n\ndef startFiles(self,request):\n print colored(\"----------------- start files -----------------------\",'blue')\n print colored(request.FILES,'blue')\n for afile in request.FILES.getlist('patientFiles'):\n myfile = afile\n print colored(\"*-1-*\" + str(myfile),'blue')\n fs = FileSystemStorage()\n print colored(\"*-2-*\" + str(fs),'blue')\n filename = fs.save(myfile.name, myfile)\n print colored(\"*-3-*\" + str(filename),'blue')\n uploaded_file_url = fs.url(filename)\n print colored(\"*-4-*\" + str(uploaded_file_url),'blue')\n print colored(\"--------------------------------------------------------------------------------\",'blue')\n\n\nthis is HTML code:\n\n<form id=\"SuPF\" class=\"form-group\" enctype=\"multipart/form-data\" action=\"/formSingupPatient\" method=\"POST\">\n <input type=\"file\" multiple=\"true\" name=\"patientFiles\">\n <button type=\"submit\" id=\"SubmitForm\" class=\"btn btn-default\">Submit</button>\n</form>" ]
[ "python", "html", "django" ]
[ "Create secondary COM Server from interfaces exposed in primary COM Server", "I have a need to define an interface in C# (e.g. ICommonHandler) and have it implemented in Delphi, or, for that matter any other language. For now, the priority is in Delphi.\n\nFrom C# I then need to instantiate instances of interface ICommonHandler via classes that's implemented in Delphi. \n\nTo summarize the above, I have a 'contract' exposed from C#. My C# code then expects implementations of this contract from Delphi, or then any arbitrary language.\n\nIs the above possible? If so, I'd very much appreciate possible guidelines on how to get it going.\n\nMy feeling is that the above will not be possible, because one cannot register multiple COM servers containing the same GUID for the same interface, in this case ICommonHandler." ]
[ "c#", "delphi", "com" ]
[ "Send Push Notification to Specific Device or User via NotificationHub", "I have implemented the notificationhub service for Apple Push Notification (APNS) and I could able to send push notification to device successfully.\nI am wondering where registrationId is stored in Azure, also how could I able to send push notification to specific device or user.\nIn the given following notificationhub tutorial, it is being used tag, but I am not sure if I use tag for each user or device is a right approach?\nlet tags = ["12345"]\n\nhttps://docs.microsoft.com/en-us/azure/notification-hubs/ios-sdk-swift-rest" ]
[ "swift", "azure", "azure-notificationhub" ]
[ "nHibernate egar loading, not works when in use condition", "For NHibernate 3.3.3 \n\nThink about three entity like\n\npublic class Menu{\n public string Name{get;set;}\n public IList<MenuAccess> MenuAccessList{get;set}\n}\n\npublic class MenuAccess{\n public string Name{get;set;}\n public Controller MenuController{get;set;}\n}\n\npublic class Controller{\n public long Id{get;set;}\n public string Name{get;set;}\n}\n\n\nconsider their lazy load enabled mapping \n\nnow if in criteria query we use SetFetchMode(FetchMode.Eager) on MenuAccessList that works fine but if we create alias of MenuAccessList and add condition on that then Eagerload do not work. Throw lazy load exception if we access that later. \n\nusing(ISession session = NHSessionFactory.OpenSession()){\n ICriteria criteria = session.CreateCriteria<Menu>(); \n criteria.CreateAlias(\"MenuAccessList\", \"ma\", JoinType.InnerJoin);\n criteria.SetFetchMode(\"ma\", FetchMode.Eager);\n criteria.Add(Restrictions.Eq(\"ma.MenuController.Id\",10L));\n var list = criteria.List<Menu>();\n}\n\n\nThis query cannot load MenuAccessList from menu if we access that outside session scope." ]
[ "c#", "nhibernate", "eager-loading" ]
[ "How do I read the Data from a value from my Firebase?", "So reading from my Firebase database seen here by using the following code I have managed to get a 'data snapshot' of the first item in my database:\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference myRef = FirebaseDatabase.getInstance().getReference(\"messages\");\n\n myRef.orderByPriority().limitToFirst(1).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Log.e(\"data:\", \"\"+dataSnapshot.getChildren());\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(TAG, \"The read failed: \" );\n }\n });\n\n\nThis returns: \n\ndatasnapshot: \"DataSnapshot {key = message, value = {ygmailcom100={name=tom, message=kys, [email protected]}} }\"\n\n\nMy question is now what...how do I access these different bits of data(name, msg, email(also the parent of these three bits of data, the 'ygmailcom100 'bit)) and put their data into strings. Also once i have read the data to strings how do i go about deleting that value from the message key. \n\nI apologise for my ignorance as i am new to software development but any insight will be much appreciated." ]
[ "android", "firebase", "firebase-realtime-database" ]
[ "Illegal characters in path wen add user to role in ASP MVC 4", "I am using MVC4 ASP.net, I try to add user account to role:\nmy code is:\n\nvar user = new ApplicationUser() { UserName = model.UserName };\n UserManager.CreateAsync(user, model.Password);\n if (!Roles.RoleExists(\"Admin\"))\n {\n Roles.CreateRole(\"Admin\");\n }\n Roles.AddUserToRoles(model.UserName, new[] { \"Admin\" });\n\n\n\nand my web.conf is:\n\n<roleManager enabled=\"true\" defaultProvider =\"AspNetSqlRoleProvider\">\n <providers>\n <clear/>\n <add name=\"AspNetSqlRoleProvider\" type=\"System.Web.Security.SqlRoleProvider\" connectionStringName=\"AUI_Connection2\" applicationName=\"/\"/>\n </providers>\n </roleManager>\n\n\n\nand i get “Illegal characters in path”??" ]
[ "asp.net", "asp.net-mvc-4" ]
[ "How to begin with Java Server Side technologies?", "I have a good knowledge of PHP. But I also want to learn technologies such as JSP. I have installed Apache Tomcat 6.0 and Eclipse Java EE. \n\nI was looking for JSP tutorials on Google and found that there are several things like JSP, Servlets, Struts, EJB, JSF, etc. I have heard a lot about Struts and JSF that they are very good. \n\nI want to know in what order should I start learning these technologies. (I have good knowledge of Core Java)" ]
[ "java", "jsp", "servlets", "web-frameworks" ]
[ "Group by odd results", "I am running the following query:\n\nSELECT DISTINCT\n CAST(ar_all_bills.a_unpaid_balance as decimal(5,2)) as \"Total Unpaid Balance\" \nFROM ar_all_bills WHERE a_ar_customer_cid = 100059\n\n\nThe result is the following 2 records:\n\n49.74\n62.41\n\n\nHowever, when I add a GROUP BY to the query to get the SUM of the unpaid balance:\n\nSELECT DISTINCT\n SUM(CAST(ar_all_bills.a_unpaid_balance as decimal(5,2))) as \"Total Unpaid Balance\" \nFROM ar_all_bills WHERE a_ar_customer_cid = 100059 GROUP BY a_ar_customer_cid\n\n\nThe result is:\n\n461.27\n\n\nAny ideas on this?" ]
[ "sql", "group-by" ]
[ "Linear Interpolation", "Here is a program that asks the user for a number (variable r) to find the positive root of, and then asks for a starting interval [a,b]. This is done in some HTML code. The javascript below it has the code for linear interpolation inside a while loop.\n\nfunction everything() {\n\nr= document.getElementById('ri').value*1;\na= document.getElementById('ai').value*1;\nb= document.getElementById('bi').value*1;\n\nbisect(function(x){return x*x-r;},a,b);\n} \n\nfunction bisect(f,a,b) {\nvar avg,fa,fb;\n\navg = NaN;\nwhile (Math.abs(a-b)>1e-10) {\n fa=f(a);\n fb=f(b);\n if(fa*fb<0) {\n grad=(fb-fa)/(b-a);\n avg=a-(fa/grad);\n favg=f(avg);\n } else {\n alert('There has been an error. Redifine the interval A to B');\n break;\n }\n\n if (fa*favg<0) {\n b=avg;\n } else {\n a=avg;\n }\n}\nalert(avg);\n}\n\n\nThe problem with this code is it returns the error text, and the final value for avg at the end. This is a problem." ]
[ "javascript", "math", "while-loop", "iteration", "linear-interpolation" ]
[ "dataTables generating multiple server side requests", "I am using dataTable jquery plugin with server side processing enabled. While using fnReloadAjax function, there is a delay of 2-3 seconds between hiding of the processing div and display of the new data. Here is a post regarding this problem.\nI found out that this is due to multiple server requests made by datatable.\nIn my page onchange event of a set of radio buttons is making a call to server for new data as follows\noTable.fnReloadAjax("getCaseList?caseStatus=xxx&showValidOnly=true");\n\nIn the firebug console I see two requests being made one after the other\n\nGET https://localhost/getCaseList?caseStatus=xxx&showValidOnly=true&_=1363611652185\nGET https://localhost/getCaseList?caseStatus=xxx&showValidOnly=true&sEcho=4&iColumns=9&sColumns=&iDisplayStart=0&iDisplayLength=100&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=true&sSearch_5=&bRegex_5=false&bSearchable_5=true&sSearch_6=&bRegex_6=false&bSearchable_6=true&sSearch_7=&bRegex_7=false&bSearchable_7=true&sSearch_8=&bRegex_8=false&bSearchable_8=true&iSortingCols=1&iSortCol_0=4&sSortDir_0=desc&bSortable_0=false&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&bSortable_5=true&bSortable_6=true&bSortable_7=true&bSortable_8=true&_=1363611701804\n\nThe processing div is getting hidden after the completion of first request but new data is loaded only after the second request is complete.\nWhy is datatable making that second extra call?" ]
[ "jquery-ui", "jquery", "jquery-plugins", "datatables" ]
[ "Basic CSS manipulation using JavaScript", "I'm currently learning JavaScript, but I'm very weak on the fundamentals. I'm trying to write a function that changes the background color when a link is clicked, can you please advise me on what I'm doing wrong?\n\n<head>\n\n<script type=\"text/javascript\">\n\nfunction change()\n{\nvar abra = document.getElementbyId(\"body\").style;\nabra.background-color = \"black\";\n\n}\n</script>\n\n</head>\n\n<body>\n\n<div id=\"body\" style=\"background-color: red;\">\n<a href=\"#\" id=\"test\" onclick=\"return change()\">Test</a>\nsdfdsfsdfds\n\n</div>\n\n</body>\n\n\nEDIT: For clarification, I was trying to change the background color of the DIV \"body\"." ]
[ "javascript", "css" ]
[ "Eclipse RCP plugin View", "I have an view with an image(gif) of fixed size but when i re-size window or view its not adapting according to respective window or view. Can any one suggest some solution please?" ]
[ "eclipse-rcp" ]
[ "Ansible: Replace values from one dictionary to another without adding entire dictionary", "As the headline suggests, I'm looking to combine 2 dicts in that if the key of one dict is found in the other; the value of the the second dict is used.\n\nFor example \n\nDict 1:\n\n{\n \"test\": \"replace me\",\n \"test2\": \"some value\"\n}\n\n\nDict 2:\n\n{\n \"test\": \"replaced\",\n \"test3\": \"Don't add\"\n}\n\n\nCombined result:\n\n{\n \"test\": \"replaced\",\n \"test2\": \"some value\"\n}" ]
[ "python", "ansible" ]
[ "Find out what changed resources caused a workspace refresh/rebuild in Eclipse with Buildship", "Is there a way to get more detailed logging output from the Eclipse platform or the Buildship plugin (or even through the Gradle API itself) with regards to what caused a project to be rebuilt?\n\nContext:\n\nWe are currently migrating from Eclipse Mars (with Spring Gradle plugin) to Eclipse Photon (with Gradle Buildship plugin). One problem we encounter with the new version is that it ends up rebuilding large parts of the workspace every time we open Eclipse, which may take several minutes in large projects. Refresh workspace on startup is disabled in the Eclipse preferences. Setting Max simultaneous project builds to a higher value and Max iterations when building with cycles to a lower value than the defaults help mitigate the problem a bit by speeding up that initial rebuilt, but in the end it only works around the actual issue.\n\nWe did not have these problems in the old version and this behavior seems weird to me. After fully building the workspace, closing Eclipse and reopening it, I would expect that no resources changed and there is no need for a rebuild.\n\nWhile we do have quite a few custom Gradle plugins and tasks, there are no obvious offenders, like tasks that generate sources. I do not want to fully dismiss the possibility that something we customized is messing with a file while evaluating the Gradle projects, though.\n\nHence why getting more information about why the IDE/plugin believes that the project requires rebuilding would be really appreciated to get a starting lead.\n\nThe only setting I've found so far is eclipse.log.level, but that already defaults to ALL." ]
[ "eclipse", "gradle", "buildship" ]
[ "Show and hide two icons by clicking an anchor", "It would be possible show and hide two icons by clicking an anchor?? I have a Foundation Accordion and I need that when I click on the tabs (They are anchors) the icon is displayed to disappear and viceversa. I don't know why the browser console tells me 'addEventListener' of null, because the element exist an is an anchor. I would like to do it with javascript but if is not possible I'll use Jquery. This is what I've tried without succes.\n\n<dd class=\"accordion-navigation\">\n <a href=\"#panel1a\" class=\"tab-table\" role=\"tab\" id=\"panel1a-heading\" aria-controls=\"panel1a\" id=\"first-tab-accordion\">Subastas Activas\n <i class=\"fa fa-chevron-down styled-tab-icon arrow-content-hidden\" id=\"arrow-content-hidden-first\"></i>\n <i class=\"fa fa-chevron-up styled-tab-icon arrow-content-shown\" id=\"arrow-content-shown-first\"></i>\n </a>\n // More stuff...\n</dd>\n\n\nThis is the css\n\n.arrow-content-hidden {\n }\n\n.arrow-content-shown {\n display: none;\n}\n\n\nThis is the js\n\n<script>\n\nfunction toggle() {\n var arrowTabDown = document.getElementById(\"arrow-content-hidden-first\");\n var arrowTabUp = document.getElementById(\"arrow-content-shown-first\");\n if (arrowTabDown.style[\"display\"] == 'none') {\n arrowTabDown.style[\"display\"] = 'block';\n arrowTabUp.style[\"display\"] = 'none';\n } else {\n arrowTabDown.style[\"display\"] = 'none';\n arrowTabUp.style[\"display\"] = 'block';\n }\n};\n\ndocument.getElementById(\"first-tab-accordion\").addEventListener(\"click\", toggle, false);\n</script>" ]
[ "javascript", "jquery", "css", "toggle" ]
[ "SQL to get the one to many mapping (like reverse CASE WHEN THEN END or decode in Oracle)", "For example,\n\nThrough \"CASE WHEN THEN END\" I can get a many-to-one mapping as below.\n\nREGION = CASE WHEN IOG IN (1,2,14,37,72,101) THEN '1'\n WHEN IOG IN (11,22,48,77) THEN '7'\n WHEN IOG IN (7,13,18,24,39) THEN '3'\n ELSE NULL END\n\n\nCurrently, I want get the reverse mapping (one-to-many) which is used in WHERE clause, the logic is like as below (but it's not correct, what I mean is the logic) \n\nCASE WHEN REGION = 1 THEN IOG in (1,2,14,37,72,101)\n WHEN REGION = 7 THEN IOG in (11,22,48,77)\n WHEN REGION = 3 THEN IOG in (7,13,18,24,39)\nELSE NULL END\n\n\nThere is grammatical mistake in above sql, but how can I make ? Is it possible to get a one-to-many mapping?\n\nOne more thing, which I'm using is Oracle DB, seems that it's not available by using \"decode\" because it's also one-to-one mapping.\n\nCould anyone help with it? Thanks in advance." ]
[ "sql", "oracle", "mapping" ]
[ ".NET AutoComplete DropDownList or TextBox on Mobile Web Browser?", "I'm trying to build an AutoComplete DropDown List that will work on a Mobile Browser (Pocket IE, Opera Mobile, etc.) So for example, if I had one for US States, after typing in 'Ma', I'd expect to see 'Maine', 'Maryland', 'Massacusetts' as selectable options\n\nI've been able to build one for a traditional browser with no issues, using both 3rd party tools (Telerik RadControls) and using basic AJAX components (scriptmanager, textbox, and autocompleteextender), but haven't had any success on a mobile platform.\n\nWhat seems to be the problem in my opinion is the mobile framework seems to be limited when it comes to javascript and AJAX support.\n\nAm I missing something? Has anyone had any success with a project like this before?\n\nThanks for any suggestions.\n\n~Jim" ]
[ "c#", "ajax", "windows-mobile", "autocomplete", "drop-down-menu" ]
[ "How can I upload folders with flask?", "I need to have a feature on my Flask app to let users upload whole folders, not the files within them but to also keep the whole tree of folders. Is there a special feature within Flask or do I need to create a code with loops using the single file uploading methods?\nThanks in advance" ]
[ "flask", "web-applications", "directory", "upload", "flask-uploads" ]
[ "Second FileServer serves html but not images", "I'm running into the following problem with Go and gorilla/mux routers when building a simple API. I'm sure it's the usual stupid mistake that is right on my face, but I can't see it.\n\nSimplified project structure\n\n|--main.go\n|\n|--public/--index.html\n| |--image.png\n|\n|--img/--img1.jpg\n| |--img2.jpg\n| |--...\n|...\n\n\nmain.go\n\npackage main\n\nimport (\n \"net/http\"\n \"github.com/gorilla/mux\"\n)\n\nvar Router = mux.NewRouter()\n\nfunc InitRouter() {\n customers := Router.PathPrefix(\"/customers\").Subrouter()\n\n customers.HandleFunc(\"/all\", getAllCustomers).Methods(\"GET\")\n customers.HandleFunc(\"/{customerId}\", getCustomer).Methods(\"GET\")\n // ...\n // Registering whatever middleware\n customers.Use(middlewareFunc)\n\n users := Router.PathPrefix(\"/users\").Subrouter()\n\n users.HandleFunc(\"/register\", registerUser).Methods(\"POST\")\n users.HandleFunc(\"/login\", loginUser).Methods(\"POST\")\n // ...\n\n // Static files (customer pictures)\n var dir string\n flag.StringVar(&dir, \"images\", \"./img/\", \"Directory to serve the images\")\n Router.PathPrefix(\"/static/\").Handler(http.StripPrefix(\"/static/\", http.FileServer(http.Dir(dir))))\n\n var publicDir string\n flag.StringVar(&publicDir, \"public\", \"./public/\", \"Directory to serve the homepage\")\n Router.Handle(\"/\", http.StripPrefix(\"/\", http.FileServer(http.Dir(publicDir))))\n}\n\nfunc main() {\n InitRouter()\n // Other omitted configuration\n server := &http.Server{\n Handler: Router,\n Addr: \":\" + port,\n // Adding timeouts\n WriteTimeout: 15 * time.Second,\n ReadTimeout: 15 * time.Second,\n }\n\n err := server.ListenAndServe()\n // ...\n}\n\n\nSubroutes work OK, with middleware and all. The images under img are correctly served if I go to localhost:5000/static/img1.png.\n\nThe thing is, going to localhost:5000 serves the index.html that resides in public, but then localhost:5000/image.png is a 404 not found instead.\n\nWhat is happening here?" ]
[ "http", "go", "static", "mux" ]
[ "Wait for async function in foreach", "In my project, I tryout different Ip adresses for connection. If I cannot connect, I will switch to the next Ip\n\nforeach(var handler in webHandlers)\n{\n if(handler.TryConnect())\n {\n handler.Init();\n break;\n }\n}\n\n\nHandler class:\n\nbool finished = false;\nbool returnval = false;\n\npublic bool TryConnect()\n{\n StartCoroutine(TryConnection);\n while(!finished) { }\n return returnval;\n}\nIEnummerator TryConnection()\n{\n UnityWebRequest www = UnityWebRequest.Get(\"url\");\n www.timeout = 5;\n yield return wwww.SendWebRequest();\n if(www.isNetworkError)\n {\n returnval = false;\n }\n {\n returnval = true;\n }\n finished = true;\n}\n\n\nIf there is a connection, it works instantly. But if it cannot find it, unity crashes. The value of finished never seems to change. It doesnt matter that the game blocks, because this should be finished before starting the game.\n\nMy question is, how can I solve this, where I wait for the result of this coroutine." ]
[ "c#", "unity3d" ]
[ "qsub with conda activate?", "I would like to submit job with qsub and do conda activate myenv\nOther posts suggested source activate myenv but didn't work in my case.\nLog from cluster showed : .../node16/job_scripts/7102106: line 8: activate: No such file or directory\nAny idea how to do conda activate with qsub ?\nThanks." ]
[ "conda", "qsub" ]
[ "Cannot scrape specific text from router admin page", "So I'm attempting to scrape, using Scrapy, my router's admin page to regularly check my connection status without having to make a request to any external sites.\nI have the html span i want to extract:\n<span id="status_connectionStatus" style="font-family: rubikReg; color: rgb(255, 255, 255);">Connected</span>\n\nand I'm trying to retrieve the "Connected" text.\nWhen I scrape it using this:\n print(response.css('#status_connectionStatus').get())\n\nall that is returned is:\n<span id="status_connectionStatus" style="font-family: rubikReg;"></span>\n\nI've tried changing the path so it includes ::text but it still only returns None.\nThe text is updated every 2 seconds which I feel might have something to do with it.\nAnyone know what to do?" ]
[ "python", "web-scraping", "scrapy" ]
[ "How do I return a string from a regex match in python?", "I am running through lines in a text file using a python script.\nI want to search for an img tag within the text document and return the tag as text.\n\nWhen I run the regex re.match(line) it returns a _sre.SRE_MATCH object.\nHow do I get it to return a string?\n\nimport sys\nimport string\nimport re\n\nf = open(\"sample.txt\", 'r' )\nl = open('writetest.txt', 'w')\n\ncount = 1\n\nfor line in f:\n line = line.rstrip()\n imgtag = re.match(r'<img.*?>',line)\n print(\"yo it's a {}\".format(imgtag))\n\n\nWhen run it prints:\n\nyo it's a None\nyo it's a None\nyo it's a None\nyo it's a <_sre.SRE_Match object at 0x7fd4ea90e578>\nyo it's a None\nyo it's a <_sre.SRE_Match object at 0x7fd4ea90e578>\nyo it's a None\nyo it's a <_sre.SRE_Match object at 0x7fd4ea90e578>\nyo it's a <_sre.SRE_Match object at 0x7fd4ea90e5e0>\nyo it's a None\nyo it's a None" ]
[ "python", "regex" ]
[ "Makefile dependency without declaring a rule?", "I have a pattern rule that converts a type definition in a typescript file to a JSON schema file. The program that does this conversion requires two parameters:\n\nThe name of the source file\nThe typename to be extracted from that file\n\nI have decided to encode the required typename as the name of the target file.\n<--------- Typename ---------> <------- source file ------->\nBlockLanguageGeneratorDocument.json : block-language.description.ts\n\nAnd I defined this pattern rule to do the conversion:\n%.json : %.ts\n # $^ is the name of the input file\n # $(notdir $(basename $@)) is the filename of the target file (without the .json suffix)\n $(TYPESCRIPT_JSON_SCHEMA_BIN) --path $^ --type $(notdir $(basename $@)) > "[email protected]"\n\nSadly the <typename>.json: <sourcefile> rule I setup as a dependency is a more specific rule compared to the pattern rule and therefore the pattern rule is never executed. So I decided to wrap the conversion in a define CONVERT_COMMAND and simply use this in every single of the above definitions:\nBlockLanguageGeneratorDocument.json : block-language.description.ts\n $(CONVERT_COMMAND)\n\nWhile this does work, the repetition strikes me as ugly. Is there a way to declare a dependency from one file to another while still preferring the pattern rule?\nMinimal repro: Run this with make BlockLanguageGeneratorDocument.json Unrelated.json and observe that the echo is never executed.\nblock-language.description.ts :\n touch $@\n\nanother.description.ts :\n touch $@\n\n%.json : %.ts\n echo "generic target"\n\nBlockLanguageGeneratorDocument.json : block-language.description.ts\nUnrelated.json : another.description.ts\n\nIf this helps: The debug output is as follows.\n❯❯❯ make --debug=verbose BlockLanguageGeneratorDocument.json \nGNU Make 4.3\nBuilt for x86_64-pc-linux-gnu\nCopyright (C) 1988-2020 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nReading makefiles...\nReading makefile 'Makefile'...\nReading makefile 'Makefile.json' (search path) (no ~ expansion)...\nReading makefile '../../Makefile.common' (search path) (no ~ expansion)...\nUpdating makefiles....\nUpdating goal targets....\nConsidering target file 'BlockLanguageGeneratorDocument.json'.\n Considering target file 'block-language.description.ts'.\n Finished prerequisites of target file 'block-language.description.ts'.\n No need to remake target 'block-language.description.ts'.\n Finished prerequisites of target file 'BlockLanguageGeneratorDocument.json'.\n Prerequisite 'block-language.description.ts' is newer than target 'BlockLanguageGeneratorDocument.json'.\nMust remake target 'BlockLanguageGeneratorDocument.json'.\nSuccessfully remade target file 'BlockLanguageGeneratorDocument.json'.\nmake: 'BlockLanguageGeneratorDocument.json' is up to date." ]
[ "makefile", "gnu-make" ]
[ "How to scramble a word that is picked randomly from a text file", "I am attempting to write a program that picks a random word from a text file, scrambles it, and allows the user to unscramble it by swapping 2 index locations at a time. \n\nI have the program to the point where it grabs a random word from the text file and prints it out with the index numbers above it. \n\nI am having trouble figuring out how to:\n\n\nGet the word scrambled before it prints out on screen, and \nHow to get the user to be able to loop through swapping 2 indexes at a time until the word is unscrambled. \n\n\nIs there a method I can write that will perform these actions?\n\nHere is my code so far. \n\nimport java.io.*;\nimport java.util.*;\n\npublic class Midterm { // class header\n\n public static void main(String[] args) { // Method header\n\n int option = 0;\n Scanner input = new Scanner(System.in);\n int scrambled;\n int counter = 0;\n int index1;\n int index2; \n\n String[] words = readArray(\"words.txt\");\n /*\n * Picks a random word from the array built from words.txt file. Prints\n * index with word beneath it.\n */\n int randWord = (int) (Math.random() * 11);\n\n for (int j = 0; j < words[randWord].length(); j = j + 1) {\n System.out.print(j);\n }\n\n System.out.print(\"\\n\"); \n char[] charArray = words[randWord].toCharArray();\n for (char c : charArray) { \n System.out.print(c);\n }\n /*\n * Prompt the user for input to play game or quit.\n */\n System.out.println(\"\\n\");\n System.out.println(\"Enter 1 to swap a par of letters.\");\n System.out.println(\"Enter 2 to show the solution and quit.\");\n System.out.println(\"Enter 3 to quit.\"); \n\n if (input.hasNextInt()) {\n option = input.nextInt();\n counter++; \n }\n else {\n option = 3;\n }\n System.out.println(\"\");\n\n if (option == 1) {\n System.out.println(\"Enter the two index locations to swap separated by a space. \");\n index1 = 0;\n index2 = 0;\n if (input.hasNextInt()) {\n index1 = input.nextInt();\n }\n else {\n System.out.println(\"Please enter only numbers.\");\n }\n\n if (input.hasNextInt()) {\n index2 = input.nextInt();\n }\n else {\n System.out.println(\"Please enter only numbers.\");\n }\n } \n } \n\n\n\n // end main\n\n public static String[] readArray(String file) {\n // Step 1:\n // Count how many lines are in the file\n // Step 2:\n // Create the array and copy the elements into it\n\n // Step 1:\n int ctr = 0;\n try {\n Scanner s1 = new Scanner(new File(file));\n while (s1.hasNextLine()) {\n ctr = ctr + 1;\n s1.nextLine();\n }\n String[] words = new String[ctr];\n\n // Step 2:\n Scanner s2 = new Scanner(new File(file));\n for (int i = 0; i < ctr; i = i + 1) {\n words[i] = s2.next();\n\n }\n return words;\n } catch (FileNotFoundException e) {\n\n }\n return null;\n\n }\n}" ]
[ "java", "arrays", "character" ]