texts
sequence
tags
sequence
[ "BeginInvoke copy parameter", "Just try to learn Invoke/BeginInvoke, I encountered in that problem.\n\n // Update UI\n public void UpdateForm(string value) {\n txtLog.AppendText(value + \"\\r\\n\");\n }\n\n\n // Thread function\n private void readSocket() {\n string row = \"\";\n\n while (socket.Connected) { \n row = socket.readLine(); \n\n if (IsControlValid(this))\n BeginInvoke((MethodInvoker)delegate { UpdateForm(String.Copy(row)); }); \n\n }\n }\n\n\nUsing Invoke method my UI update with the correct text, instead if I use BegineInvoke I see wrong text, ie some text repeatedly a lot of time. I know that call\n\nBeginInvoke((MethodInvoker)delegate { UpdateForm(row); }); \n\n\nmaybe \"row\" can be behavior like a shared variable rather than\n\nBeginInvoke((MethodInvoker)delegate { UpdateForm(String.Copy(row)); }); \n\n\nI think that each BeginInvoke call create a \"new\" delegate, so using String.Copy must create another instance of string, but I see always wrong value (duplicates, ecc).\n\nWhere I'm wrong?" ]
[ "c#", "multithreading", "winforms", "begininvoke" ]
[ "Link to an arbitrary spot in a multimarkdown file", "I'm trying to make the following work:\n\nHere is my markdown text I would like to link to. [link]\n\nThen I write something else.\n\nThen I say [see above](link)\n\n\nThis does not work and I cannot find a way to link to some arbitrary text.\n\nNote: This is not a duplicate of 6695493 as that is a conversation about headers.\n\nThis is not a duplicate of any answer that talks about linking to headers." ]
[ "multimarkdown" ]
[ "Why is SSL redirect not working with force_ssl and Nginx?", "I have a Rails 3.2.13 app that I am trying to configure SSL for with Nginx and Unicorn. I want to be able to tell some controllers and some controller actions to 'force_ssl' and to properly redirect. I have been able to get this working so that I can manually hit the app with 'https://foo.com' and things work. When I put 'force_ssl' into a controller action, let's say users#index:\n\nclass UsersController < ApplicationController\n force_ssl\n\n def index\n # do some stuff\n end\n\nend\n\n\nI would expect that if I navigate to 'http://foo.com/users' that it would redirect to 'https://foo.com/users'. \nIt does not.\n\nInstead, it redirects to: 'https://unicorn_foo/users'. What am I missing?\n\nnginx.conf:\n\nupstream unicorn_foo {\n server unix:/tmp/unicorn.foo.sock fail_timeout=0;\n}\n\nserver {\n listen 80 default;\n server_name foo.com;\n root /home/webuser/apps/foo/current/public;\n\n location ^~ /assets/ {\n gzip_static on;\n expires max;\n add_header Cache-Control public;\n }\n\n try_files $uri/index.html $uri @unicorn_foo;\n\n location @unicorn_foo {\n proxy_set_header X-Forwarded-Proto http;\n proxy_pass http://unicorn_foo;\n }\n error_page 500 502 503 504 /500.html;\n client_max_body_size 5G;\n keepalive_timeout 10;\n send_timeout 240;\n sendfile_max_chunk 5m;\n}\n\nserver {\n listen 443;\n server_name foo.com;\n root /home/webuser/apps/foo/current/public;\n\n location ^~ /assets/ {\n gzip_static on;\n expires max;\n add_header Cache-Control public;\n }\n\n try_files $uri/index.html $uri @unicorn_foo;\n\n location @unicorn_foo {\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto https;\n proxy_set_header Host $http_host;\n proxy_redirect off;\n proxy_pass http://unicorn_foo;\n }\n error_page 500 502 503 504 /500.html;\n client_max_body_size 5G;\n keepalive_timeout 10;\n\n ssl on;\n ssl_certificate /etc/nginx/ssl/server.crt;\n ssl_certificate_key /etc/nginx/ssl/server.key;\n ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;\n ssl_ciphers ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP;\n ssl_session_cache shared:SSL:10m;\n\n send_timeout 240;\n sendfile_max_chunk 5m;\n}" ]
[ "ruby-on-rails", "nginx", "unicorn" ]
[ "How to loop through series of addresses in a text file and get individual fields in Node.js", "I have a text file with multiple addresses in the following format:\n335 Ahan St.\nHaines City, US 30721\n786 Birchmount Dr.\nWaterloo, IA 52001\nHow can I loop through these lines and get individual fields like Street number, street name, city, state, postal code in Node.js\nconst fs = require('fs');\nconst readline = require('readline');\n\nconst parseAddressFile = path => {\n const data = readline.createInterface({\n input: fs.createReadStream(path)\n });\n \n data.on('line', (line)=> {\n var address1= line.split(" ")[0];\n \n console.log(address1)\n })\n};\n\nI'm using readline module and I'm basically stuck after this." ]
[ "javascript", "node.js" ]
[ "How can i predict the chance of an event happening using machine learning?", "I have a dataset of events including their coordinates, Hour of the day, day of the week, and the weather (temperature and downfall) on that specific day. My goal is to predict the chance of that event to occur when you input these values. So I have a lot of data (about 1500 entries) of occurrences, but obviously, none where it did not happen.\nI looked at XGBoost because someone suggested it but I can't really find out how I could use that, how I applied it now just always returns 1.\nThis is my current implementation\nimport xgboost as xgb\n\n#RD is my dataframe \n\n#I labeled everything with a 1 since xgboost needs to predict something. I have no clue how i could handle this better :)\nrd["Label"] = 1\n\nX,y=rd[["HourOfDay",'Type','Lat','Long','DayOfWeek']],rd["Label"]\nxg_cl = xgb.XGBClassifier(objective="binary:logistic",\n n_estimators=10, seed=123)\nxg_cl.fit(X,y)\n\ntestdf = pd.DataFrame({\n "HourOfDay" : [1],\n "Type" : [2],\n "Lat" : [0],\n "Long" : [0],\n "DayOfWeek" : [6]\n})\npreds=xg_cl.predict(data =testdf)\n\nThis code always gives me true (1) but I need it to return the chance of the event happening and I am pretty sure my current implementation is useless.\nCan somebody point me in the right direction on how to solve this issue?" ]
[ "python", "machine-learning", "xgboost" ]
[ "How do I draw ellipse in opengl with mvp", "How to draw circle/ellipse and transform it with Model-View-Projection.\n\nI draw an ellipse in a rectangle with glDrawElements(GL_TRIANGLES, ...).\n\nI made a shader, It works, but how to transform it?\n\nVertex shader\n\n#version 330 core\n\nlayout (location = 0) in vec2 position;\n\nvoid main()\n{\n gl_Position = vec4(position, 0.0, 1.0);\n}\n\n\nfragment shader\n\n#version 400 core\n\nuniform mat4 u_mvp;\nuniform vec2 u_resolution;\nout vec4 color;\n\nfloat pow2(float x) { return x * x; }\n\nvoid main()\n{\n vec2 d = (gl_FragCoord.xy / u_resolution.xy) * 2 - vec2(1.0);\n vec4 pos = vec4(d, 0.0, 0.0);\n vec4 center = vec4(0.0);\n\n float r = distance(pos, center);\n r = step(0.5, r);\n color = vec4(0.7f, 0.8f, 0.1f, 1.0f - r);\n} \n\n\nHow to add MVP support?." ]
[ "c++", "opengl", "glsl", "shader" ]
[ "BIRT reports and IntelliJ", "I have a similar problem - i was trying to run this code for IntelliJ Idea 13 and i would like to use rptdesign file to generate the report. The code looks like this:\n\npublic class ExecuteBIRTReport {\n static void executeReport() throws EngineException {\n\n EngineConfig config = null;\n IReportEngine engine = null;\n try {\n config = new EngineConfig();\n config.setLogConfig(\"/logs\", java.util.logging.Level.WARNING);\n\n Platform.startup(config);\n IReportEngineFactory factory = (IReportEngineFactory) Platform\n .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);\n engine = factory.createReportEngine(config);\n IReportRunnable report = null;\n String reportFilepath = \"C://Users//user//workspace//TestProject//Products.rptdesign\";\n try {\n report = engine.openReportDesign(reportFilepath);\n } catch (Exception e) {\n System.err.println(\"Report \" + reportFilepath + \" not found!\\n\");\n engine.destroy();\n return;\n }\n\n IRunAndRenderTask task = engine.createRunAndRenderTask(report);\n\n PDFRenderOption options = new PDFRenderOption();\n options.setOutputFormat(\"pdf\");\n options.setOutputFileName(\"C:/Users/user/workspace/TestProject/REPORT.pdf\");\n\n task.setRenderOption(options);\n\n try {\n task.run();\n } catch (EngineException e1) {\n System.err.println(\"Report \" + reportFilepath + \" run failed.\\n\");\n System.err.println(e1.toString());\n }\n engine.destroy();\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n /**\n * @param args\n */\n public static void main(String[] args) {\n // TODO Auto-generated method stub\n try {\n executeReport();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n}\n\n\nI imported the project IntelliJ following jar-files (without them do not eceive a compilation): \n\ncom.ibm.icu_54.1.1.v201501272100.jar\norg.eclipse.birt.core_4.5.0.v201506092134.jar\norg.eclipse.birt.data_4.5.0.v201506092134.jar\norg.eclipse.birt.report.data.adapter_4.5.0.v201506092134.jar\norg.eclipse.birt.report.engine_4.5.0.v201506092134.jar\norg.eclipse.birt.report.model_4.5.0.v201506092134.jar\norg.eclipse.core.runtime_3.11.0.v20150405-1723.jar\norg.eclipse.datatools.connectivity.oda_3.4.3.v201405301249.jar\norg.eclipse.equinox.common_3.7.0.v20150402-1709.jar\norg.eclipse.equinox.common_3.7.0.v20150402-1709.jar\norg.eclipse.osgi_3.10.100.v20150529-1857.jar\n\n\nIn Eclipse version of BIRT 4.5.0. and a report is created normally. In IntelliJ at the stage of creating a file error message:The output format <...> is not supported. I tried to arrange for the withdrawal of pdf and html formats, but to no avail. Does anyone know a solution?" ]
[ "java", "intellij-idea", "birt" ]
[ "Creation of array with results of different xPath::query(s). Improvement?", "I don't actually have a problem, however, I am looking to improve my source code. I have three different queries whose results should be combined in an array. An example of the array:\n\narray(\n array(\n 'q0-result' => '...',\n 'q1-result' => '...',\n 'q2-result' => '...'\n ),\n array(\n 'q0-result' => '...',\n 'q1-result' => '...',\n 'q2-result' => '...'\n )\n);\n\n\nSo now I have the following source code, however, I do not like the usage of $idx and how the array is being built. Do you have suggestions to improve the following source code?:\n\n$data = array();\n$dom = new DomDocument();\n@$dom->loadHTML(file_get_contents('http://www.example.com'));\n$xpath = new DomXpath($dom);\n\n$idx = 0;\nforeach($xpath->query('query0') as $element) {\n $data[$idx]['q0-result'] = $element->nodeValue;\n}\n\n$idx = 0;\nforeach($xpath->query('query1') as $element) {\n $data[$idx]['q1-result'] = $element->nodeValue;\n}\n\n$idx = 0;\nforeach($xpath->query('query2') as $element) {\n $data[$idx]['q2-result'] = $element->nodeValue;\n}\n\nvar_dump($data);" ]
[ "php", "arrays", "xpath" ]
[ "In netbeans 7 how do I skip testing and add maven additional parameters when building a maven project?", "I want to issue commands like -Dmaven.test.skip=true -Dcheckstyle.skip" ]
[ "java", "maven-2", "maven-plugin", "netbeans-7" ]
[ "To Replace Name with Another Name in a file", "I am very new to hadoop and i have requirement of scrubbing the file in which account no,name and address details and i need to change these name and address details with some other name and address which are existed in another file.\nAnd am good with either Mapreduce or Hive.\nNeed help on this.\nThank you." ]
[ "hadoop" ]
[ "MySQL timestamp select date range", "Not sure really where to start with this one. Can anyone help/point me in the right direction.\n\nI have a timestamp column in MySQL and I want to select a date range for example, all timestamps which are in Oct 2010.\n\nThanks." ]
[ "mysql", "timestamp" ]
[ "UWP : Links does not work in PDF after generating a PDF with ReportWriter (SyncFusion)", "I'm using a UWP application to generate a .pdf file from an .rdlc template file with Syncfusion components. I can generate the pdf from the rdlc template file but all the links in the pdf (text or image) does not work. The links work if I generate an html file but not in pdf file. Here is the code :\n\nvar pdfFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat(\"Order-\", this.Model.SaleReference, \".pdf\"), CreationCollisionOption.ReplaceExisting);\nusing (var stream = await pdfFile.OpenAsync(FileAccessMode.ReadWrite))\n{\n using (var outstream = stream.AsStreamForWrite())\n {\n var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;\n\n var reportStream = assembly.GetManifestResourceStream(\"UWP.OrderModule.Reports.Test.rdlc\");\n\n var writer = new ReportWriter(reportStream)\n {\n ExportMode = Syncfusion.ReportWriter.ExportMode.Local\n };\n\n writer.Save(outstream, WriterFormat.PDF);\n\n outstream.Dispose();\n }\n}\n\nawait Windows.System.Launcher.LaunchFileAsync(pdfFile);\n\n\nI also try with this code but the result is the same :\n\nvar file = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat(\"Order-\", this.Model.SaleReference, \".pdf\"), CreationCollisionOption.ReplaceExisting);\n\nusing (var stream = await WindowsRuntimeStorageExtensions.OpenStreamForWriteAsync(file))\n{\n var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;\n\n var reportStream = assembly.GetManifestResourceStream(\"UWP.OrderModule.Reports.Test.rdlc\");\n\n var writer = new ReportWriter(reportStream)\n {\n ReportProcessingMode = Syncfusion.ReportWriter.ProcessingMode.Local,\n ExportMode = Syncfusion.ReportWriter.ExportMode.Local\n };\n\n writer.Save(stream, WriterFormat.PDF);\n}\n\nawait Windows.System.Launcher.LaunchFileAsync(pdfFile);\n\n\nWhat is wrong ? Is there a problem in the ReportWriter class (Syncfusion.RdllO.RdllOExportEngine class) ?\nThanks for your help." ]
[ "pdf", "uwp", "syncfusion" ]
[ "In Spring MVC 3 how can you consume the following x-form-urlencoded request body?", "Request body is like the following:\n\ninvoice[id]=111&invoice[billingDatetime]=2012-02-03T21:49:33+00:00&customer[code]=MILTON_WADDAMS&transaction[id]=f5574752-4eb0-11e1-a628-40403c39f8d9&transaction[transactedDatetime]=2012-02-03T21:49:33+00:00&invoice[type]=subscription&transaction[amount]=651.85&transaction[response]=approved&invoice[invoiceNumber]=3524&customer[id]=kui\n\n\nI have the following code to handle the above request but it can not parse request body into the invoice and customer objects. Any suggestion is greatly appreciated! \n\npublic ModelAndView postPaymentSuccess(@ModelAttribute(\"invoice\") Invoice invoice,@ModelAttribute(\"customer) Customer customer,HttpServletRequest req, HttpServletResponse res) {\n .......}" ]
[ "spring", "spring-mvc" ]
[ "Custom allocation and Boehm GC", "In my on-again-off-again compiler project, I've implemented closures as allocated memory with an executable prefix. So a closure is allocated like this:\n\nc = make_closure(code_ptr, env_size, env_data);\n\n\nc is a pointer to a block of allocated memory, which looks like this:\n\nmovl $closure_call, %eax\ncall *%eax\n.align 4\n; size of environment\n; environment data\n; pointer to closure code\n\n\nclosure_call is a helper function that looks at the address most recently placed on the stack and uses it to find the closure data and code pointer. Boehm GC is used for general memory management, and when the closure is no longer referenced it can be deallocated by the GC.\n\nAnyway this allocated memory needs to be marked as executable; in fact the entire pages it spans get marked. As closures are created and deallocated, more and more heap memory in the process will be executable.\n\nFor defensive programming reasons I'd prefer to minimise the amount of executable heap. My plan is to try to keep all closures together on the same page(s), and to allocate and deallocate executable pages as needed; i.e. to implement a custom allocator for closures. (This is easier if all closures are the same size; so the first step is moving the environment data into a separate non-executable allocation that can be managed normally. It also makes defensive programming sense.)\n\nBut the remaining issue is GC. Boehm already does this! What I want is to somehow tell Boehm about my custom allocations, and get Boehm to tell me when they're able to be GC'd, but to leave it up to me to deallocate them.\n\nSo my question is, are there hooks in Boehm that provide for custom allocations like this?" ]
[ "compiler-construction", "garbage-collection", "closures", "boehm-gc" ]
[ "Is there a constant something like bits_in_byte (8)?", "Is there in C/C++ standart constant that reflects how many bits are there in one byte (8)? Something like CHAR_BIT but for byte." ]
[ "c++", "c", "byte", "constants", "bit" ]
[ "how to set default language to browser for all URLs opened?", "from selenium import webdriver\n\n driver = webdriver.Chrome()\n driver.get(\"https://...\")\n\n\nPython script: some URLs opened in English, some in Russian - which cause assertion problems\n\nHow to set all to English?\n\nThanks!" ]
[ "python-2.7", "url", "selenium-webdriver" ]
[ "Java regex to remove space between numbers only", "I have some strings like:\n\nString a = \"Hello 12 2 3 4 45th World!\";\n\n\nI wanna concatenate numbers as: \"Hello 12234 45th World\"\n\nBy trying a.replaceAll(\"(?<=\\\\d) +(?=\\\\d)\", \"\"), I got the result as:\n\"Hello 1223445th World\". \n\nIs there any way to concatenate only numbers, not number+th?" ]
[ "java", "regex" ]
[ "Set specified factor level as reference in GT regression?", "I am using gtsummary package to generate tables from logistic regressions. \n\nI would like to, for example, use the stage level \"T3\" in the trial data as the reference level, instead of the default \"T1\". How can I do that within this example code?\n\nI aim to do this for both univariate and multiple variable logistic regression, so I am presuming the answer shall work on both scenarios.\n\nlibrary(gtsummary)\nlibrary(dplyr)\n\ntrial %>%\n dplyr::select(age, trt, marker, stage, response, death, ttdeath) %>%\n tbl_uvregression(\n method = glm,\n y = death,\n method.args = list(family = binomial),\n exponentiate = TRUE,\n pvalue_fun = function(x) style_pvalue(x, digits = 2)) %>%\n # overrides the default that shows p-values for each level\n add_global_p() %>%\n # adjusts global p-values for multiple testing (default method: FDR)\n add_q() %>%\n # bold p-values under a given threshold (default 0.05)\n bold_p() %>%\n # now bold q-values under the threshold of 0.10\n bold_p(t = 0.10, q = TRUE) %>%\n bold_labels() %>% as_gt()\n\n\nSincerely,\nnelly" ]
[ "gtsummary" ]
[ "A little confused about rebuild/update_index for Django-Haystack", "I deleted a record from django app, then I followed it up with up with update_index and the record was still searchable. I then used rebuild_index and that seemed to work when I ran the search again. But I do not know if my computer stuttered or what but when I when to my django app all my records were gone. but I panicked hit the refresh button on the browser a couple of times and they reappeared. What I'd like to be clear on is this is, after I delete a record from my django app I run\n\n./manage.py rebuild_index \n\n\nand when I add a record to my django app I do this\n\n./manage.py update_index. \n\n\nIs this correct syntax? I do not want to inadvertently delete all my records from a lack of understanding the aforementioned commands thanks. The docs are not fully clear to me." ]
[ "python", "django", "django-haystack" ]
[ "createContext using a dynamic object", "1. Static object\n\nTo create context based on a static object, I use this code:\n\nimport React, { createContext } from 'react';\n\nconst user = {uid: '27384nfaskjnb2i4uf'};\n\nconst UserContext = createContext(user);\n\nexport default UserContext;\n\n\nThis code works fine.\n\n2. Dynamic object\n\nBut if I need to create context after fetching data, I use this code:\n\nimport React, { createContext } from 'react';\n\nconst UserContext = () => {\n\n // Let's suppose I fetched data and got user object\n const user = {uid: '18937829FJnfmJjoE'};\n\n // Creating context\n const context = createContext(user);\n\n // Returning context\n return context;\n\n}\n\nexport default UserContext;\n\n\nProblem\n\nWhen I debugg option 1, console.log(user) returns the object. Instead, option 2, console.log(user) returns undefined. What I'm missing?\n\nimport React, { useEffect, useState, useContext } from 'react';\nimport UserContext from './UserContext';\n\nconst ProjectSelector = (props) => {\n\n const user = useContext(UserContext);\n\n console.log(user);\n\n return(...);\n}\n\nexport default App;" ]
[ "reactjs", "react-hooks" ]
[ "Stuck with class structure in Windows 8 app development", "Required: I want an XML file to be serialized like this\n\n<StudentGroupList>\n <Group key = 1>\n <StudentItem>\n <Name> John </Name>\n <GroupName>1</GroupName>\n <StudentItem>\n <StudentItem>\n <Name> David</Name>\n <GroupName>1</GroupName>\n <StudentItem>\n </Group>\n <Group key = 2>\n <StudentItem>\n <Name> Ron</Name>\n <GroupName>2</GroupName>\n <StudentItem>\n </Group>\n </StudentGroupList>\n\n\nHere is the class structure I created to serialize and deserialize\n\n public class StudentItem\n {\n public string Name {get; set;}\n public int GroupName {get; set;}\n }\n\n public class StudentGroupList\n {\n public List<StudentItem> lstStudnetItem = new List<StudentItem>();\n public int key {get;set;}\n }\n class StudentDataSource\n {\n public List<StudentGroupList> lstStudnetGroup = new List<StudentGroupList>(); \n //Confusion in below line\n static StudentDataSource objDataSource = new StudentDataSource();\n }\n\n\nI have created a single instance of StudentDataSource so that I can use it globally on every page of my app. I want to use a single instance because this instance will deserialize from the XML file above and simultaneously update it as soon as any changes are made. Now as you see I have made this instance static, I can't access the lstStudnetGroup.\n\nPlease provide me a solution of class structure so that I can easily create an app." ]
[ "class", "windows-8", "structure", "datacontractserializer" ]
[ "How to fix the error The type 'IObjectContainer' exists in both", "The problem arose after the transition from the version SpecFlow 3.0 to Specflow 2.4.0\n\n[Binding]\npublic class Hooks \n{\n private readonly IObjectContainer _objectContainer;\n\n public Hooks(IObjectContainer objectContainer)\n {\n _objectContainer = objectContainer;\n }\n}\n\n\n\n Error CS0433 The type 'IObjectContainer' exists in both 'BoDi, Version=1.4.1.0, Culture=neutral, PublicKeyToken=ff7cd5ea2744b496' and 'TechTalk.SpecFlow, Version=2.4.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41'\n\n\nClose Visual Studio and clear bin and obj folders in your project directory - \ndid not help\n\nHow does the image solve the current problem?" ]
[ "c#", "nunit", "specflow" ]
[ "How to underline links in the navbar using Bootstrap 3?", "I'm trying to apply custom CSS styling to the Bootstrap navbar, so that the link text is underlined on mouseover. I'd also like the underline to fade in.\n\nHere is what I have so far: https://jsfiddle.net/xfddh0r5/\n\n.navbar-default {\n background-color: #fff;\n}\n.navbar-default .navbar-nav > li {\n background-color: #fff;\n}\n.navbar-default .navbar-nav > li > a {\n color: #333;\n border-bottom: 1px solid transparent;\n}\n.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {\n background-color: #fff;\n color: #439348;\n border-bottom: 1px solid #439348;\n}\n\n\nI've noticed two strange problems:\n\n\nThe underline appears at the bottom of the navbar, rather than directly under the text.\nThe link 'area' for the menu items seems to be too big. Ideally just the text would be a link.\n\n\nCould anyone tell me why this is happening?\n\nMany thanks!" ]
[ "html", "css", "twitter-bootstrap" ]
[ "MultiKeyMap vs. Map with Map values", "What would be the benefits of using MultiKeyMap vs. using Map with Map values in the matters of performance (any maybe readability, in your opinion)?" ]
[ "java", "data-structures" ]
[ "connected-react-router and office-ui-fabric-react", "Related post on Github\n\nCurrently I have a hard time using the two libraries in my react-redux app correctly.\n\nMy codes look like:\n\nindex.js\n\nimport { Provider } from 'react-redux';\nimport { ConnectedRouter } from 'connected-react-router';\n...\nReactDOM.render(\n <Provider store={store}>\n <ConnectedRouter history={history}>\n <App />\n </ConnectedRouter>\n </Provider>,\n rootElement\n);\n\n\nApp.js\n\n...\nexport default () => (\n <Layout>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route path=\"/test\" component={Test} />\n </Switch>\n </Layout>\n);\n\n\nLayout.js\n\n...\nexport default function Layout(props) {\n return (\n <div class=\"ms-Fabric\">\n <div class=\"ms-Grid-row\">\n <div class=\"ms-Grid-col ms-lg2\">\n <Navigation />\n </div>\n <div class=\"ms-Grid-col ms-lg10\">{props.children}</div>\n </div>\n </div>\n );\n}\n\n\nNavigation.js\n\nimport React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport { Nav } from 'office-ui-fabric-react';\n\nexport default withRouter(({ history }) => (\n <div className=\"ms-NavExample-LeftPane\">\n <Nav\n onLinkClick={(event, element) => {\n event.preventDefault();\n history.push(element.url);\n }}\n groups={[\n {\n links: [\n {\n name: 'Home',\n url: '/',\n key: 'home'\n },\n {\n name: 'Test',\n url: '/Test',\n key: 'test'\n }\n ]\n }\n ]}\n />\n </div>\n));\n\n\nHowever, when I run the app it shows You should not use <Route> outside a <Router>. The navigation is certainly in the ConnectedRouter and it seems this router works well with react-router v4 so I'm not sure how to deal with this problem.\n\nCould anyone please give me a suggestion?" ]
[ "javascript", "reactjs", "office-ui-fabric", "connected-react-router" ]
[ "Getting all the tasks scheduled in the Quartz.NET scheduler", "How I can get all the tasks that has been scheduled to the Quartz scheduler to display in a web page?" ]
[ "quartz.net" ]
[ "React: Pass context to dynamically loaded component", "I have a component that's being loaded dynamically, something like this:\n\nLoadScript(\"path/to/component.bundle.js\", () => {\n let comp = getComp()\n ReactDOM.render(<Provider store={store}>\n {comp}\n </Provider>, container)\n})\n\n\nand in the component.js:\n\nexport function getComp() {\n return <MyComponent />\n}\n\n\nHowever, the MyComponent does not have access to the store (which works if not loaded dynamically). If I change it to:\n\nexport function getComp() {\n return <Provider store={store}><MyComponent /></Provider>\n}\n\n\nthen it works, but the store doesn't really seem to be associated (like if there were 2 stores active). The store is created with createStore from 'react-redux'.\n\nCan anyone tell why MyComponent is not receiving the store/Provider context correctly? Thanks!\n\nUPDATE:\n\nI believe the problem is that I'm using code-splitting and loading both bundles together doesn't work.\n\nIn my webpack.config.js, I have:\n\nentry: {\n admin: './js/index.admin.js',\n kiosk: './js/index.kiosk.js'\n},\noutput: {\n filename: '[name].bundle.js',\n path: path.resolve(__dirname, 'dist'),\n libraryTarget: 'window',\n},\noptimization: {\n splitChunks: {\n chunks: 'all',\n maxInitialRequests: 2\n }\n}\n\n\nThen, from 'admin' I try to load the 'kiosk' bundle. That's creating 2 stores. Which makes sense since both bundle index files have the following at the top:\n\nimport store from './store'\n\n\nand store.js is defined as:\n\n...\nexport default createStore(reducer, middleware)\n\n\nThere's no problem with the reducers since they are all included in both bundles. \n Note this is not a SPA, but a legacy application that has some components in React." ]
[ "reactjs", "react-context" ]
[ "Hibernate persist() method", "Is the below statement a valid one?\n\npersist() also guarantees that it will not execute an INSERT statement if it is called outside of transaction boundaries\n\nWhen I try the below code using persist; then the row is getting inserted without any transaction (It is commented out).\n\nSessionFactory sessionFactory = new Configuration().configure(\"student.cfg.xml\").buildSessionFactory();\n Session session = sessionFactory.openSession();\n\n //Transaction tran = session.beginTransaction();\n\n /*\n * Persist is working without transaction boundaries ===> why?\n */\n\n Student student = new Student();\n student.setFirstName(\"xxx\");\n student.setLastName(\"yyy\");\n student.setCity(\"zzz\");\n student.setState(\"ppp\");\n student.setCountry(\"@@@\");\n student.setId(\"123456\");\n session.persist(student);\n //tran.commit();\n session.flush();\n session.close();" ]
[ "java", "hibernate" ]
[ "Spreading values on a bar chart with plotly", "I've got this list of numbers:\n\n[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.06973765202658326, 0.0759476951525558, 0.09813542688910697, 0.10382657209692146, 0.11627906976744186, 0.12999675008124797, 0.15083990401097017, 0.15699535052231145, 0.1582487142291969, 0.16269605108256963, 0.17534585680947898, 0.17575928008998876, 0.1797698945349952, 0.19140660888739167, 0.1957585644371941, 0.19736565837544265, 0.21997813082909887, 0.22955485152768082, 0.24996957973509318, 0.29229031347077095, 0.31290263206331675, 0.32396867885822933, 0.3546099290780142, 0.3868519865218288, 0.46728971962616817, 0.48625583010816714, 0.4941864275695728, 0.5247165920267484, 0.5524861878453038, 0.564214589168688, 0.6127450980392157, 0.641025641025641, 0.6548963526282728, 0.7150582862636703, 0.823158183564275, 0.9224003861210919, 0.9253497118428529, 1.0174746597810627, 1.1462377518949898, 1.2255992248732304, 1.3000416806982482, 1.398793198025233, 1.3995903637959621, 1.4131338320864506, 1.592256254439621, 1.6498929836480547, 1.9240644218177165, 2.0467034604427172, 2.0581059831456088, 2.2849018651470887, 2.321192247101101, 2.478639485813531, 2.502272275797079, 3.530109015879148, 4.062209258467651, 6.116463053656961, 7.042445376777638, 7.177446333392399, 7.997926085414144, 8.793098189482022, 13.318221845340986, 14.199853408258, 25.417144730372073, 32.31529306085785, 53.557772100818454]\n\n\nAnd I want to build a bar chart using plotly so I did this:\n\nimport plotly.offline as po\nfrom plotly.graph_objs import Scatter, Layout\nimport plotly.graph_objs as go\npo.offline.init_notebook_mode()\n\ndistribution = go.Histogram(\n x=my_list,\n xbins=dict(\n size=1\n )\n)\ndata = [distribution]\nlayout = go.Layout(\n title=\"Distribution\",\n)\nfig = go.Figure(data=data, layout=layout)\npo.iplot(fig)\n\n\nI obtain a chart like:\n\n\nBut when I change the size of xbins my chart doesn't change. How can I spread my first column?" ]
[ "python", "python-2.7", "charts", "bar-chart", "plotly" ]
[ "I need to round a value up in vb.net", "I,m developing a debt calculation program 'my problem is when i have to calculate the months to pay back the debt it comes to 28.04 and i have to get it to 29 can some one pls help me out. \nThank you in advance\n\nmy code looks like this:\n\n Dim b, SubMtP As Integer\n Dim outsUm, si\n\n outsUm = TextBox1.Text\n\n SubMtP = Format(Val(TextBox1.Text) / Val(TextBox2.Text), \"0.00\")\n Math.Round(SubMtP + 1)\n TextBox5.Text = Format(Val(TextBox4.Text) / 12, \"0.00\")\n\n For i As Integer = 1 To SubMtP" ]
[ "vb.net", "math" ]
[ "Javascript/Jquery Image preloader with isotope", "I am using the isotope jQuery plugin as a sort of gallery filter.\n\nI have 80 pictures that are either 300px x 200px or 200px x 300px, the issue i am having is that the isotope container that holds the images when clicking on the gallery tab somehow overlaps them as they are loading. It sometimes cant load all the images before the page stops loading you can see my site i am building here cake decadence. i was reading up about pre-loading images i read this stack overflow question here and he recommended image pre loader which i tried but its not working.\n\nMy html looks like this\n\n<div id=\"image_container\">\n <div id=\"container\">\n <img class=\"box wed cake\" src=\"/images/gallery/wed2.png\" />\n <img class=\"box wed cake\" src=\"/images/gallery/wed1.png\" />\n <img class=\"box wed cake\" src=\"/images/gallery/wed13.png\" />\n ...\n </div>\n</div>\n\n\nI put this in my isotope file for the page\n\n$(document).ready(function(){\nvar $container = $('#container');\n$container.isotope({\n filter: '',\n animationOptions: {\n duration: 750,\n easing: 'linear',\n queue: false,\n }\n });\n\n$('#filter a').click(function(){\n var selector = $(this).attr('data-filter');\n $container.isotope({ \n filter: selector,\n animationOptions: {\n duration: 750,\n easing: 'linear',\n queue: false,\n }\n });\nreturn false;\n});\n\n$('.box').preloader({\n loader: '/images/loading.gif',\n fadeIn: 700,\n delay : 200 \n});\n});\n\n\nIs there any way that i could eaither pre-load the images with in the whole container div and have the spinner floating in the container, or could i get it so that the container to pre-load the image sizes so that they dont sit on eachother?\n\nsorry if this is a noob question i have been reading the isotope docs for the last little while and cant get my head around it." ]
[ "javascript", "jquery-isotope", "preloader" ]
[ "How to Add variables to package.json", "I'm using ReactJS, and in the package.json file, I want to change my deploy URL dynamically based on a variable. I have two different servers: \"stg\" and \"dev\" with separate deploy URL.\n\nSomething like this:\n\nconst deployServer = \"dev\" or \"stg\"\n\n \"scripts\": {\n \"start\": \"node scripts/start.js\",\n \"build\": \"node scripts/build.js\",\n \"test\": \"node scripts/test.js\",\n \"deploy\":\"aws s3 sync build/ s3://\"+deployServer+\"-base-viewers-web-app\"\n},\n\n\nHow can I use that variable in the package.json file?" ]
[ "javascript", "reactjs", "package.json" ]
[ "How to NOT wait for a process to complete in batch script?", "I have a batch script that calls a process and currently it waits for the process to complete before going to the next line. Is there a way (or a switch) for it NOT to wait and just spawn the process and continue? I am using Windows 2008." ]
[ "windows", "command-line", "batch-file" ]
[ "React native expo not running in Simulator", "I am getting below error while running application in simulator.\nI tried to restart server but not work for me" ]
[ "reactjs", "react-native" ]
[ "Java how to write a timer", "I wanted to write a timer in java.which will do the following:\nwhen program starts,start the timer1 which will stop after 45 mins, at the same time start the second timer, which will stop after 15 mins. at this time the first timer will starts again, and repeat the above loop until the program exits\nfirst timer : 45 min (the time I can use computer)\nsecond timer: 15 min (the pause time)\nfirst timer : 45 min (the time I can use computer)\nsecond timer: 15 min (the pause time)\nfirst timer : 45 min (the time I can use computer)\nsecond timer: 15 min (the pause time)\n\nI dont know how to use the thread and timer (utils,swing) so I tried to use while(true) but the cpu goes up.\nhere is my current code\n\nstatic int getMinute(){\n Calendar cal=Calendar.getInstance();\n int minute=cal.getTime().getMinutes();\n return minute;\n}\n\npublic static Runnable clockf(){\n if (endTime>=60){\n endTime=endTime-60;}\n System.out.println(startTime);\n System.out.println(currentTime);\n System.out.println(endTime);\n\n if(currentTime==endTime){\n pauseStart=getMinute();\n currentTime=getMinute();\n pauseEnd=pauseStart+15;\n\n if(currentTime==pauseEnd){\n pauseStart=0;\n pauseEnd=0;\n startTime=getMinute();\n currentTime=getMinute();\n endTime=startTime+45;\n }\n }\n else{\n update();\n }\n\n return null;\n\n\n}\n\nprivate static void update() {\n currentTime=getMinute();\n System.out.println(currentTime);\n}\n\npublic static void main(String[] args) {\n startTime=getMinute();\n currentTime=getMinute();\n endTime=startTime+45;\n\n Thread t=new Thread(clockf());\n t.setDaemon(true);\n t.start();\n try {\n Thread.currentThread().sleep(1000);//60000\n\n } catch (InterruptedException e) {\n System.err.println(e);\n }\n\n\n\n }\n\n\nbut it isnt good. are there any way to make the clockf method run only once / min ?\nor any other way to make that timer runs ?" ]
[ "java" ]
[ "Calling stored procedure with parameter TABLE OF INTEGER parameter", "I'm having a hard time with the most compatibility unfriendly database engine ever a.k.a Oracle.\nI have this custom type:\nCREATE OR REPLACE TYPE INTEGERS_ARRAY AS TABLE OF INTEGER;\n\nAnd this simple stored procedure:\nCREATE OR REPLACE PROCEDURE TEST_PROCEDURE_MAHMOUD(\n holy_array IN INTEGERS_ARRAY,\n some_kind_of_number1 IN NUMBER,\n some_kind_of_number2 IN NUMBER,\n query_result OUT SYS_REFCURSOR\n)\nAS\n BEGIN\n OPEN query_result FOR\n SELECT CODE,AIRWAYBILL_DATE,REFERENCE1,REFERENCE2 FROM SHIPMENTS\n ORDER BY AIRWAYBILL_DATE DESC\n FETCH NEXT 10 ROWS ONLY;\n end;\n\nThis stored procedure is a simplified version of another very complicated one which is also not working. I'm having the same exception on both:\n\nOracle.ManagedDataAccess.Client.OracleException\nORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'TEST_PROCEDURE_MAHMOUD'\nORA-06550: line 1, column 7: PL/SQL: Statement ignored\n\nThis is what I tried to do in C#:\nvar result = new List<string>();\n\nusing(var con = new OracleConnection(connectionString))\n{\n using(var command = con.CreateCommand())\n {\n con.Open();\n command.CommandText = "TEST_PROCEDURE_MAHMOUD";\n command.CommandType = System.Data.CommandType.StoredProcedure;\n\n // Parameters\n var array = new OracleParameter("holy_array", OracleDbType.Int64, ParameterDirection.Input);\n array.UdtTypeName = "MY_SCHEMA.INTEGERS_ARRAY";\n array.CollectionType = OracleCollectionType.PLSQLAssociativeArray;\n array.Size = 100;\n array.Value = new int[] { 100, 101 };\n\n var number1 = new OracleParameter("some_kind_of_number1", OracleDbType.Int64, 1, ParameterDirection.Input);\n var number2 = new OracleParameter("some_kind_of_number2", OracleDbType.Int64, 1, ParameterDirection.Input);\n var cursor = new OracleParameter("query_result", OracleDbType.RefCursor, ParameterDirection.Output);\n command.Parameters.AddRange(new[] { array, number1, number2, cursor });\n\n var reader = command.ExecuteReader();\n\n while (reader.Read())\n {\n var awb = reader.GetString(0);\n result.Add(awb);\n }\n }\n}\n\nreturn result;\n\nIsn't Oracle supposed to understand the very simple (table of integers) type and accept an array of integer for that type? How can I solve this problem? I have gone through the documentation in the official website, I read code samples on GitHub, I searched a lot and couldn't find any working example only work-around solutions like creating a temp-table which I do not want to do.\nThanks in advance.\nEDIT: the Entity Framework Core tag is because I tried to do this with EF Core first but it didn't work, I switched to ADO.NET, thinking it might be EF Core's issue. But it turns out that EF Core is too good to let me down like this." ]
[ "c#", ".net-core", "entity-framework-core", "ado.net", "oracle18c" ]
[ "Handsontable not rendering properly inside a q-tab-panel", "I have some quasar panels with some content inside. One of these contents is a handsontable but it is not rendering correctly. At the beginning of the code I perfectly render a handsontable into a q-card.\n\nWell drawn handsontable \n\nThe exact same piece of code is drawn incorrectly if I put it inside a q-tab-panel.\n\nIncorrectly drawn handsontable \n\nThis is the whole code of my vue component\n<template>\n <q-page padding>\n <q-card class="q-pa-md q-mt-lg">\n <div id="example1" class="hot">\n <hot-table :settings="hotSettings"></hot-table>\n </div>\n </q-card>\n <q-card class="q-pa-md q-mt-lg">\n <q-tabs v-model="tab">\n <q-tab v-for="tab in tabs" :key="tab.name" v-bind="tab"/> \n </q-tabs>\n <q-tab-panels v-model="tab" animated>\n <q-tab-panel v-for="tab in tabs" :key="tab.name" :name="tab.name" class="q-pa-none">\n <h5>{{tab.name + " content"}}</h5>\n <div id="example1" class="hot">\n <hot-table :settings="hotSettings"></hot-table>\n </div>\n <div v-for="n in 5" :key="n" class="q-my-md">{{ n }}. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis praesentium cumque magnam odio iure quidem, quod illum numquam possimus obcaecati commodi minima assumenda consectetur culpa fuga nulla ullam. In, libero.</div>\n </q-tab-panel>\n </q-tab-panels>\n </q-card>\n </q-page>\n</template>\n\n<script>\nimport { HotTable } from '@handsontable/vue';\nimport Handsontable from 'handsontable';\nimport 'handsontable/dist/handsontable.full.css';\n\nexport default {\n components: { HotTable },\n name: 'somename',\n data () {\n return {\n tab: 'tab1',\n tabs : [\n { name: 'tab1', label: 'tab 1' },\n { name: 'tab2', label: 'tab 2' },\n { name: 'tab3', label: 'tab 3' },\n { name: 'tab4', label: 'tab 4' }\n ],\n hotSettings: {\n data: Handsontable.helper.createSpreadsheetData(6, 10),\n rowHeaders: true,\n colHeaders: true,\n renderAllRows: true\n },\n }\n }\n}\n</script>\n\nWhat should I do to get the same result from the start of the code inside the tab panels?" ]
[ "vue.js", "handsontable", "quasar" ]
[ "top align in html table?", "how can i get the images and the content to the right to top align?\ni tried valign=\"top\" as you can see.\n\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr valign=\"top\">\n <td valign=\"top\"><img alt=\"\" style=\"border: 0px solid;\" src=\"/Portals/0/affiliates/NFL.png\" /></td>\n <td valign=\"top\"> </td>\n <td valign=\"top\" style=\"padding-left: 10px;\"><strong><span class=\"cnt5_heading\" style=\"color: #c00000;\">NFL</span><br />\n </strong><span class=\"body_copy\" valign=\"top\">The official website for the National Football League. <a href=\"http://www.nfl.com/\" target=\"_blank\">Learn more >></a></span></td>\n </tr>\n <tr valign=\"top\">\n <td> </td>\n <td> </td>\n <td> </td>\n </tr>\n <tr valign=\"top\">\n <td valign=\"top\"><img alt=\"\" src=\"/Portals/0/affiliates/NFL_players_association.png\" /></td>\n <td> </td>\n <td valign=\"top\" style=\"padding-left: 10px;\"><strong><span class=\"cnt5_heading\" style=\"color: #c00000;\">NFL Players Association</span><br />\n </strong><span class=\"body_copy\" valign=\"top\">\"We, The National Football League Players Association ... Pay homage to our predecessors for their courage, sacrifice, and vision; ... Pledge to preserve and enhance the democratic involvement of our members; ... Confirm our willingness to do whatever is necessary for the betterment of our membership - To preserve our gains and achieve those goals not yet attained.\" <a href=\"http://www.nflplayers.com\" target=\"_blank\">Learn more >></a></span></td>\n </tr>\n <tr valign=\"top\">\n <td> </td>\n <td> </td>\n <td> </td>\n </tr>\n <tr valign=\"top\">\n <td valign=\"top\"><img alt=\"\" src=\"/Portals/0/affiliates/NFL_play_benfits.png\" /></td>\n <td><strong> </strong></td>\n <td valign=\"top\" style=\"padding-left: 10px;\"><strong><span class=\"cnt5_heading\" style=\"color: #c00000;\">NFL Player Benefits</span></strong><br />\n <span class=\"body_copy\">A Complete guide to the benefits available for NFL players. <a href=\"http://nfla.davidhenryagency.com/BenefitsampServices.aspx\" target=\"_self\">Learn more >></a></span></td>\n </tr>\n <tr valign=\"top\">\n <td> </td>\n <td> </td>\n <td> </td>\n </tr>\n <tr valign=\"top\">\n <td valign=\"top\"><img alt=\"\" src=\"/Portals/0/affiliates/NFL_hall_fame.png\" /></td>\n <td> </td>\n <td valign=\"top\" style=\"padding-left: 10px;\"><strong><span class=\"cnt5_heading\" style=\"color: #c00000;\">Pro football Hall of Fame</span></strong><br />\n <span class=\"body_copy\">The Mission of the Pro Football Hall of Fame is: To honor, preserve, educate and promote. <a href=\"http://www.profootballhof.com/default.aspx\" target=\"_blank\">Learn more >></a></span><br />\n </td>\n </tr>\n </tbody>\n</table>" ]
[ "html" ]
[ "Has MongoDB a solution for Deadlocks?", "Has Mongodb a solution for Deadlock? Does it happen essentially in mongodb?\nIf yes, How can I resolve that?\n\nTnx" ]
[ "mongodb", "deadlock" ]
[ "Add Team Member in iCloud Dashboard", "A friend and I are trying to work on the same app using CloudKit together, but I can't figure out how to add him to the dashboard. Under the Admin section there is an option for Team but when I click on it there is no + or anything indicating an option to add him to the dashboard.\n\nEdit I did add my friend as a developer on my developer account but it didn't change anything." ]
[ "ios", "database", "xcode", "icloud", "cloudkit" ]
[ "Updating multiple values in an SQLite column with Python", "I have an SQLite table with a constant number of rows. But as I generate values derived from some of these columns (new features), I want to add columns on the fly, alongside existing columns, without creating any new rows. I can add a column using ALTER TABLE, but calling cur.executemany(\"INSERT INTO...\") causes the values to be appended in new rows. \n\nI've tried:\n\ncur.executemany(\"UPDATE DOS_APPENDIX SET FEATURE2=?\", [(val,) for val in [\"a\", \"b\", \"c\"]])\n\nFor some reason this causes the \"c\" to be duplicated across rows 1, 2, 3 in column FEATURE2. And it's slow on a large list (~2 million).\n\nIs there a way to bulk update? Something as graceful and fast as calling cur.executemany(INSERT INTO...)? \n\nDo I have to update the rows one by one with a for loop? \n\nIf so, how would I do this if I don't have a WHERE condition (only row numbers)?\n\nNote: The creation of a parallel column alongside an existing one comes with null values. These then get overwritten." ]
[ "python", "sqlite" ]
[ "Compass/Sass, Blueprint with ASP.NET/MVC", "I would like to use Compass/Sass with Blueprint or 960 with ASP.NET MVC.\n\nI am aware of Paul Bett's wonderful NuGet Package SassAndCoffee\n\nhttp://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/ \n\nBut how can I use Compass with Blueprint or 960 as well with ASP.NET MVC?\n\nI am also aware of these instructions:\n\nUsing Sass via Compass in ASP.NET MVC\nhttp://paceyourself.net/2010/08/23/using-sass-via-compass-in-aspnet-mvc/ \n\nSo by combining these two recommendations I should be able to use Compass/Sass with Blueprint or 960?\n\nAlso is there a good book or tutorials now available for Compass/Sass?\nI see that there will be the book by Manning, \"Sass and Compass in Action\" but it is not ready yet.\n\nIt does seem like Compass/Sass, Blueprint, CoffeeScript is the way to go. I just wish there was an easy way to use these packages with ASP.NET MVC." ]
[ "asp.net", "asp.net-mvc", "sass", "compass-sass", "blueprint-css" ]
[ "Problem wuth Ruby threads", "I write a simple bot using \"SimpleMUCClient\". But got error: app.rb:73:in stop': deadlock detected (fatal)\nfrom app.rb:73:in'. How to fix it?" ]
[ "ruby", "multithreading", "xmpp" ]
[ "Accidentally deleted the only Azure subscription owner role", "I accidentally deleted the only azure owner role of my subscription. Any idea how can I get that restore? I can only login now at azure portal and when I click on subscriptions it is keep loading, nothing is coming." ]
[ "azure", "cloud", "subscription", "rbac" ]
[ "Getting the correct length of string with special character", "The following code returns 3:\n\n#include <string>\n\nint main() {\n std::string str = \"€\";\n return str.length();\n}\n\n\nI want it to return 1. It returns 3 because the euro symbol is represented by \"\\342\\202\\254\". I need it to return 1 to align some text in columns." ]
[ "c++" ]
[ "Real-life use of SLA operator in VHDL", "Most, if not all, VHDL textbooks casually list the arithmetic operators and amongst them even more so casually the Shift Left Arithmetic (SLA) as shift left that fills with rightmost element. Although even wikipedia disagrees with this definition, I have never seen anyone to even blink an eye to this definition, it's just taken in with a face value, \"yup, makes sense\".\n\nHowever, the apparent complete uselessness of filling with the rightmost value in binary arithmetics made me to wonder - has anyone found a really good use for SLA in real life? \n\n(I'm not against the existence of SLA, nor want to eradicate it from VHDL. This is just a bit of fun for the Easter holidays...)" ]
[ "vhdl" ]
[ "Equivalent of JPanel in JFace?", "In Swing, it was east to create a nice looking GUI display window thanks to the ability to add JPanels to JFrames and keep everything nice and organized.\n\nI'm working in JFace now, and after looking around for almost an hour, I can't find anything in JFace that resembles JPanel. \nDoes anyone know of anything that could help me accomplish what I need in JFace?" ]
[ "java", "user-interface", "jpanel", "jface" ]
[ "C# Select query Varchar Scientific Notation Issue", "I have 150 000 records of products. Products has partno some has long number like 662750944011590 and some has 009093j\n\nBut long no is convert to scientific notation like 6.62751E+14. I am using partno as autocomplete inside gridview.\n\nUser can't understand scientific notation. So basically i want to get number as string.\n\n\n\nI had used dtswizard from csv to sql server. In CSV it is long number but in SQL it is imported as scientific notation. Don't know why?\n\nType of SQL column is Varchar(Max).\n\nCode of Retriving and adding to AutoCompleteStringCollection datagrid is :\n\nusing (SqlConnection connection = new SqlConnection(connectionstring))\n {\n SqlDataAdapter adapter = new SqlDataAdapter();\n adapter.SelectCommand = new SqlCommand(\"select PartNo,PartDescription,HSN,MRP,GST from products_data\", connection);\n adapter.Fill(dataset);\n\n Dataset products_tbl = dataset.Tables[0];\n //data is AutoCompleteStringCollection object\n for (int i = 0; i < products_tbl.Rows.Count; i++)\n data.Add(products_tbl.Rows[i][\"PartNo\"].ToString());\n }" ]
[ "c#", "sql" ]
[ "Is it possible to overload Func and Func having the same name?", "First of all, I know I can just define two overloaded helper methods to do what I need (or even just define two Func<>s with different names), but these are only used by one public method, so I'm exploring ways to define two local Func<>s that also overload by using the same name. Take, for example:\n\nstring DisplayValue(int value)\n{ return DisplayValue(value, val => val.ToString()); }\n\nstring DisplayValue(int value, Func<int, string> formatter)\n{ return (value < 0) ? \"N/A\" : formatter(value); }\n\n\nI need to call one or the other version many times in my public method to custom format special values, so I thought I could \"translate\" the above into something like this:\n\nFunc<int, Func<int, string>, string> displayValue =\n (value, formatter) => (value < 0) ? \"N/A\" : formatter(value);\n\nFunc<int, string> displayValue =\n value => displayValue(value, val => val.ToString());\n\n\nEven as I was typing it I knew I couldn't declare two delegate identifiers having the same name, even if they are different types. This is more academic than me being dead set on achieving overloads using Func<>s, but I guess they just can't do everything, right?\n\nAnd I guess you can't do something like this, either:\n\nFunc<string, params object[], string> formatArgs =\n (format, args) => string.Format(format, args);" ]
[ "c#", "delegates", "overloading", "func" ]
[ "Is there any reason to continue using IntentService for handling GCM messages?", "As you know, recently Google changed their GCM documentation, and they claim that an IntentService is no longer required for handling arriving GCM messages. All the handling can be done in the BroadcastReceiver.\n\nWhen trying to figure out if there is any good reason to continue using the IntentService, I came across this quote:\n\n\n A Service (typically an IntentService) to which the WakefulBroadcastReceiver passes off the work of handling the GCM message, while ensuring that the device does not go back to sleep in the process. Including an IntentService is optional—you could choose to process your messages in a regular BroadcastReceiver instead, but realistically, most apps will use a IntentService.\n\n\nWhy would most apps use an IntentService? Are there any scenarios in which handling the GCM message directly in the BroadcastReceiver won't work?" ]
[ "android", "push-notification", "broadcastreceiver", "google-cloud-messaging", "intentservice" ]
[ "Adding a secondary legend for linetype in ggplot", "So basically my plot is almost done except a second linetype legend that distinguish social media platforms I would like to add. Could anyone check why the code does not work (the second legend does not pop up)? Thank you!\nlibrary(ggplot2)\n\ncountry <- read.csv("http://sanhochung.com/wp-content/uploads/2021/02/social_media_by_country.csv")\n\nggplot(data = country, aes(x = Year, y = instagram)) +\n geom_line(aes(color = Country)) +\n geom_line(data = country, aes(x = Year, y = facebook, color = Country), linetype = "longdash")+\n geom_line(data = country, aes(x = Year, y = twitter, color = Country), linetype = "dotted")+\n labs(title="Total percentage of national population using social media",\n x ="Year", y = "Percentage of platform user", caption = "Source: datareportal.com, self-reported by internet users in January") +\n ylim(0, 100)+\n theme(plot.title = element_text(hjust = 0.5))+\n scale_linetype_manual(name = "Platform",\n values = c("longdash","solid", "dotted"),\n breaks = c("Facebook", "Instagram", "Twitter"),\n guide = guide_legend(override.aes = list(linetype = c("longdash","solid", "dotted"),\n color = "black")))" ]
[ "r", "ggplot2" ]
[ "Can I run .exe file on Heroku?", "I am building a node app that has a function that requires running an .exe file. I am using the .exe because it was the only was I was able to get my my legacy fortran code to compile (through intel visual fortran). Will I be able to get my app to run through heroku, and if so, is there anything I need to do besides the basic deploy?\n\nThanks in advance." ]
[ "node.js", "heroku" ]
[ "Difference between FutureTask and AsyncTask in android", "I want to know the difference between FutureTask and AsyncTask in android. According to my thinking we can get the current situation in FutureTask. Using ExecutorService we can create a pool of parallel processes. Same property we can achieve using AsyncTask . I want to know the situation where to use AsyncTask and when to use FutureTask. \n\nI have asked a Question here but not getting any response . Now i think i should change my way of getting webservices data. So i think i should use FutureTask because they have function like isDone()\n\nand cancel. Please some one guide me any better way to retrieve data from web-services. because my textView set's the adapter too slow.\n\nOr simply i need a way to cancel the running AsyncTasks or replace it with the current. When user press w it call for the AsyncTask and when he added any word to it in AutotextView it will call thrice for waka one for wa and wak and one for waka . Is it possible to cancel the running task when user presses another text. See my Question here for Details." ]
[ "android", "android-asynctask", "futuretask" ]
[ "Android Studio SQLite Database Unable to find on Android Device Monitor", "I'm trying to create a database to store data entered on the journal app I'm developing at the moment, but I came across an small issue where I try to see if the database is created, but it doesn't show when I look on Android Device Monitor > data > data > database folders.\n\nWhat exactly am I missing on my code?\n\n public class DBOpenHelper extends SQLiteOpenHelper{\n\n\n //Constants for db name and version\n private static final String DATABASE_NAME = \"notes.db\";\n private static final int DATABASE_VERSION = 1;\n\n //Constants for identifying table and columns\n public static final String TABLE_NOTES = \"notes\";\n public static final String NOTE_ID = \"_id\";\n public static final String NOTE_TEXT = \"noteText\";\n public static final String NOTE_CREATED = \"noteCreated\";\n\n //SQL to create table\n private static final String TABLE_CREATE =\n \"CREATE TABLE \" + TABLE_NOTES + \" (\" +\n NOTE_ID + \" INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n NOTE_TEXT + \" TEXT, \" +\n NOTE_CREATED + \" TEXT default CURRENT_TIMESTAMP\" +\n \")\";\n\n public DBOpenHelper(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }\n\n @Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(TABLE_CREATE);\n }\n\n @Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NOTES);\n onCreate(db);\n }\n}\n\n\n\n\n public class HomeActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener\n{\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_home);\n DBOpenHelper helper = new DBOpenHelper(this);\n SQLiteDatabase database = helper.getWritableDatabase();\n}" ]
[ "java", "android", "sqlite", "android-studio", "mobile-development" ]
[ "Hover query - NAV bar CSS effecting DIV class", "The following CSS code creates a NAV bar with some sample boxes within a container.\n\nI was having problems with the Hover staying on so with some advice from here I included the extra code (second block of code down)\n\n .dropdown>ul>li>a:hover {margin-bottom:20px;}\n\n\nThis extra code worked well\n\nHowever it has had a side effect on my DIV boxleft in that in wont stay left - as I move the mouse across the NAV bar it moves with it......... I just want to keep DIV boxleft on the left hand side. Can you help? Many thanks.\n\n /* Navigation Style */ \n .dropdown { position:relative; font-family: arial, sans-serif; width:100%; height:40px; border:1px solid #666666; font-size:14px; color:#ffffff; background:#333333; z-index:2; } \n\n /* Basic List Styling (First/Base Level) */ \n .dropdown ul {padding:0; margin:0; list-style: none;} \n .dropdown ul li {float:left; position:relative;} \n .dropdown ul li a { border-right:1px solid #666666; padding:12px 8px 12px 8px; display:block; text-decoration:none; color:#000; text-align:center; color:#fff;} \n .dropdown>ul>li>a:hover {margin-bottom:20px;}\n .dropdown ul li a:hover {color:#ffffff; background:#232323;} \n\n /* Second Level Drop Down Menu */ \n .dropdown ul li ul {display: none;} \n .dropdown ul li:hover ul { font-size:13px; display:block; position:absolute; top:41px; min-width:150px; left:0;} \n .dropdown ul li:hover ul li a {display:block; background:#000; color:#ffffff; width:170px; } \n .dropdown ul li:hover ul li a:hover {background:#666666; color:#ffffff;} \n\n /* Third Level Drop Down Menu */ \n .dropdown ul li:hover ul li ul {display: none;} \n .dropdown ul li:hover ul li:hover ul { display:block; position:absolute; left:145px; top:0; } \n\n #container {\n overflow:hidden;\n background-color:yellow;\n width:1250px;\n padding 10px 10px 10px 10px;\n border:1px solid #666666;\n margin: 0 auto;\n }\n\n\n .boxleft {\n float:left;\n background-color:blue;\n margin-top:30px;\n margin-bottom:10px;\n margin-left:10px;\n margin-right:10px;\n width:600px;\n border:1px solid #666666;\n z-index:1;\n } \n\n\nEDIT\n\nFiddle here : - http://jsfiddle.net/LUzNm/" ]
[ "css", "hover" ]
[ "errors with structure save and load function", "#include <stdio.h>\n#include <stdlib.h>\n\nstruct birdhome{\n int area;\n int heightcm;\n int feederquantity;\n char hasNest[6];\n};\nstruct bird{\n char isRinged[6];\n char nameSpecies[50];\n int birdAgeMonths;\n struct BirdHome *hom;\n char gender[7];\n};\n\nint save(char * filename, struct bird *st, int n);\nint load(char * filename);\n\nint main(void)\n{\n char * filename = "birds.dat";\n struct bird birds[] = { "True","sparrow",3,10,20,2,"False","Male","False","crane",24,50,100,6,"True","Female","False","False","griffin",10,100,80,1,"False","Male" };\n int n = sizeof(struct bird) / sizeof(birds[0]);\n\n save(filename, birds, n);\n load(filename);\n return 0;\n}\n\nint save(char * filename, struct bird * st, int n)\n{\n FILE * fp;\n char *c;\n \n int size = n * sizeof(struct bird);\n\n if ((fp = fopen(filename, "wb")) == NULL)\n {\n perror("Error occured while opening file");\n return 1;\n }\n \n c = (char *)&n;\n for (int i = 0; i<sizeof(int); i++)\n {\n putc(*c++, fp);\n }\n \n c = (char *)st;\n for (int i = 0; i < size; i++)\n {\n putc(*c, fp);\n c++;\n }\n fclose(fp);\n return 0;\n}\n\nint load(char * filename){\n FILE * fp;\n char *c;\n int m = sizeof(int);\n int n, i;\n\n \n int *pti = (int *)malloc(m);\n\n if ((fp = fopen(filename, "r")) == NULL)\n {\n perror("Error occured while opening file");\n return 1;\n }\n \n c = (char *)pti;\n while (m>0)\n {\n i = getc(fp);\n if (i == EOF) break;\n *c = i;\n c++;\n m--;\n }\n \n n = *pti;\n\n \n struct bird * ptr = (struct bird *) malloc(n * sizeof(struct bird));\n c = (char *)ptr;\n \n while ((i= getc(fp))!=EOF)\n {\n *c = i;\n c++;\n }\n \n printf("\\n%d birds in the file stored\\n\\n", n);\n\n for (int k = 0; k<n; k++)\n {\n printf("%-10d %-6s %-50s %-24d %-100d %-100d %-10d %-10s %-10s \\n", k + 1, (ptr + k)->isRinged, (ptr + k)->nameSpecies,(ptr + k)->birdAgeMonths,(ptr + k)->hom.area,(ptr + k)->hom.heightcm,(ptr + k)->hom.feederquantity,(ptr + k)->hom.hasNest,(ptr + k)->gender);\n }\n\n\nWell, the program is theoretically running. The problem is with the printf inside the load function.\nThe error says that all the structure types that come in struct Birdhome is a\npointer and that I should use -> instead of . in it.\nBut when I do this it says that I should change the . to ->." ]
[ "c", "struct" ]
[ "How to get jackson to ignore non-DTO objects", "We recently upgraded to GlassFish Jersey 2.7 from the Sun Jersey implementation. When we did this Jackson started trying to deserilize our Domain objects. Which in our case isn't what we want. We have Domain setup so that domain objects are never directly sent out via the web services. Everything is transformed in to a DTO and then sent out. So basically we just call\n\nreturn Response.ok(new SomeFooBarDTOObject(someFooBarDomainObject)).build()\n\nand this use to work with the previous version of Jersey/Jackson. With the more up to date code we're getting errors like the following:\n\nConflicting setter definitions for property \"preferredItem\": com.foo.domain.FooBar#setPreferredItem(1 params) vs com.foo.domain.FooBar#setPreferredItem(1 params)\n\nEven though we never try to send out the actual domain object. How do we tell Jackson to only look at objects that are actually received or sent via a web service.\n\nHere is the web service that is causing the issue I've simplified it down to just this. If I take out the RestaurantItemDTO restaurantItemDTO from the method parameters it works, but if I keep it in there it doesn't.\n\nRestaurantItemDTO only has base types in it's fields. The only way it references a domain object is through a constructor parameter, and there is also a public no parameter constructor as well. So it's not the only constructor.\n\n@Controller\n@Path(\"/restaurant/restaurantItem\")\npublic class RestaurantItemWebService {\n @PUT\n @Path(\"/ordersheets/{ordersheetId}/{locationId}/restaurantItems/{restaurantItemId}\")\n @Produces(value = MediaType.APPLICATION_JSON)\n @Consumes(value = MediaType.APPLICATION_JSON)\n @Transactional\n @PreAuthorize(\"hasRole('\" + PermissionNames.SOME_PERMISSION+ \"')\")\n public Response saveExistingRestaurantItem(@PathParam(\"ordersheetId\") Long orderSheetID, @PathParam(\"restaurantItemId\") Long restaurantItemID, RestaurantItemDTO restaurantItemDTO) {\n return Response.ok(restaurantItemDTO).build();\n }" ]
[ "java", "spring", "jersey", "jackson" ]
[ "What is the purpose of GAE entities?", "There are some GAE entities created for my app:\n\n\n_GAE_MR_MapreduceState\n_GAE_MR_ShardState\n_GAE_MR_TaskPayload\n_AE_Backup_Information\n_AE_Backup_Information_Kind_Type_Info\n_AE_DatastoreAdmin_Operation\n\n\nWhat is there purpose? Can I delete them?\n\nP.S. Looks like last 3 are related to the backup I've made. Do I need to keep them (the backup itself is stored in the blobstore)?" ]
[ "google-app-engine", "app-engine-ndb" ]
[ "AttributeError: 'ResizableDraggablePicture' object has no attribute 'scale'", "I'm new to python and Kivy programming so getting trouble and may be asking simple question here, but its a big hurdle for me now. I am developing a GUI with kivy. I have camera and, I have a zoom button.\nI want when Clicked on zoom button , zoom in or zoom out picture .\nbut It's not work and I've get this Error :\n if self.scale < 10 :\nAttributeError: 'ResizableDraggablePicture' object has no attribute 'scale'\n\nand this is my code :\nfrom kivy.app import App\nfrom kivy.uix.widget import Widget\nfrom kivy.lang import Builder\nfrom kivy.properties import ObjectProperty\nfrom kivy.uix.screenmanager import ScreenManager , Screen\nfrom kivy.uix.image import Image\nfrom kivy.core.window import Window\nfrom kivy.base import runTouchApp\nfrom kivymd.app import MDApp\nfrom kivy.uix.boxlayout import BoxLayout\nimport time\nfrom kivy.core.window import Window\n\nWindow.size = (1000, 700)\n\nclass ResizableDraggablePicture(Screen):\n def on_touch_down(self, touch):\n if touch.is_mouse_scrolling:\n if touch.button == 'scrolldown':\n if self.scale < 10:\n self.scale = self.scale * 1.1\n elif touch.button == 'scrollup':\n if self.scale > 1:\n self.scale = self.scale * 0.8\n else:\n super(ResizableDraggablePicture, self).on_touch_down(touch)\n\n\nclass MainPage(Screen):\n pass\n\nclass WindowManager(ScreenManager):\n pass\n\nclass CameraClick(Screen):\n def capture(self):\n camera = self.ids['camera']\n timestr = time.strftime("%Y%m%d_%H%M%S")\n camera.export_to_png("IMG_{}.png".format(timestr))\n print("Captured")\n\n \n\n\nBuilder.load_string("""\n\n#:import utils kivy.utils\n<WindowManager>:\n CameraClick:\n ResizableDraggablePicture:\n\n<ResizableDraggablePicture>:\n name :app.root.current = "resizableDraggablePicture" \n\n\n<CameraClick>:\n\n name: "camera"\n orientation: 'vertical' \n resolution: (1000, 500)\n\n Camera:\n id: camera\n play: False\n allow_stretch: True\n \n BoxLayout:\n orientation: 'vertical'\n padding: 50 , 50 , 50 , 50\n spacing: 5 \n\n ToggleButton:\n text: 'Play'\n on_press: camera.play = not camera.play\n size_hint_y: None\n height: '48dp'\n Button:\n text: 'Capture'\n size_hint_y: None\n height: '48dp'\n on_press: root.capture()\n \n \n BoxLayout:\n orientation: 'vertical'\n padding: 500 , 400 , 600 , 650\n \n\n ToggleButton:\n text: 'Zoom'\n font_size:12\n height: 70\n width: 50\n on_press: "resizableDraggablePicture" \n\n""")\n\nclass Shenacell(MDApp):\n def build(self):\n # self.theme_cls.theme_style = "Dark"\n self.theme_cls.primary_palette = "BlueGray"\n return WindowManager()\n\nif __name__ == '__main__' :\n Shenacell().run()\n\nI've delete some extra code here .\nanyway When I've run my code and Clicked on Zoom button the screen be white and get that error." ]
[ "python", "camera", "kivy", "kivy-language", "raspberry-pi4" ]
[ "git clone with ssh url from powershell returns \"fatal: Could not read from remote repository.\" in windows10", "Tried to clone my git repository with ssh url, getting below error\n\nfatal: Could not read from remote repository.\nPlease make sure you have the correct access rights\nand the repository exists.\n\nsame if i tried with https url, then i was not able to clone my submodule. because sub module git config has ssh url and i dont have rights to modify it.\n\ncreated public/private key and same kept in git portal as SSH key. still no success.\n\nNote: I was using private repository . I was able to clone my repository successfully with Tortoise git, but facing issue with git bash / powershell. \n\ncan some one can provide solution for above issue." ]
[ "git", "powershell", "git-bash", "ssh-keys" ]
[ "Code completion for PHP extensions in Zend Studio?", "After having installed the HTTP extension from PECL, I expected Zend Studio 6 to recognize the provided HTTP* classes and for code completion to be made available. This is not the case, however. How do I get Zend Studio to recognize classes provided by PHP extensions? Specifcally, I want to be able to use code competition on these classes." ]
[ "php", "zend-studio", "php-extension" ]
[ "python paho-mqtt - Not receiving mqtt messages", "I am developing a python app that should receive mqtt messages. I'm using paho-mqtt library.\n\nAfter setting the username/password and the callback function on_message , I subscribe to the topic and make the connection to the broker. Then I start the loop_forever().\n\nHere is my code:\n\nimport paho.mqtt.client as mqtt\n\nMQTT_TOPIC = \"my_topic\"\nBROKER_ENDPOINT = \"my_broker_url\"\nBROKER_PORT = my_port\nBROKER_USERNAME = \"my_username\"\nBROKER_PASSWORD = \"my_password\"\n\nmqtt_client = mqtt.Client()\n\ndef on_message(client, userdata, message):\n print(\"Message Recieved from broker: \" + message.payload)\n\ndef main():\n mqtt_client.username_pw_set(username=BROKER_USERNAME, password=BROKER_PASSWORD)\n mqtt_client.on_message = on_message\n mqtt_client.connect(BROKER_ENDPOINT, BROKER_PORT)\n mqtt_client.subscribe(MQTT_TOPIC)\n mqtt_client.loop_forever()\n\nif __name__ == '__main__':\n main()\n\n\nI'm testing this code with the mosquitto_pub command:\n\nmosquitto_pub -h my_broker_url -p my_port -u my_username -P my_password -t 'my_topic' -m \"Hello World\"\n\nBut I cannot see any messages received by my application.\n\nWhat am i doing wrong ? \nThanks for helping" ]
[ "python", "mqtt", "paho" ]
[ "Contour without float artifacts", "I linearly interpolate and after that contour data. For calculations I use float type because I do not know how many decimals will be in input data. Sometimes it might be no decimals, sometimes one or over 10.\n\nUnfortunately because of using float after interpolation and contouring of same values I get unwanted artifacts. How can I fix my code to not produce contour artifacts where there should not be any?\n\nSimple code example:\n\nimport numpy as np\nfrom scipy.interpolate import griddata\nimport matplotlib.pyplot as plt\n\ninterval_in = np.linspace(1, 100, 10)\ninterval_out = np.linspace(1, 100, 100)\nxin, yin = np.meshgrid(interval_in, interval_in)\nzin = np.ones((10, 10))*10\nxout, yout = np.meshgrid(interval_out, interval_out)\nzout = griddata((xin.flatten(),yin.flatten()),zin.flatten(),(xout,yout),method='linear')\n\ncontours = plt.contour(xout, yout, zout, levels=[10])\nplt.show()" ]
[ "python", "matplotlib", "scipy", "contour" ]
[ "Why does “Watchdog: BUG: Soft lockup CPU” errors occur when running openstack containers in docker.", "I just deployed openstack using kolla and kolla-ansible stable/pike version. I deployed on one control node and one compute node. It worked but while I try to use the horizon dashboard, the control node is very slow and locks up and the terminal outputs the following:\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [runc:[2:INIT]:10527]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#4 stuck for 23s! [fluentd:5005]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#8 stuck for 23s! [keepalived:10664]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#15 stuck for 23s! [java:5604]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#5 stuck for 23s! [neutron-openvsw:3101]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#3 stuck for 23s! [cinder-schedule:3193]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#7 stuck for 23s! [java:6186]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#11 stuck for 23s! [docker-containe:6601]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#12 stuck for 22s! [keepalived:4295]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#10 stuck for 22s! [keepalived:10666]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#9 stuck for 22s! [gmain:939]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#13 stuck for 22s! [node:3261]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#6 stuck for 22s! [neutron-l3-agen:5071]\n\nMessage from syslogd@openstackcontroller at Nov 7 21:46:39 ...\n kernel:NMI watchdog: BUG: soft lockup - CPU#14 stuck for 22s! [irqbalance:898]\n\n\nWhenever I stop all the docker containers that are running on the control node it seems to not have any more CPU lockup errors but as soon as I start up all the docker containers again that are running openstack services on the control node it starts to run very slow again and the lockup errors start again" ]
[ "docker", "cpu", "openstack", "openstack-nova", "openstack-neutron" ]
[ "Load more button in Svelte", "I am exploring Svelte, and it is great. However I have a question, more it is a problem. I am trying to implement a simple load more button, this is my code:\n<script>\n import { onMount } from "svelte";\n\n let data = [];\n\n onMount(async () => {\n const res = await fetch(`./past-reza.json`);\n data = await res.json();\n });\n\n let currentItems = 2;\n loadmore.addEventListener('click', (e) => {\n const elementList = [...document.querySelectorAll('.list-element')];\n for (let i = currentItems; i < currentItems + 2; i++) {\n if (elementList[i]) {\n elementList[i].style.display = 'block';\n }\n }\n currentItems += 2;\n\n \n if (currentItems >= elementList.length) {\n event.target.style.display = 'none';\n }\n })\n</script>\n\nand my HTML part looks like this:\n{#each data as item}\n <div class="list-element">\n <h2>{item.title}</h2>\n </div>\n{/each}\n\nand load more button\n <button\n id="loadmore"\n type="button"\n class="btn btn-secondary">\n Show more\n </button>\n\nProblem is that my content not showing with this part of the JS code that I added for load more.\nCan anybody try to help me with this?" ]
[ "javascript", "svelte", "svelte-3" ]
[ "Update Widget on System Broadcast Intent", "I'm working on an Android widget that will show the current network state (i.e 1xRTT, EvDo Rev. A, WiMax, etc.). It may seem like a pointless idea, but for whatever the reason, the Evo doesn't differentiate between 1x & EvDo, it just says 3G for both, which is annoying if you're in a fringe 3G area.\n\nAnyways, to the point: I have the widget complete and it updates with the current network just fine, but how can I make it update whenever the connection changes? I know I can use a BroadcastReceiver to catch the ConnectivityManager.CONNECTIVITY_ACTION intent the system sends on a connection change. How can I update the widget from there?\n\nOr can I use the AppWidgetProvider to catch the intent and then update?\n\nI know how to catch the intent, I just don't know how to update the widget once I do." ]
[ "android", "android-widget", "android-intent" ]
[ "Renderscript via Gradle crashs Vuforia", "I have a problem that affects some android devices and do not know how to solve.\n\nThese devices that are tested presenting this error \n\n\n System.err: The library libVuforia.so could not be loaded.\n\n\nNexus 6p (Android 7), Galaxy S5 (Android 6.0.1), Galaxy S7 (Android 6), Xiaomi Redmi 2 (Android 4.4.4), Galaxy S6 (Android 6.0.1)\n\nThis error is occurred when i configured in Gradle is setting:\n\ndefaultConfig {\n\n applicationId \"com.app.myapp\"\n\n minSdkVersion 16\n\n targetSdkVersion 24\n\n versionCode 1\n\n versionName \"1.0\"\n\n renderscriptTargetApi 24\n\n renderscriptSupportModeEnabled true\n\n}\n\n\nThe strangest thing that only happens on some devices.\nI know Vuforia is compiled into armeabi-v7a and it is running for example in Moto X Play but other devices presents the reported problem." ]
[ "android", "vuforia", "renderscript" ]
[ "Return multiple matches within a string using a regex", "I'm using the following regex to clean up a document that has had apostrophes accidentally replaced with double quotes:\n\n([a-zA-Z]\\\"[a-zA-Z])\n\n\nThat find's the first pattern match within the string, but not any subsequent ones. I've used the '*' operator after the group, which I understood would return multiple matches of that pattern, but this returns none. I've tested the regex here by adding double quotes to the example string. \n\nDoes anyone know what the operator I need is for this example?\n\nThanks" ]
[ "python", "regex" ]
[ "User Group and Role Management in .NET with Active Directory", "I'm currently researching methods for storing user roles and permissions for .NET based projects. Some of these projects are web based, some are not. I'm currently struggling to find the best method to achieve what I'm looking for in a consistent, portable way across project types.\n\nWhere I'm at, we're looking to leverage Active Directory as our single point of contact for basic user information. Because of this, we're looking to not have to maintain a custom database for each application's users since they are already stored in Active Directory and actively maintained there. Additionally, we don't want to write our own security model/code if possible and would like to use something pre-existing, like the security application blocks provided by Microsoft.\n\nSome projects require only basic privileges, such as read, write, or no access. Other projects require more complex permissions. Users of those applications might be granted access to some areas, but not others, and their permissions can change across each area. An administration section of the app would control and define this access, not the AD tools. \n\nCurrently, we're using integrated Windows Authentication to perform authentication on our intranet. This works well for finding out basic user information, and I've seen that ASP.NET can be extended to provide an Active Directory roles provider, so I can find out any security groups a user belongs to. But, what seems like the downfall of this method to me is that everything is stored in Active Directory, which could lead to a mess to maintain if things grow too big. \n\nAlong this same line, I've also heard of Active Directory Lightweight Directory Services, which seems like it could extend our schema and add only application specific attributes and groups. Problem is, I can't find anything on how this would be done or how this works. There are MSDN articles that describe how to talk to this instance and how to create a new instance, but nothing ever seems to answer my question.\n\nMy question is: Based on your experience, am I going down the right track? Is what I'm looking to do possible using just Active Directory, or do other tools have to be used?\n\n\n\nOther methods I've looked into:\n\n\nUsing multiple web.config files [stackoverflow]\nCreating a custom security model and database to manage users across applications" ]
[ ".net", "asp.net", "security", "active-directory" ]
[ "Secure file deletion", "Which is the best way to delete a file on a FAT32 file system securely (i.e. make it impossible to recover the file). Is overwriting the file with garbage and then deleting it secure? Could anyone suggest a good reading on this?" ]
[ "security", "file-io", "filesystems" ]
[ "Generate new string variable by concatenating two integer variables with MySQL", "I apologize for the silliness of the question but am a complete neophyte with MySQL and am having trouble even reading the documentation for this. I have a table with two columns \"homeid\" and \"indid\", which are both integer data fields. I want to concatenate these together in a new variable \"uid\" with a hyphen. Desired output would look like this: \n\nuid homeid indid\n10-1 10 1\n10-2 10 2\n11-1 11 1\n\n\nI have tried the following code, which does fine through generating the variable \"uid\" in which the concatenated variables should sit, but doesn't seem to work (though produces no error) beyond that: \n\nALTER TABLE table_name\nadd column uid varchar(10) FIRST; /*adds column uid to table \"table_name\" as first column*/\n\nUPDATE table_name\nSET uid=CONCAT('-' , homeid, indid);\n\n\nThanks in advance for your help (and patience)." ]
[ "mysql", "concatenation", "concat-ws" ]
[ "LIKE functionality for sentence in lucene", "I'm trying to replicate the LIKE functionality of SQL in Lucene.\n\nIf I search using the wildcards, say \"*Tulips Inn Riyadhh*\" I'm facing with the following behaviour:\n\n\nTulips Inn Riyadh - Matching\nTulips Inn Riyadhhhss - Not Matching\nTulips Inn Riyadh hhss - Matching\nTulips - matching\nRiyadhh - matching\n\n\nActually i need an example in Lucene where condition \"2\" should match and \"4\" should not match. \n\nI tried with all queries but second scenario is not matching.\n\nSome people advised to use the Tokenizer and custom Analyser. \n\nSince i'm new to Lucene I worked with queries, but doesn't know how to integrate Tokenizer and custom Analyser to our queries." ]
[ "java", "solr", "lucene", "lucene.net" ]
[ "Put a green dot or red dot to show user is online or not", "I have the following code to display users' images. But I would like to differentiate the images appearance with a green dot on them showing user is online and orange showing user was seen (say 15 mins ago) and red showing user is offline. Using CSS.\n\nNow the code in a nutsell\n\n//Get timing details\n//get image details\n//get user details\n\nwhile($row = mysql_fetch_assoc($result)) {\n\n if($user_online){\n //show user modified image using CSS\n //image with green dot on it\n\n }else if($user_was_last_seen_15) {\n //show user modified image using CSS\n //image with orange dot on it\n\n }else {\n //show user modified image using CSS\n //image with red dot on it\n }\n\n}" ]
[ "php", "css" ]
[ "PHP PDO MSSQL stored procedures", "I have limited access to MSSQL database, I have CentOS server with PHP 5.6 and PDO library. I need need to run stored procedures that writes result to temporary table and after that make SELECT from that table to fetch required data.\n\nIN FACT there are 3 statements - 2 of them execution of stored procedures and 1 SELECT. If I'm placing all of them to 1 statement - statement returns nothing (but should return at list 80 rows), however statement return no errors.\n\nBUT if I divide statements - it returns error on second call. \n\nGeneral SQL Server error: Check messages from the SQL Server [208] (severity 16) [(null)]\n\n\nSO HERE IS CODE:` \n\ntry {\n $this->db = new PDO \n(\"dblib:host=\".$options['host'].\";dbname=\".$options['db'], $options['user'], $options['pass'], array(PDO::ATTR_PERSISTENT=>true));\n}catch (PDOException $e) {\n $this->addLog(\"Failed to get DB handle: \" . $e->getMessage());\n return false;\n}\n\n$tmp = \"##good123\";\n$hotelinctable = \"##hotelinc123\";\n\n$sql = \"EXEC sp_executesql @createtable = N'CREATE TABLE \".$hotelinctable.\" (inc int null)'\n\n EXEC sp_executesql N'EXEC up_prclm\n @CDateFrom = @CDFrom,\n @CDateTill = @CDTill,\n @DateFrom = @DFrom,\n @DateTill = @DTill,\n @ConfirmedDateFrom = @ConfDFrom,\n @ConfirmedDateTill = @ConfDTill,\n @PDateFrom = @PDFrom,\n @PDateTill = @PDTill,\n @Owner = @Own,\n @HPartner = @HPartn,\n @state = @StateInc,\n @TourList = @TList,\n @PartnerList = @PList,\n @PGroupList = @PGList,\n @MediatorList = @MList,\n @Curr = @CurrInc,\n @BaseCurr = @BaseCurrInc,\n @DateRate = @RateDate,\n @Rate = @RateType,\n @Round = @RoundType,\n @StatusList = @ClaimStatusList,\n @Name = @ResultTableName,\n @hotelinc = @HIncTableName,\n @TourCurrency = @TourCurrencyInc,\n @claimstr = @ClaimList',\n N'@CDFrom datetime2,@CDTill datetime2,@DFrom datetime2,@DTill datetime2,@ConfDFrom datetime2,@ConfDTill datetime2,@PDFrom datetime2,@PDTill datetime2,@Own int,@HPartn int,@StateInc int,@TList varchar(8000),@PList varchar(8000),@PGList varchar(8000),@MList varchar(8000),@CurrInc int,@BaseCurrInc int,@RateDate datetime2,@RateType int,@RoundType int,@ClaimStatusList varchar(8000),@ResultTableName varchar(8000),@HIncTableName varchar(8000),@TourCurrencyInc bit,@ClaimList varchar(8000)',\n '1900-01-01 00:00:00','2079-06-06 00:00:00','2017-05-12 00:00:00','2017-05-12 00:00:00','1900-01-01 00:00:00','2079-06-06 00:00:00','1900-01-01 00:00:00','2079-06-06 00:00:00',-2147483647,-2147483647,0,'','2870','','',2,1,'2017-05-12 00:00:00',0,0,'1, 2, 4, 5','\".$tmp.\"','\".$hotelinctable.\"',0,''\n\";\n\n\n\n$r = $this->db->prepare($sql);\n$r->execute();\n\n$err = $r->errorInfo();\n$this->addLog(\"ERRCHK: \".var_export($err, true));\n\n$sql = \"SELECT prclm.claim AS order_id, \n prclm.amount AS full_cost, \n prclm.net AS net_cost, \n currency.alias AS currency, \n prclm.hnet AS hotel_net, \n prclm.fnet AS flights_net, \n prclm.inet AS insurance_net, \n prclm.tnet AS transfers_net, \n prclm.enet AS excursions_net, \n prclm.vnet AS visas_net, \n prclm.supnet AS suppliment_net, \n prclm.snet AS services_ner, \n hpartner.name AS hotel_partner, \n claim.confirmed AS is_confirmed\n FROM \".$tmp.\" prclm \n INNER JOIN claim ON prclm.claim = claim.inc \n LEFT OUTER JOIN order ord ON ord.inc = prclm.order \n LEFT OUTER JOIN partner hpartner ON hpartner.inc = ord.partner \n LEFT OUTER JOIN currency on currency.inc = prclm.currency\n ORDER BY prclm.inc DESC\";\n\n$r = $this->db->prepare($sql);\n$r->execute();\n$err = $r->errorInfo();\n$this->addLog(\"ERRCHK: \".var_export($err, true));\n\n$res = $r->fetchAll(PDO::FETCH_ASSOC);\n\n$this->addLog(\"RES: \".var_export($res, true)); `\n\n\nPlease advise - what is wrong, and how to call multiple procedures and then SELECT." ]
[ "php", "sql-server", "stored-procedures", "pdo" ]
[ "PNCircle chart will not update when increment by button press", "I am new in iOS and I want to implement a framework call PNChart to my project. I would like to increment the circle chart by one but the UI will not update. Please help.\n\n\n\nimport UIKit\nimport PNChart\n\nclass ViewController: UIViewController {\n\n //global var\n let number = NSNumber(value: 70)\n\n //obj outlet\n @IBOutlet weak var circleChart: PNCircleChart!\n\n override func viewDidLoad() {\n super.viewDidLoad()\n }\n\n override func viewWillAppear(_ animated: Bool) {\n\n let myCgrect = CGRect(\n x: self.view.bounds.width/2 - 40,\n y: self.view.bounds.height/2 - 40,\n width: 100, height: 100)\n\n let circleChart = PNCircleChart(\n frame: myCgrect, total: Int(100) as NSNumber!,\n current: number, clockwise: false,\n shadow: false, shadowColor: UIColor.red)\n\n circleChart?.backgroundColor = UIColor.clear\n circleChart?.strokeColor = UIColor.blue\n circleChart?.stroke()\n\n self.view.addSubview(circleChart!)\n }\n\n @IBAction func increaseCircle(_ sender: Any) {\n _ = NSNumber(value: number.intValue + 1)\n print(\"btnpressed\")\n }\n}// end uiviewcontroller" ]
[ "swift", "ios-charts" ]
[ "How to preprocess steps on Apache before sending a page to the User", "I have an Apache web server and I need to do some processes outside the web server when a user requests a certain page.\nI will try to be more clear: when a user requests page X, I have to start an external program, passing it some session parameters, wait for response, and then send the requested page to the user.\n\nIs this possible to do this?" ]
[ "apache", "apache-modules" ]
[ "Client filter message by CorrelationId", "Can I filter and get a message from a queue by its CorrelationId even if that message is not the first in the queue?" ]
[ "c#", "ibm-mq" ]
[ "Rails - Destroy all records", "Is there a way to destroy all records in my database in one line, without specifying my models?\nSay I have three models User Picture Post. I can call User.all.destroy_all etc, but can I collect all records without specifying the models themselves?" ]
[ "ruby-on-rails" ]
[ "single return of ternary operator", "I wonder if possible to write ternary operator for single return. I tried google online, but couldn't find an answer. or it doesnot called ternary operator??\n\nThank you very much for your advice.\n\nIf(A == 1) execute_function(); into A == 1 ? execute_function() //???Possible???" ]
[ "javascript", "ternary-operator" ]
[ "Minimal Qt program makes memory leak", "Here is a nearly minimal Qt program, which should release all the resources, including the memory:\n\n#include <QApplication>\n#include <QMainWindow>\n#include <memory>\n\nint main(int argc, char** argv) {\n QApplication app(argc, argv);\n std::unique_ptr<QWidget> wnd{new QWidget()};\n wnd->show();\n return app.exec();\n} \n\n\nHowever, valgrind says that:\n\nLEAK SUMMARY:\n definitely lost: 979 bytes in 24 blocks\n indirectly lost: 7,858 bytes in 56 blocks\n possibly lost: 912 bytes in 19 blocks\n still reachable: 75,719 bytes in 1,080 blocks\n of which reachable via heuristic:\n newarray : 832 bytes in 16 blocks\n suppressed: 0 bytes in 0 blocks\nRerun with --leak-check=full to see details of leaked memory\n\n\nI expected to get zeros for \"definitely lost\" and \"indirectly lost\", but have got lost bytes. Why? Do I interpret valgrind output incorrectly, or should I call some additional exit function of Qt?" ]
[ "qt", "memory-leaks" ]
[ "Possible to tell which workbook called a function in an Excel Add-In (xla)", "I want to write a little logging function in an excel add-in that I will be calling from many different workbooks. I'd like to be able to just call it by passing only the log text, and the log function itself could handle the timestamp, workbookname, etc.\n\nHowever, I cannot use either ThisWorkbook or ActiveWorkbook to determine which workbook was responsible for making the call, as Thisworkbook will return a reference to the add-in itself, whereas VBA code running in a workbook other than the workbook with active focus in Excel could make the call, but the ActiveWorkbook will return the one that has focus in the window.\n\nApplication.Caller looked like a possible solution, but this seems to work only when the function is called from a cell, not from VBA.\n\nIs what I'm trying to do impossible?\n\nUpdate\n\nAccording to > 1 person, this is in fact impossible. If anyone happens to know some clever workaround please speak up." ]
[ "excel", "excel-addins", "xla", "vba" ]
[ "Broadcast numpy dot products", "Assume I have an array a of matrices, e.g. of shape (N, 3, 3) = N 3x3 matrices and an array b of shape (i, 3, k).\n\nI want these behaviors for the dot product a * b\n\n\nIf i = N, the result should be a (N, 3, k) array where the first element is a[0].dot(b[0]), the second a[1].dot(b[1]), and so on.\nIf i = 1, then each element of a must be dot multiplied by b[0] and the resulting shape should be again (N, 3, k).\n\n\nIf I try to just use numpy.dot() the result is almost good but the resulting shapes are not what I expect. Is there a way to do this easily and efficiently and make it general for any dimension?" ]
[ "python", "arrays", "python-3.x", "numpy" ]
[ "SQL Server 2008 inconsistent results when converting datetime to varchar", "I have a table with two datetime columns and I'm trying to convert them to an iso string format using the following query:\n\nselect \n CONVERT(VARCHAR(23), date1, 126) as date1, \n CONVERT(VARCHAR(23), date2, 126) as date2\nfrom \n some_table\n\n\nBut I'm getting two different results, one with milliseconds and one without\n\ndate1 date2\n2015-03-11T05:16:04.663 2015-03-11T05:15:43\n\n\nI've looked at the create table script and they are both defined as datetime. I have no clue how the data is being inserted. \n\nHow can I get both columns to return with milliseconds ?" ]
[ "sql-server", "sql-server-2008", "datetime" ]
[ "Parse UITableView with Search", "I'm following this AppCoda tutorial on implementing Search; however, I'm pulling titles for the table view from Parse and can't get the search function to work. Throws an exception when I start typing in the search:\n\n'Can't use in/contains operator with collection {\n buildingLat = \"42.726366\";\n buildingLong = \"-84.480642\";\n buildingTitle = \"International Center\";\n} (not a collection)'\n\nHere's the code for my table view controller:\n\n#import \"BuildingsViewController.h\"\n#import <Parse/Parse.h>\n\n@interface BuildingsViewController ()\n\n@end\n\n@implementation BuildingsViewController\n\n\n- (void)viewDidLoad\n{\n [super viewDidLoad];\n // Do any additional setup after loading the view.\n [self performSelector:@selector(retrieveBuildings)];\n\n}\n\n- (void)didReceiveMemoryWarning\n{\n [super didReceiveMemoryWarning];\n // Dispose of any resources that can be recreated.\n}\n\n#pragma mark - TableView Setup\n\n-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView\n{\n return 1;\n}\n\n-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section\n{\n return [self.buildingsArray count];\n\n if (tableView == self.searchDisplayController.searchResultsTableView) {\n return [self.searchResults count];\n\n } else {\n return [self.buildingsArray count];\n }\n}\n\n-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n static NSString *CellIdentifier = @\"buildingsCell\";\n UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];\n\n PFObject *tempObject = [self.buildingsArray objectAtIndex:indexPath.row];\n cell.textLabel.text = [tempObject objectForKey:@\"buildingTitle\"];\n\n\n if (cell == nil) {\n cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];\n }\n\n if (tableView == self.searchDisplayController.searchResultsTableView) {\n cell.textLabel.text = [self.searchResults objectAtIndex:indexPath.row];\n\n } else {\n cell.textLabel.text = [tempObject objectForKey:@\"buildingTitle\"];\n }\n return cell;\n}\n\n#pragma mark - Helper Methods\n\n-(void)retrieveBuildings\n{\n PFQuery *retrieveBuildings = [PFQuery queryWithClassName:@\"buildingsList\"];\n [retrieveBuildings findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {\n if (!error) {\n self.buildingsArray = [[NSArray alloc] initWithArray:objects];\n }\n [self.tableView reloadData];\n }];\n}\n\n- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope\n{\n NSPredicate *resultPredicate = [NSPredicate\n predicateWithFormat:@\"SELF contains[cd] %@\",\n searchText];\n\n self.searchResults = [self.buildingsArray filteredArrayUsingPredicate:resultPredicate];\n}\n\n-(BOOL)searchDisplayController:(UISearchDisplayController *)controller\nshouldReloadTableForSearchString:(NSString *)searchString\n{\n [self filterContentForSearchText:searchString\n scope:[[self.searchDisplayController.searchBar scopeButtonTitles]\n objectAtIndex:[self.searchDisplayController.searchBar\n selectedScopeButtonIndex]]];\n\n return YES;\n}\n\n@end" ]
[ "ios", "uitableview", "parse-platform" ]
[ "Solve systems of non-linear equations in R / Black-Scholes-Merton Model", "I am writing my masters thesis and I got stuck with this problem in my R code. Mathematically, I want to solve this system of non-linear equations with the R-package “nleqslv”:\n\nfnewton <- function(x){\n\ny <- numeric(2)\n\nd1 = (log(x[1]/D1)+(R+x[2]^2/2)*T)/x[2]*sqrt(T)\n\nd2 = d1-x[2]*sqrt(T)\n\ny1 <- SO1 - (x[1]*pnorm(d1) - exp(-R*T)*D1*pnorm(d2))\n\ny2 <- sigmaS*SO1 - pnorm(d1)*x[2]*x[1]\n\ny}\n\nxstart <- c(21623379, 0.526177094846878)\n\nnleqslv(xstart, fnewton, control=list(btol=.01), method=\"Newton\")\n\n\nI have tried several versions of this code and right now I get the error:\n\n\n error: error in pnorm(q, mean, sd, lower.tail, log.p): not numerical.\n\n\nPnorm is meant to be the cumulative standard Normal distribution of d1and d2 respectively. I really don’t know, what I am doing wrong as I oriented my model on Teterevas slides ( on slide no.5 is her model code), who’s presentation is the first result by googeling \n\n\n https://www.google.de/search?q=moodys+KMV+in+R&rlz=1C1SVED_enDE401DE401&aq=f&oq=moodys+KMV+in+R&aqs=chrome.0.57.13309j0&sourceid=chrome&ie=UTF-8#q=distance+to+default+in+R\n\n\nLike me, however more successfull, she calculates the Distance to Default risk measure via the Black-Scholes-Merton approach. In this model, the value of equity (usually represented by the market capitalization, ->SO1) can be written as a European call option – what I labeled y2 in the above code, however, the equation before is set to 0!\n\nThe other variables are:\n\nx[1] -> the variable I want to derive, value of total assets\n\nx[2] -> the variable I want to derive, volatility of total assets\n\nD1 -> the book value of debt (1998-2009)\n\nR -> a risk-free interest rate\n\nT -> is set to 1 (time)\n\nsigmaS -> estimated (historical) equity volatility\n\nThanks already!!! I would be glad, anyone could help me.\nCaro" ]
[ "r", "nonlinear-optimization" ]
[ "Cannot bind to the property or column... when add control", "when I try to add my own created control, to form, Visual Studio throws me error:\nCannot bind to the property or column Item Name on the DataSource.\nParameter name: dataMember\nCan someone tell what, possibly I've done wrong, because placing whole class I think is unnecessary.\n\npublic partial class ctrlDetailGradation : BaseDetailsControl\n{\n protected override DevExpress.XtraDataLayout.DataLayoutControl LayoutMain { get { return dataLayoutControl; } }\n\n public SALES_Gradation CurrentGradation\n {\n get { return GetXPOObject as SALES_Gradation; }\n }\n\n public bool bEditMode { get; set; }\n\n public ctrlDetailGradation():base(null)\n {\n OnConstructInit();\n }\n\n public ctrlDetailGradation(IMxPEditObjectHandlerInterface cEditObjInterface)\n : base(cEditObjInterface)\n {\n OnConstructInit();\n }\n\n private void OnConstructInit()\n {\n InitializeComponent();\n InitLngStrings();\n }\n...\n\n\nthere is part of code, it is simple class...\nBaseDetailsControl is inherited from usercontrol" ]
[ "c#", "forms", "user-controls" ]
[ "In Ruby on Rails, how to intercept the Devise gem's email sending functionality and change it to call an API instead?", "I have a working Rails installation with the Devise gem. Instead of sending emails for example for password recovery, I would like to make an API call. Is there a method or a file in Devise that I need to change to change the default email sending behaviour, and be able to send the same email content through an API instead?" ]
[ "ruby-on-rails", "devise" ]
[ "PHP character change", "My PHP application changes my apostrophe character to � \n\nWhat is my crime?" ]
[ "php", "character-encoding", "ms-word", "mojibake" ]
[ "Comparing Objects which refer to each other in Java", "int i = 0;\nint j = i;\nSystem.out.println("initial int: " + j); // 0\n\nInteger ii = new Integer(0);\nInteger jj = ii;\nSystem.out.println("initial Integer: " + jj); // 0\n\nString k = new String("s");\nString l = k;\nSystem.out.println("initial String: " + l); // "s"\n\nPerson person1 = new Person("Furlando"); // from constructor -> publ. instance var. 'name'\nPerson person2 = person1;\nSystem.out.println("initial Person: " + person2.name); // "Furlando"\n\n/*--------------------*/\nSystem.out.println();\n/*--------------------*/\n\ni += 1;\nSystem.out.print("added 1 to int: [" + i);\nSystem.out.println("], and primitive which also \\"refers\\" to that (has a copy, actually), has a value of: [" + j + "]");\n\nii += 1;\nSystem.out.print("added 1 to Integer object: [" + ii);\nSystem.out.println("], and object which also refers to that, has a value of: [" + jj + "]");\n\nk += "tring";\nSystem.out.print("added \\"s\\" to String object: [" + k);\nSystem.out.println("], and object which also refers to that, has a value of: [" + l + "]");\n\nperson1.name = "Kitty";\nSystem.out.print("changed instance variable in Person object to: [" + person1.name);\nSystem.out.println("], and object which also refers to that, has a value of: [" + person2.name + "]");\n\n/* [COMPILER OUTPUT]\n initial int: 0\n initial Integer: 0\n initial String: s\n initial Person: Furlando\n\n A) added 1 to int: [1], and primitive which also "refers" to that (has a copy, actually), has a value of: [0]\n B) added 1 to Integer object: [1], and object which also refers to that, has a value of: [0]\n C) added "s" to String object: [string], and object which also refers to that, has a value of: [s]\n D) changed instance variable in Person object to: [Kitty], and object which also refers to that, has a value of: [Kitty]\n*/\n\nI understand A, we have a primitive there; no references. By-copy. \nI hoped B and C would behave the same way as D - change according to the reference they were given.\nWhy this object-reference-to-another-object only "works" with user defined objects, not Integers, Strings, etc.?\n\nThank you all for your answers - now I get it!" ]
[ "java", "object", "compare", "refer" ]
[ "Please help to get status, unable to make the function for the same", "Please help as I have data of employees in which they did multiple sale, I want if any employee did sale more the 50000 againt it each emp I'd of that person print excellent rest low.\nLike\nEmp I'd. Sale status\nEmp1001 5000. Excellent\nEmp1001 45000. Excellent\nEmp1001 2000. Excellent\nEmp1002 5000. Low\nEmp1003 2500. Low" ]
[ "r" ]
[ "Display div in correct place on desktop and mobile / accordion / move div?", "I have a page using bootstrap 4 which shows images of our team and uses accordion to reveal bios when you click the image. \n\nOn desktop it works fine, there are four images of people in a row. The bio is revealed below them when you click a profile. \n\nHowever, on mobile, the view changes to four vertically stacked people images. When you click a person, the bio appears at the bottom, after the fourth person.\n\nI want the bio to appear under the person you click.\n\nExample image: \n\n\nCode Example:\n\n<section class=\"p-5\">\n<div class=\"container\" id=\"biolevelone\">\n<div class=\"row\">\n <div class=\"col-md-3 col-sm-6\">\n <div data-toggle=\"collapse\" href=\"#bio1\"><img src=\"image1.png\"/></div>\n </div>\n <div class=\"col-md-3 col-sm-6\">\n <div data-toggle=\"collapse\" href=\"#bio2\"><img src=\"image2.png\"/></div>\n </div>\n <div class=\"col-md-3 col-sm-6\">\n <div data-toggle=\"collapse\" href=\"#bio3\"><img src=\"image3.png\"/></div>\n </div>\n <div class=\"col-md-3 col-sm-6\">\n <div data-toggle=\"collapse\" href=\"#bio4\"><img src=\"image4.png\"/></div>\n </div>\n</div> <!-- row -->\n\n<div class=\"collapse pt-2\" id=\"bio1\" data-parent=\"#biolevelone\">\n <div class=\"card-body\">\n <p>Bio text, a couple of paragraphs</p>\n </div>\n</div>\n<div class=\"collapse pt-2\" id=\"bio2\" data-parent=\"#biolevelone\">\n <div class=\"card-body\">\n <p>Bio text, a couple of paragraphs</p>\n </div>\n</div>\n<div class=\"collapse pt-2\" id=\"bio3\" data-parent=\"#biolevelone\">\n <div class=\"card-body\">\n <p>Bio text, a couple of paragraphs</p>\n </div>\n</div>\n<div class=\"collapse pt-2\" id=\"bio4\" data-parent=\"#biolevelone\">\n <div class=\"card-body\">\n <p>Bio text, a couple of paragraphs</p>\n </div>\n</div>\n\n</div><!--biolevelone data parent -->\n</section>\n\n\nI tried moving the bio text cards code up between each profile image div, but then I get the opposite problem. i.e. On desktop, all the profile images suddenly vanish from the row and move below the bio text when an image is clicked, while working fine on mobile." ]
[ "html", "css", "bootstrap-4", "accordion" ]
[ "Using exclusive + durable queues, for RabbitMQ", "If I have made a queue which is exclusive and durable (not auto-delete). Now, if the consumer subscribes to that queue and then it goes down. Then that queue gets deleted. \n\nI have checked the scenario, when the queue is only durable (i.e. neither exclusive nor auto-delete). Now, if the consumer subscribes to that queue and then it goes down. Then that queue gets deleted. \n\nPlease explain the 1st case, 2nd case is giving expected result. In both the scenario only 1 consumer is subscribed to one queue, and there is only one queue bound to one direct_exchange." ]
[ "rabbitmq" ]
[ "Executing npm script(gulp) which is located inside a folder", "I have the following structure:\n\nmain folder\n - src \n - node modules\n - gulpfiles.js\n - package.json \n\n\nIn package.json\n\n\"scripts\": {\n \"tasks\": \"gulp tasks\",\n\n\nIt works, but if I change the structure to:\n\nmain folder\n - src \n - node modules\n - gulp\n - gulpfiles.js\n - gulp.config.js\n - package.json \n\n\nIn package.json\n\n\"scripts\": {\n \"tasks\": \"gulp/gulp tasks\", or \"tasks\": \"gulp tasks\",\n\n\nit gives me the error 'no gulpfile found\"" ]
[ "npm", "gulp", "npm-scripts" ]
[ "How to specify path for local jars in maven", "I am using maven2 to build the java project. when I am trying to build using mvn install I am getting the compilation error saying some package xya.abc.aaa doesnot exist. This package is available in my own jar at local disk. This jar(say test.jar) is created by me.\n\nHow can I tell to maven to use this local jar for the package its looking for is availabe at my local disk?" ]
[ "java", "maven", "jar" ]
[ "how to build a pagination for the API api.rawg.io", "I am triying to build a pagination for this API https://api.rawg.io/docs/#tag/games\nIn this page they explain the parameters that the API returns\nhttps://rawgthedocs.orels.sh/api/#basics\n\nmy http request return this.http.get('https://api.rawg.io/api/games?dates=2010-01-01,2020-12-31&page_size=20&page=3');\nin my angular component I get the data\nconstructor(\n private gamesService:GamesService,\n private router: Router,\n ) {\n this.gamesService.getListGames().subscribe( (data: any) =>{\n console.log(data.results);\n this.gameslist = data.results;\n this.count = data.results.length;\n console.log(this.count);\n\n if(data.results.page == 3)\n {\n \n } \n\n });\n\nI dont know how to get the page parameter that in the request it is &page=3 and the next and prev parameters to build the pagination" ]
[ "angular", "api", "pagination" ]
[ "SendMail Powershell - Embedding .html files", "I'm trying to embed HTML tables from .html files (generated externally) into an email using SendMail in Powershell. My code is below:\n\n$userid = '[email protected]'\n\n$creds = Get-Credential $userid\n\n$port = 587\n\n$smtp = \"smtp.office365.com\"\n\n$to = \"[email protected]\"\n\n$from = $userid\n\n$subject = \"FX summary report\" \n\n$body = Get-Content (\"C:\\Users\\xxx\\Documents\\R\\newtrend.table.html\")\n\n\n$body = $body | out-string\nSend-MailMessage -To $to -Subject $subject -Body $body -UseSsl -Port $port -SmtpServer $smtp -From $from -Credential $creds\n\n\nHowever, this doesn't embed the html code and instead I get the html written as text. My email looks like:\n\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\"/>\n....\n\n\nI'm not familiar with powershell, and I'd really appreciate a workaround." ]
[ "powershell" ]
[ "How can i unban people with a Discord bot?", "I need some help with my Discord bot... somehow my bot doesn't work. Thanks for the help!\nif (command === `unban`) {\n if (!message.member.hasPermission("UNBAN_MEMBERS")) return message.reply("Nö, kein Bock!");\n\n const member = message.mentions.users.first();\n\n if (!member) return message.reply("Es wurde kein Member erwähnt!");\n\n if (!member.bannable) return;\n message.channel.send("Der User wurde entbannt!");\n message.guild.members.unban(member);\n}" ]
[ "javascript", "node.js", "discord", "discord.js", "bots" ]
[ "Send mail and save message in file using Python", "I want to send email using Python and simultaneously want to write mail-message in a file as well.For sending mail I can do easily with smtplib but for saving part need your help.\n\nMy need is I am creating a webtool for my company where need to send a mail and have to send an update in every an hour so I have planned to save message into file and at the time of second send will call that file and will send with new update. If anyone knows other method then most welcome.\n\nsend code:\n\n import smtplib\n server = smtplib.SMTP('smtp.gmail.com', 587)\n server.ehlo()\n server.starttls()\n server.login(\"[email protected]\", \"passwd\")\n msg = \"Hello World!\"\n server.sendmail(\"[email protected]\", \"receiver@gmailcom\", msg)\n server.quit()\n\n\nThanks in advance" ]
[ "python", "file", "email", "save", "smtplib" ]
[ "iOS - how to implement custom table view cell selection/unselection?", "I'm working with a UITableView, and as far as I understand it has grey or blue selection of rows. Is there a way to override UITableView cell selection behavior (define a \"selected\" style)? \n\nIf there is not, would a vertical collection view work as an imitation of a table view with custom selection?" ]
[ "uitableview", "ios8", "uicollectionview", "selection" ]
[ "Suggest any good hash function", "Possible Duplicate:\n What's a good hash function for English words? \n\n\n\n\nI want to calculate the frequency of any word in a text file. I solved this problem using BST. \nI want to solve this using hash table. Can you tell me the hash function. So that all same words store in a single key. Thanks." ]
[ "c++", "c", "algorithm", "hash" ]