texts
sequence
tags
sequence
[ "Why doesn't std::to_string support container classes as input?", "So std::to_string works on various primitive types. However, when trying to print the elements of a container like a vector, I have to iterate through the vector element by element and print each individually. Now granted, with something like a vector this can amount to a single statement or loop like such:\n\nfor_each(v.begin(), v.end(), [](int x) {cout << x <<\", \"; });\n\n\nbut with other container classes it can be quite a nuisance to format the data type. \n\nIn contrast, languages like Java or Python have functions that print most containers in a single statement. Why doesn't STL accept these as arguments in std::to_string or implement to_string as member function of the container classes?" ]
[ "c++", "stl" ]
[ "Animate div positioning rearrangement", "I am building a simple push-down effect which affects the position of two containers. So far I have managed to achieve a near-desired effect using fixed positioning for the hidden container while changing its position to a relative for the opened state.\nI want to apply a smooth transition to the blue main div, which is being pushed down by the hidden div with a class of .sub-header. How can I bypass the choppy rearrangement of the containers and is there a more elegant way of doing this instead of switching positioning on click? (e.g. fixed to a relative in this case)\nCurrently, when I switch the positioning from fixed to a relative as expected - there is a gap being produced, which is the .sub-header's height.\n\nNOTE: The heights of the current divs are fixed values, but I need this to be able to handle dynamic changes in the .sub-header height.\nNOTE: This should be achieved by adding a custom class, not using jQuery's nested effects like .slideToggle etc.\n\nHere is the Fiddle.\nAnd the simple jQuery function needed for the Fiddle share:\n$('.trigger').click(function() {\n $('.sub-header').toggleClass('opened');\n}).stop();" ]
[ "javascript", "jquery", "html", "css" ]
[ "How to export Google Map to Image including custom markers?", "As suggested on this answer, I am using html2canvas library to export a Google Map to a image.\n\nI am working on AngularJS. This is the code I am using:\n\n$scope.shareMap = function(){\n var element = $(\"#mapDiv\");\n html2canvas(element, {\n useCORS: true,\n onrendered: function(canvas) {\n var dataUrl= canvas.toDataURL(\"image/png\");\n\n // DO SOMETHING WITH THE DATAURL\n // Eg. write it to the page\n document.write('<img src=\"' + dataUrl + '\"/>');\n }\n });\n };\n\n\nThe thing is, it is not exporting my dynamically generated markers. This markers are generated based on response of an AJAX call.\n\nThis is how it looks with the markers on the web:\n\n\nAnd this is what it exports:\n\n\nAlso, I noticed that if I pan on the map, the \"new\" displayed zone shows in gray, like so:\n\n\nIt seems that it can only export what is shown the first time the map renders (only the map on that specific viewport, without the markers and any additional zones of the map).\n\nIs it possible to solve my problem using this same library? Or can you recommend another approach? Thanks!" ]
[ "javascript", "angularjs", "google-maps", "google-maps-api-3" ]
[ "How to pass a list instead of dictionary in python-django to html page", "I want to display the list \"response_body\" to my html page \"home.html\"\nFor that I retrieved id attribute from response_body and the last id which was stored in \"id\" variable is printed to my html file.\n\nI want to retrieve all the id's and print it to the html page \nI know this will be done through loop but how?\n\nI am new to django and python any help will be greatly appreciated.\n\nI have tried printing the last id before the loop ended and I was successful with it but now I want to print all the id'd in the loop.\n\ni tried passing response_body to html instead of context but it gives me an error as response_body is a list type and it asked me to pass a dictionary variable like context which works fine.\n\nhow can I print all the id's in the reponse_body list\n\nhome.html\n\n<p>results</p>\n<p>{{id}}</p>\n\n\nviews.py\nas this is a fairly long code i am posting just the code which maybe useful.\n\nresponse_body = json.loads(response.read().decode('utf-8'))\n\nfor j in response_body:\n print(j['id'])\n id = j['id']\n\ncontext = {\n 'id': id,\n}\n\nreturn render(request, 'home.html', context)" ]
[ "python", "html", "django", "django-views" ]
[ "Cursor movement in Android", "In Google's Notepad tutorial for Android (http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html), they have the following for \"fetchNote\"\n\n/**\n * Return a Cursor positioned at the note that matches the given rowId\n * \n * @param rowId id of note to retrieve\n * @return Cursor positioned to matching note, if found\n * @throws SQLException if note could not be found/retrieved\n */\npublic Cursor fetchNote(long rowId) throws SQLException {\n\n Cursor mCursor =\n\n mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,\n KEY_TITLE, KEY_BODY}, KEY_ROWID + \"=\" + rowId, null,\n null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n\n}\n\n\nWhy do we move the cursor to first if it's not null? I know it works, but I don't understand it. Why not just return the cursor? Why isn't it pointing to the object we want?" ]
[ "android" ]
[ "Nx NextJS Runtime config variables are \"undefined\" while running production build", "Nextjs app that is created via Nx Nextjs schematics gives undefined for publicRuntimeConfig accessed in getInitialProps during runtime of production build but in development mode it works perfectly\n\nnext.config.js\n\nmodule.exports = { serverRuntimeConfig: { // Will only be available on the server side mySecret: 'secret', secondSecret: process.env.SECOND_SECRET // Pass through env variables }, publicRuntimeConfig: { // Will be available on both server and client staticFolder: '/static' } };\n\ngetInitialProps\n\nimport getConfig from 'next/config'; const { publicRuntimeConfig } = getConfig(); ... Index.getInitialProps = async ctx => { console.log('I am here'); console.log(publicRuntimeConfig.staticFolder); // Undefined when running prod build return {}; };\n\nOrignal Github Issue Here" ]
[ "reactjs", "next.js", "nrwl", "nrwl-nx" ]
[ "Get External SDCard Location in Android", "I have an app with huge data pre-stored in the SD Card. \n\nWe are supporting all tablets ICS onwards. I am not able to find a way to access the SDCard location correctly on ALL devices.\n\nI looked at various solutions given here on SO but they do not seem to work in all cases. Looking for a generic solution.\n\nEven if anyone can tell me all the possible mount points of SDCard.\n\nI am targeting android tablets only if that can narrow down the solution." ]
[ "android" ]
[ "quitting app will not destroy data", "I load my app on phone. work with it then quit the app and start again. but it keeps some data from previous time! How? how can I not get those data. I am starting the app from scratch again. and in my code there is destroy function. what should I put so that every time I get whole fresh data" ]
[ "android", "google-maps" ]
[ "Syntaxhighlighter V Google's prettify performance advice needed?", "There have being several threads already about how to prettify code when displaying it on blogspot: How to use prettify with blogger/blogspot? and What are the steps I need to take to add nice java code formatting to my blogger/blogspot blog?.\n\nI have tried google's prettify http://code.google.com/p/google-code-prettify/ and syntaxhighlighter http://alexgorbatchev.com/SyntaxHighlighter/. Both are nice. However, I am interested in which has the better performance of both - this is where this thread differs.\n\nCompression\n\nYSlow is telling me neither is being sent compressed to my browser. However, I am not hosting the site myself, I am using google's blogspot for hosting. So, I don't think there is a lot I can do here. Correct?\n\nCache \nBoth Google's prettify and syntaxhighlighter use javascript files and stylesheets. They host them on a google server and amazon server respectively. if I was hosting files myself I could make use an Apache Http Server and set cache headers on HTTP responses so that returning users don't keep downloading them. If I am not hosting myself and making use of blogspot's free hosting there's nothing I can do, correct?\n\nServer ping time\nThis is a bit a of noddy test. When I ping google's prettify, I get:\n\nPinging googlecode.l.google.com [209.85.143.82] with 32 bytes of data:\nReply from 209.85.143.82: bytes=32 time=5ms TTL=53\nReply from 209.85.143.82: bytes=32 time=4ms TTL=53\nReply from 209.85.143.82: bytes=32 time=4ms TTL=53\nReply from 209.85.143.82: bytes=32 time=5ms TTL=53\n\n\nWhen I ping syntaxhighlighter:\n\nPinging www.alexgorbatchev.com [69.163.149.228] with 32 bytes of data:\nReply from 69.163.149.228: bytes=32 time=148ms TTL=47\nReply from 69.163.149.228: bytes=32 time=146ms TTL=47\nReply from 69.163.149.228: bytes=32 time=146ms TTL=47\nReply from 69.163.149.228: bytes=32 time=146ms TTL=47\n\n\nSo look's like google's winning this one. Probably using a CDN where I don't think syntaxhighlighter is.\n\nFewer Http requests\n\nThere's a difference of approaches here. Syntaxhighlighter is quite modular with different javascript files for different languages. Google;s prettify using one bigger javascript file.\nSo possible to have a smaller filesize with syntax highlighter if you are including snippets from various languages, you'll of course have more http requests.\n\nSo that's the background. The question is what is your performance tip regarding using syntaxhiglighter or google's prettify? How could you make either go faster or ascertain one is faster than the other?\n\nThanks." ]
[ "javascript", "syntax-highlighting", "google-code" ]
[ "c++ passing std::function from another class to a constructor", "I am passing a method into a constructor, but when I used a method that another class, it gives me an error.\n\nIt is currently working in this form;\n\nunsigned int pHash(const std::string& str)\n{\n //method\n}\nint main()\n{\n//stuff\nHashMap* hm2 = new HashMap(pHash);\n//stuff\n}\n\n\nHowever, if I reference another header file's method like so;\n\nHashMap* hm2 = new HashMap(&HashFcn::primeHash);\n\n\nI get an error at runtime with the follow messages;\n\nError 1 error C2100: illegal indirection c:\\program files (x86)\\microsoft visual studio 11.0\\vc\\include\\xrefwrap 273 1 Project\n Error 2 error C2440: 'newline' : cannot convert from 'const std::string *' to 'const HashFcn *' c:\\program files (x86)\\microsoft visual studio 11.0\\vc\\include\\xrefwrap 273 1 Project\n Error 3 error C2647: '.*' : cannot dereference a 'unsigned int (__thiscall HashFcn::* )(const std::string &)' on a 'const std::string' c:\\program files (x86)\\microsoft visual studio 11.0\\vc\\include\\xrefwrap 273 1 Project\n\n\nMy hashmap constructor looks like this;\n\nHashMap::HashMap(HashFunction hashFunction)\n : hfunc(hashFunction)\n\n\nwhere hfunc is a typdef of a method.\n\nI have a class HashFcn which has the method primeHash\n\nunsigned int primeHash(const std::string&);\n\n\nThis is my first time doing typdef / method passing -- any clues or help would be greatly appreciated!" ]
[ "c++", "std", "std-function" ]
[ "Adding dependencies to React hook leads to infinite loop", "I am trying to update a state using the props that I received from the parent component.\n\nBut react keeps putting up warning message to add the state that is being updated to add to the dependency list while I want effect to run once only when the component mounts.\n\nHere is the code of the component that throws the warning message:\n\nconst [selectedDate, setSelectedDate] = useState(undefined);\n const [disableDate, setDisableDate] = useState([]);\n\n useEffect(() => {\n const key = Object.keys(slots);\n setDisableDate([\n ...disableDate,\n {\n before: new Date(key[0]),\n after: new Date(key[key.length - 1])\n }\n ]);\n\n if (!_.isEmpty(slots))\n Object.keys(slots).forEach(slot => {\n if (slots[slot].length === 0) {\n const date = moment(slot)\n .tz(\"Asia/Kolkata\")\n .toISOString(true);\n setDisableDate([...disableDate, new Date(date)]);\n }\n });\n }, []);\n\n\nWhen above code is run it works fine but it always gives the following warning.\n\n\n React Hook useEffect has missing dependencies: 'disableDate' and\n 'slots'. Either include them or remove the dependency array. You can\n also do a functional update 'setDisableDate(d => ...)' if you only\n need 'disableDate' in the 'setDisableDate' call \n react-hooks/exhaustive-deps\n\n\nHow do I resolve this issue?" ]
[ "reactjs", "react-hooks" ]
[ "react-bootstrap-table2 - inside a cell : change button to icon on click", "I have implemented a table using https://react-bootstrap-table.github.io/react-bootstrap-table2/\nI have added a button inside cells and when I click on it, I would like the button to be replace by an icon.\nThe solution I found so far doesn't re render the cell when the button has been clicked.\nBelow my code :\nconstructor(props) {\n super(props);\n this.state = { \n pairAdded: false\n };\n}\n\nlinkAddPair = (cell, row, rowIndex, formatExtraData) => {\n\n return (\n this.state.pairAdded ?\n <HiCheck /> //this is a "ticked" icon\n :\n <Button onClick={() => { this.setState({ pairAdded: !this.state.pairAdded }); }}>\n Add\n </Button>\n );\n}\n\nrender() {\n\n let allPairs = this.props.pairs;\n const columns = [\n ...\n {\n dataField: 'add pair',\n text: 'add pair',\n formatter: this.linkAddPair\n }\n ];\n\n return (\n <PaginationProvider pagination={ paginationFactory(paginationOption) } >\n {\n ({\n paginationProps,\n paginationTableProps\n }) => (\n <div>\n <PaginationTotalStandalone { ...paginationProps } />\n <BootstrapTable\n bootstrap4\n keyField="id"\n data={ allPairs }\n columns={ columns }\n { ...paginationTableProps }\n filter={ filterFactory()}\n />\n <PaginationListStandalone { ...paginationProps } />\n </div>\n )\n }\n </PaginationProvider>\n );\n}\n\nIf my post doesn't contains enough details, please let le know, thanks" ]
[ "reactjs", "react-bootstrap-table" ]
[ "Comparing efficiency of two substring searching methods in Python", "After searching the topic of substring searching in python (link1, link2) I found two obvious solutions\n\nstr1 = 'Hi there'\nstr2 = 'Good bye'\n# 1\nif str1.find('Hi') != -1: \n print 'Success!'\n# 2\nif 'Good' in str2:\n print 'Success'\n\n\n\nIs there a difference in the generated code by those two or the second one is just syntactic sugar ?\nIs one or the other more efficient?\nIs there a third option" ]
[ "python" ]
[ "\"Broad host permissions\" Webstore warning despite only one host in permissions", "I'm trying to publish a chrome extension but, when I try, this message appears:\n\n\n Because of the following issue, your extension may require an in-depth review:\n \n \n Broad host permissions\n \n \n Instead of requesting broad host permissions, consider using the activeTab permission, or specify the sites that your extension needs access to. Both options are more secure than allowing full access to an indeterminate number of sites, and they may help minimize review times.\n \n The activeTab permission allows access to a tab in response to an explicit user gesture.\n\n{\n ...\n \"permissions\": [\"activeTab\"]\n}\n\n \n If your extension only needs to run on certain sites, simply specify those sites in the extension manifest:\n\n{\n ...\n \"permissions\": [\"https://example.com/*\"]\n}\n\n\n\nMy manifest has those permissions:\n\n{\n \"manifest_version\":2,\n \"name\": \"Online Console\",\n \"version\":\"1.0\",\n\n \"description\": \"Simulador de consola de Online\",\n \"browser_action\":{\n \"default_icon\": \"icon24.png\",\n \"default_popup\": \"primero.html\"\n },\n \"permissions\": [ \"activeTab\", \"https://google.com\" ], \n\n \"content_scripts\": [{\n \"js\": [ \"jquery.min.js\" ],\n \"matches\": [ \"http://*/*\", \"https://*/*\" ]\n }]\n}\n\n\nWhy am I getting this warning and how to solve it?" ]
[ "javascript", "html", "google-chrome-extension", "permissions", "manifest" ]
[ "Getting a lower z-index for a bigger number", "This is more a maths question than a coding one... I'm creating a scatterplot with bubbles that also have different sizes. I want the bigger sizes to have a lower z-index than smaller sizes, to avoid the bigger ones standing over the smaller and making interaction impossible. So I need a formula revert that order by code. Thanks" ]
[ "javascript", "css", "math", "z-index" ]
[ "Where is the code of gRPC that handles deadline in the client stub?", "I'm searching for when deadline starts to count down and how deadline is handled in detail in the client stub in gRPC. I think that src/cpp/client/generic_stub.cc may tell some details. In the following code block from generic_stub.cc, I think CallInternal() may include such details, but I don't find via software called Understand what CallInternal() actually does. \n\n// begin a call to a named method\nstd::unique_ptr<grpc::GenericClientAsyncReaderWriter> GenericStub::Call(\n grpc::ClientContext* context, const grpc::string& method,\n grpc::CompletionQueue* cq, void* tag) {\n return CallInternal(channel_.get(), context, method, cq, true, tag);\n}\n\n\nSo, which part of the code in gRPC contains the detail I desire? Very looking forward to an answer! Thanks!" ]
[ "grpc" ]
[ "python syntax mess: name is not defined", "I've been learning from 'Learn Python the Hard Way' and this particular piece of code gives me a lot of headache:\n\ndef break_words(stuff):\n \"\"\"This function will break up words for us.\"\"\"\n words = stuff.split(' ')\n return words\n\ndef sort_words(words):\n \"\"\"Sort the words.\"\"\"\n return sorted(words)\n\ndef print_first_word(words):\n \"\"\"Prints the first word after popping it off.\"\"\"\n word = words.pop(0)\n print word\n\ndef print_last_word(words):\n \"\"\"Prints the last word after popping it off.\"\"\"\n word = words.pop(-1)\n print word\n\ndef sort_sentence(sentence):\n \"\"\"Takes in a full sentence and returns the sorted words.\"\"\"\n words = brea_words(sentence)\n return sort_words(words)\n\ndef print_first_and_last(sentence):\n \"\"\"Prints the first and last words of the sentence.\"\"\"\n words = break_words(sentence)\n print_first_word(words)\n print_last_word(words)\n\ndef print_first_and_last_sorted(sentence):\n \"\"\"Sorts the words then prints the first and last one.\"\"\"\n words = sort_sentence(sentence)\n print_first_word(words)\n print_last_word(words) \n\n\nOnce the module is imported I get errors:\n\n>>> import ex25\n>>> sentence = \"All good things come to those who wait.\"\n>>> words = ex25.break_words(sentence)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"ex25.py\", line 4, in break_words\n return words\nNameError: global name 'words' is not defined\n\n\nWhere did I go wrong? I checked the code millions of times..." ]
[ "python", "syntax" ]
[ "Bash: Pipe output into background process?", "I would like to put a process into the background, and then pipe data to it multiple times. For example:\n\ncat & # The command I want to write into\ncat_pid=$! # Getting the process id of the cat process\n\necho hello | $cat_pid # This line won't work, but shows what I want to\n # do: write into the stdin of the cat process\n\n\nSo I have the PID, how can I write into that process? I would be open to launching the cat process in a different way.\n\nAlso, I'm on Mac, so I can't use /proc :(" ]
[ "macos", "bash", "unix", "pipe", "sh" ]
[ "Uploading file to s3 using presigned-URL", "I'm trying to upload a file in my s3 bucket with a aws presigned-URL.\n\nHere is my js function\n\nfunction UploadObjectUsingPresignedURL() \n{\n var file = document.getElementById('customFile').files[0];\n console.log(file);\n var xhr = new XMLHttpRequest();\n xhr.open('PUT', 'hereMyPresignedURL', true);\n //xhr.setRequestHeader('Content-Type', 'image/jpeg');\n xhr.onload = () => {\n if (xhr.status === 200) {\n console.log('Uploaded data successfully');\n }\n };\n xhr.onerror = () => {\n console.log('Nope')\n };\n xhr.send(file); // `file` is a File object here \n}\n\n\nHere my html \n\n<div class=\"input-group\">\n <div class=\"custom-file\">\n <input type=\"file\" class=\"custom-file-input\" id=\"customFile\"\n aria-describedby=\"customFile\">\n <label class=\"custom-file-label\" for=\"customFile\">Choose file</label>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"customFile\" \n onclick=\"UploadObjectUsingPresignedURL()\">Button</button>\n </div>\n </div>\n\n\nAnd here the result in my console ...\n\nconsole output\n\n\nfunctions.js:4 File {name: \"aragorn.jpg\", lastModified: 1590136296908, lastModifiedDate: Fri May 22 2020 10:31:36 GMT+0200 (heure d’été d’Europe centrale), webkitRelativePath: \"\", size: 7714, …}\nfunctions.js:10 Uploaded data successfully)\n\n\nSo it seems it went well (Uploaded data successfully), but in my S3 bucket I have no new files ... Since I have no error,I don't know how to debug this ...\n\nThanks you :) !!\n\nEDIT :Here my .NET code for generate the Presigned-URL : \n\npublic static string MakeS3PresignedURIUpload()\n {\n string awsAccessKeyId = \"XXX\";\n string awsSecretAccessKey = \"XXX\";\n string s3Bucket = \"test-bucket\";\n string s3Key = \"/aragorn.jpg\";\n string awsRegion = \"us-west-2\";\n\n\n string presignedUri = \"Error : No S3 URI found!\";\n int expirationMinutes = 60;\n\n\n\n if (s3Bucket != String.Empty && s3Key != String.Empty && awsRegion != String.Empty)\n {\n try\n {\n s3Key = s3Key.Replace(\"\\\\\", \"/\");\n GetPreSignedUrlRequest presignedUriReq = new GetPreSignedUrlRequest();\n RegionEndpoint myRegion = RegionEndpoint.GetBySystemName(awsRegion);\n AmazonS3Client client = new AmazonS3Client(awsAccessKeyId, awsSecretAccessKey, myRegion);\n presignedUriReq.Verb = HttpVerb.PUT;\n presignedUriReq.BucketName = s3Bucket;\n presignedUriReq.Key = s3Key;\n presignedUriReq.Expires = DateTime.UtcNow.AddMinutes(expirationMinutes);\n presignedUri = client.GetPreSignedURL(presignedUriReq);\n }\n catch (AmazonS3Exception e)\n {\n return string.Format(\"Error : S3 - MakeS3PresignedURIUpload - Error encountered on server.Message:'{0}' when writing an object\", e.Message);\n }\n catch (Exception e)\n {\n return string.Format(\"Error : S3 - MakeS3PresignedURIUpload - Unknown encountered on server. Message:'{0}' when writing an object\", e.Message);\n }\n }\n return presignedUri;\n }" ]
[ "javascript", "amazon-s3", "upload", "xmlhttprequest", "pre-signed-url" ]
[ "android google play game services error : c++ symbol std::function couldn't be resolved", "I'm using NDK-r9d and trying to integrate C++ Google Play Game (GPG) Services to my sample native-activity project.\nNow native-activity (sample from NDK ) compiles perfectly and runs fine on my android phone.\n\nBut when I add GPG using this code\n\ngpg::AndroidPlatformConfiguration platform_configuration;\nplatform_configuration.SetActivity(state->activity->clazz);\n\n\nI got error \n\n\"Symbol 'function' could not be resolved\" at achievement_manager.h /HelloJni/modules/gpg-cpp-sdk/android/include/gpg line 54 Semantic Error\n\n\nI've added includes to STL and everything needed from this link Eclipse indexer errors when using STL with Android NDK with no success.\n\nThis is my Android.mk\n\nLOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := hello-jni\nLOCAL_SRC_FILES := hello-jni.cpp\n\n\nLOCAL_STATIC_LIBRARIES := android_native_app_glue libgpg-1\nLOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM\nLOCAL_CFLAGS := -std=c++11\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-add-path,$(LOCAL_PATH)/../modules)\n$(call import-module,gpg-cpp-sdk/android)\n$(call import-module,android/native_app_glue)\n\n\nAnd this is my Application.mk\n\nAPP_PLATFORM := android-10\nAPP_ABI := armeabi-v7a\nAPP_STL := c++_static\n\n\nAny suggestions?" ]
[ "android", "android-ndk", "google-play-services", "google-play-games" ]
[ "Setting custom RequestButton button", "I have just started exploring the Uber iOS Sdk. I was checking for RequestButton and have noticed that its not taking any frame which we are passing. Is it possible to put button on desired location of a view?\n\nlet button = RequestButton(colorStyle:.White)\nview.addSubview(button)\nbutton.frame = CGRectMake(100,300, button.frame.size.width, button.frame.size.height)" ]
[ "ios", "uber-api" ]
[ "How to assign a value to a variable from MS Access", "I'm using an admin privilege system from my database, the max level is \"3\".\nSo when a user clicks login, at the corner of the program he can see his admin level.\nI wanted to assign this to a variable but I'm always getting errors.\n\nadp.SelectCommand.CommandText = \"select dastresi from Users where username = '\" + username+\"'\";\n\n\n(dastresi means access level)" ]
[ "c#", "database", "ms-access" ]
[ "Notepad ++ Python script - Calculate in XML Numbers with decimal", "i have a XML with a.e. \n\n Pos=\"0.003\"\n Pos=\"100.002\"\n Pos=\"10.2\"\n Pos=\"3.43\"\n Pos=\"0.999\"\n\n\nnow i want that every tag with get +0.007. i tried it with a python script, but nothing happens. \nWhat i am doing wrong :(\n\ndef calculate(match):\n return 'Pos=\"\\d{1,4}[.]\\d{1,4}\"' % (match.group(1), complex(match.group(2))+0.007)\n\n editor.rereplace('Pos=\"(\\d{1,4}[.]\\d{1,4})\"', calculate)\n\n\nthe result should be then \n\n Pos=\"0.010\"\n Pos=\"100.009\"\n Pos=\"10.207\"\n Pos=\"3.437\"\n Pos=\"1.006\"" ]
[ "python", "xml", "notepad++" ]
[ "Access violation when inserting element into global map", "I've been trying to debug this for hours now with no luck. I know you guys will solve the problem within minutes, so here's the situation:\n\nI've got ~400 .cpp/.h files called ProblemX.cpp/ProblemX.h (where X is a number from 1 to 400). Each file contains the solution for a math related problem. I would like to have the problems register themselves at compile time to a global map with a unique key (just an int will work) and have the value be a pointer to the function that kicks off the math problem solution.\n\nThe global map is created and handled in files called Problem.h/Problem.cpp. However, I'm getting an \"Access violation reading location 0x00000004\" when the first Problem attempts to self-register in the map. The code is as follows:\n\nIn the ProblemX.h files (problem1 kicks off the solution for this problem):\n\n#ifndef PROBLEM1_H\n#define PROBLEM1_H\n\n#include \"Problems.h\"\n#include <string>\n\nstd::string problem1();\nstatic int rc1 = registerProblem(1, problem1);\n\n#endif\n\n\nIn the Problems.h file (problemFinder is the function that uses the global map to call the appropriate function pointer):\n\n#ifndef PROBLEMS_H\n#define PROBLEMS_H\n\n#include <string>\n\nint registerProblem(int problemNum, std::string (*problemFunc)(void));\nstd::string problemFinder(int problemNum);\n\n#endif\n\n\nIn Problems.cpp:\n\n#include \"Problems.h\"\n#include <iostream>\n#include <map>\n\nusing namespace std;\n\nmap<int,std::string (*)(void)> problems_map;\n\nint registerProblem(int problemNum, string (*problemFunc)(void)) {\n int rc = 0;\n problems_map[problemNum] = problemFunc;\n return rc;\n}\n\n\nstring problemFinder(int problemNum) {\n string retStr = \"\";\n retStr = problems_map[problemNum]();\n return retStr;\n}\n\n\nThe access violation occurs where \"problems_map[problemNum] = problemFunc;\".\n\nThanks!" ]
[ "c++", "map" ]
[ "Given two different classes which refer a common class(Test.java) in their definition, How many times ClassLoader#loadClass(Test) gets called?", "Given two different classes which refer a common class(Test.java) in their definitions, \nHow many times ClassLoader#loadClass(Test) gets called?\n\nClassA {\nTest t = new Test();\n}\n\nClassB {\nTest t = new Test();\n}\n\n\nI want to understand if a classloader has already loaded class(Test), and in another class(ClassB) same class is referred, \ndoes the jvm call ClassLoader#loadClass(Test) again or not? if not, how does it check if class is already loaded by same classloader?" ]
[ "java", "classloader" ]
[ "Webpack Dev Server, allow paths with `dot` in them", "In my React.js app I have a route like this:\n\n/foo/foo.bar/foo\n\n\nWhen I load this URL (clicking refresh on the browser), I get:\n\nCannot GET /foo/foo.bar/foo\n\n\nI think the problem is that Webpack Dev Server thinks that this URL refers to a static asset and tries to load it.\n\nHow can I fix this problem? (I need the dot)" ]
[ "webpack", "webpack-dev-server" ]
[ "Convert jagged int[][] array to object[][] array", "There is any way to convert/cast an int[][] array into an object[][] array?\n\nint[][] = FillArray();\nobject[][] = iArray;" ]
[ "c#", "arrays", "casting" ]
[ "Can a git diff.*.textconv converter determine whether to output colors?", "Is it possible to determine whether git would output colors in the current situation when running a git diff.*.textconv converter?\n\nExample:\n\ngit diff with color.ui=auto will output colors iff the output is a terminal. I would like the diff.*.textconv converter to also output colors iff the output is a terminal. I can't check within the converter, since git always redirects the output to a non-terminal.\n\nThis may be an X-Y problem; I basically just want the best way to syntax-highlight the source content of git diffs, but not if the output is not going to a terminal." ]
[ "git", "git-diff" ]
[ "Code runs fine in executable, same code requires elevated permissions in DLL", "I am writing a WPF application which uses an OleDb Connection to read Paradox 7 Tables and push the data into a SQL Database. It runs fine in my WPF executable when testing without administrator privileges. More recently I wanted to separate UI and functionality, so I broke that code into an assembly (DLL) of its own.\n\nSince moving it to a DLL, the code only works when run elevated, and I can't understand why...\n\nAny and all answers/explanations appreciated!\n\nThe exception I get when I try to run any query from the OleDbConnection:\nUnexpected error from external database driver (11265)." ]
[ "c#", "wpf", "dll" ]
[ "How to switch https traffic from 1 web server to another one. IPTABLES issue", "Here is my configuration.\nI have varnish listening to port 80 and 2 web server (tomcat) on port 8080 and 8081 and https 4430 and 4431.\n\nHTTP traffic goes from varnish to 1 web server. When I need to upgrade my app, I shut down one tomcat, upgrade the code, restart and change the varnish configuration to go to the upgraded tomcat.\n\nI need to do the same for HTTP traffic. It's a small amount of traffic and I don't need caching, so I though I could just use iptables.\n\nSo I added a rule like this:\n\niptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4430\n\n\nand when I need to switch to the other tomcat, I do:\n\niptables -t nat -D PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4430 \niptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4431 \n\n\nIt seemed to work but after I few days all the machine has connection problems. Varnish is not connecting to tomcat, dns lookup do not work, etc.\n\nI found in /var/log/messages thousands of:\n\nMar 27 10:04:15 ip-10-72-254-31 kernel: [2112599.753509] nf_conntrack: table full, dropping packet.\n\n\nShutting down iptables seems to work to fix the connection problems.\n\nSo, can I use iptables in the way I'm using it?\nHow can I prevent \"table full, dropping packet\" issue?\nWhat else can I use to redirect my https traffic?" ]
[ "linux", "tcp", "routing", "iptables", "varnish" ]
[ "TabControl , Frame in WindowsPhone", "In wpf , I was used to show a page into a frame after clicking on a tab item . Something like this : \n\n<Frame Source = \"\" />\n\n\nI added System.Windows.Controls reference in my project in order to work with tabControl & frame . I can add a tabControl , but no luck with Frame . My xaml code : \n\nxmlns:cc=\"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls\"\n\n\nWhenever i'm trying to add a frame , compiler asks me to check the reference. What's the solution here ? Can anybody help ? \n\nP.S. I know that in win Phone , pivotControl is the default tool , but my boss is demanding tabControl ." ]
[ "c#", "silverlight", "windows-phone-7", "uinavigationcontroller" ]
[ "Generate multiple HTTP request from list values", "I have a list with three hashes and the script should create HTTP request for each hash in the list and then save the file of the hash.\nfor some reason, the script generates only one HTTP request and for this reason, I manage to download only one file instead of three. \n\nall_hashes = ['07a3355f81f0dbd9f5a9a', 'e0f1d8jj3d613ad5ebda6d', 'dsafhghhhffdsfdd']\nfor hash in all_hashes:\n params = {'apikey': 'xxxxxxxxxxxxx', 'hash': (hash)}\n response = requests.get('https://www.test.com/file/download', params=params)\n downloaded_file = response.content\n\nname = response.headers['x-goog-generation']\n\nif response.status_code == 200:\n with open('%s.bin' % name, 'wb') as f:\n f.write(response.content)" ]
[ "python" ]
[ "Clear header single page", "I have document with 50 pages. But i want pages 5, 10, 14 and 33 no header (no word and line). Can somebody help me.\n\nThank you very much." ]
[ "latex" ]
[ "Why error occurs when using CLion build OpenCV after CMake configuration and generation done?", "I found in Clion cmake always add -G \"CodeBlocks - Unix Makefiles\" parameter. It made the generation of camke different at using cmake ../\n\nAs you can see, I didn't add any parameter at CMake options. But CLion add -G \"CodeBlocks - Unix Makefiles\".\n\nAccording by jetbrains. This feature will be fixed, but don't know when.CLion CMake default generator is CodeBlocks - Makefiles.\n\nIf you build OpenCV by CLion you will find CMake error at last like below. This is caused by -G \"CodeBlocks - Unix Makefiles\"\n\nProblems were encountered while collecting compiler information:\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/calib3d/perf_precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory\ncc1plus: fatal error: /--/--/cmake-build-release/modules/core/precomp.hpp: No such file or directory" ]
[ "c++", "cmake", "clion" ]
[ "Ruby on Rails passing of parameters between views from link_to tag instead of submit_tags (having both on page)", "I'm creating in my index page of my ruby on rails program, a list of the most commonly searched for terms in my database and hence each time a user selects a specific category this is written to another database.\n\nWhat i would like it to create a hyperlink and pass a certain amount of parameters to a form like is usually done with a select_tag but instead with just a hyperlink, i would like to pass a set of hidden fields that i have on the page as well as what the user has selected.\n\nTo give you a better idea, basically i have the following structure in my program:\n\nUser inputs a search on (index.html.erb), user clicks on submit tag \naction, user is taken to search.html.erb page and is displayed a set of refined categories + some fields, submit button, \n\nuser is taken to closest.html.erb (which uses parameters from the previous form by invoking the params[:searchSelected] and a few other params. )\n\nI would also like to add this functionality:\nMimick this same operation, but instead of going in the search.html.erb, i would click on an already refined search category on the index.html.erb page (from a link_to , transmit as parameters which link_to the user has chosen + the hidden fields.\n\ni Currently have this code\n\n@stats.each do\n|scr|%>\n<%= link_to scr.category, :action => 'closest', :id => scr.category%>\n\n\nI'm not sure if this is relevant, but i currently have the following routes in my routes.rb file\n\n map.resources :stores, :collection => { :search => :get }\n\n map.connect ':controller/:action/:id'\n map.connect ':controller/:action/:id.:format'\n\n\nwould anyone please assist me please? this is my first ruby on rails project and i would really like to find a way around this please" ]
[ "ruby-on-rails", "parameters", "routing" ]
[ "How to integrate a feature in SharePoint 2010 site template?", "I have created a site in SharePoint 2010 and saved it as a site template. Next, I have created a custom workflow in Visual Studio 2010. The final product of the site template creation is the .wsp file (a package), and the final product of the workflow coding is another .wsp file.\n\nWhat I need to do now, is to extract my workflow feature from the corresponding .wsp file and to integrate it with my site template's .wsp file. My ultimate goal is to be able to create a new site from my site template and to have my workflow in it, and to avoid separate feature activation. Is it possible to achieve this, and if yes, how should I do it? Thanks. \n\nThere's the same topic at MSDN" ]
[ "sharepoint" ]
[ "Passing object to directive does not allow global variables", "Im passing to my directive a variable col defined col: '=' in the directive.\nThe object contains some arrays, and inside those arrays there is a function.\nThe function refers to a variable from my controller, and it looks like this:\n\nfunction (params) {\n return $scope.function(params);\n}\n\n\nThiscol variable is being passed to a sub directive that the big directive contains, and the sub-directive executes it.\n\nIt throws an error, from a file called VM{random number here} where it says that $scope is undefined.\n\nHow can I make it run from my controller, and not from a virtual JS file?" ]
[ "javascript", "angularjs" ]
[ "Delete objects in backbone-relational", "let's say I have two HasMany relationships:\n\nPlaylist: HasMany Clips\n\n\nand\n\nClipsMegaCollection: HasMany Clips\n\n\nThe idea is to have a sorted list of Playlists and keep a ClipsMegaCollection synchronized as the planar list of clips reflecting all the playlists.\n\nIs this possible with backbone-relational, or can anyone think of a way of doing this in backbone?\n\nI can have ClipsMegaCollection.comparator return a key depending on Playlist order and Clip order within the playlist, so keeping things sorted should be OK.\n\nThe problem is that I need to keep things synchronized when clips are added or removed from playlists, or moved around" ]
[ "node.js", "backbone.js", "backbone-relational" ]
[ "git-svn : rebase fails multiple times then works", "We are rolling out git on our clients to interact with a central SVN repository. On most work stations it works fine, but we have one work station where the person has to run git svn rebase 3-4 times before it completes. Each time there is no error, but random files are marks as modified or new. The files seem to be a commit that was pulled down from the central svn repository but not completed. Rerunning git svn rebase again a few times clears this up. The computer is top of the line with plenty of hard drive space and 16 gigs ram. Has anyone else ran into issues like this?" ]
[ "git-svn" ]
[ "error: extern declaration of 'i' follows declaration with no linkage", "In the following program, I thought that extern int i; will change the following i to refer to the i defined outside main:\n\n#include <stdio.h>\n\nextern int i=1; // warning: 'i' initialized and declared 'extern'\n\nint main()\n{\n int i=2;\n printf(\"%d\\n\", i);\n extern int i; // error: extern declaration of 'i' follows declaration with no linkage\n printf(\"%d\\n\", i);\n return 0;\n}\n\n\nWhat is the reason of the \"error: extern declaration of 'i' follows declaration with no linkage\", where \"declaration with no linkage\" refers to int i=2;?\n\nAfter I remove int i=2 in main, \n\n\nthe error is gone,\nthe warning \"warning: 'i' initialized and declared 'extern'\" on extern int i=1; also disappear . Why is that?\n\n\nThank you for explanations!" ]
[ "c", "declaration" ]
[ "How to install the admin panel in 1.0", "I'm trying to install it but with no success.\nSteps:\n1. copied admin.jsp to /red5/webapps/root\n2. Pasted all the jars from adminplugin-1.0.zip to /red5/plugins\n3. started the server. ERROR:\n\n[INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1fa490e: defining beans [global.clientRegistry,global.serviceInvoker,global.mappingStrategy,global.context,global.handler,global.scope,red5.scopeResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@be49e0\n[WARN] [main] org.red5.server.ContextLoader - Context destroy failed for: default.context\norg.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'default.context' is defined\n at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]\n at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]\n\n\nSo what's the procedure, i can't find it. I've been trying for the whole month to accomplish this!" ]
[ "panel", "admin", "red5" ]
[ "Looking for a class to create and parse configuration files in various formats in c#", "I want to use (read/write/change) configuration files which have various formats. Life for instance\n\nkey1: value1\nkey2: value2\n\n\nor\n\n[section1]\nkey=value\n\n[section2]\nkey=value\n\n\nI assume that there are a million different classes flying around the web, which accomplish this not very extraordinary task, but I was unable to find a good implementation. Could someone reccomend one?" ]
[ "c#", ".net", "configuration", "mono" ]
[ "Is RabbitMQ's message backing store global?", "I am studying RabbitMQ; how it works.\n\nAccording to the documents about its internal, the message store keeps the message contents and the queues keep only the indices to the messages.\n\nSo when the same message is routed to the multiple queues, it does not duplicate the message content but rather store it only once keeping the reference (message id) to the message in those queues.\n\nThen what if a message is enqueued into the multiple queues that belong to the different machines? Will the message be stored only at one of the machines?\n\nThe question can be rephrased as follows: is the messages backing store global across cluster machines or local for each machine?\n\nThanks," ]
[ "rabbitmq" ]
[ "Angular : Why does sort only work on first Mat Table?", "Why is it that the sort functionality advertised here : https://material.angular.io/components/table/overview#sorting\n\nfails as soon as you add a second table to display the second half of your data? :\n\nhttps://stackblitz.com/edit/angular-1vg9gn-q1back?file=app/table-basic-example.ts\n\nand how would I fix it?" ]
[ "angular", "sorting", "angular-material2" ]
[ "Changing the opacity colors by selecting the text in codeigniter php", "<?php if(isset($records2) && is_array($records2)):?>\n <?php foreach ($records2 as $r):?>\n <div class=\"servicesecommerce accordion\"><?php echo $r->service_name;?></div>\n <div class=\" servicesetext panel\"> \n <div class=\"services3\"><?php echo $r->text;?></div> \n </div> \n<?php endforeach;endif;?>\n\n<script>\nvar acc = document.getElementsByClassName(\"accordion\");\nfor (i = 0; i < acc.length; i++) {\nacc[i].onclick = function(){\n this.classList.toggle(\"active\");\n this.nextElementSibling.classList.toggle(\"show\");\n}\n}\n</script>\n<script>\n $('.servicesecommerce').each( function( index ) \n { \n $(this).addClass('itemsss-' + index); \n });\n</script>\n\n\nThe output will be in this format\nE-commerce \nSoftware\nDigital\nMobile App Development\n\nBy default E-commerce should be highlighted and the rest of the three should be in disable(Opacity should be low.When the user clicks on Second one remaining three div Opacity should be changed and the one which has been selected that should be highlighted with dark color." ]
[ "php", "jquery", "html", "css" ]
[ "iOS: Single Finger rotation and translation of an image", "Currently i am following this Link to perform Single finger rotation on an image and its working fine.But i am wondering after performing rotation, how to perform translation operation if i want to move the image from one postion of screen to any other position.\n\n- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event\n{\n // We can look at any touch object since we know we \n // have only 1. If there were more than 1 then \n // touchesBegan:withEvent: would have failed the recognizer.\n UITouch *touch = [touches anyObject];\n\n // A tap can have slight movement, but we're not interested\n // in a tap. We want more movement. So if a tap is detected\n // fail the recognizer. \n if ([self state] == UIGestureRecognizerStatePossible) {\n [self setState:UIGestureRecognizerStateBegan];\n } else {\n [self setState:UIGestureRecognizerStateChanged];\n }\n\n // To rotate with one finger, we simulate a second finger.\n // The second figure is on the opposite side of the virtual\n // circle that represents the rotation gesture.\n\n UIView *view = [self view];\n CGPoint center = CGPointMake(CGRectGetMidX([view bounds]), CGRectGetMidY([view bounds]));\n CGPoint currentTouchPoint = [touch locationInView:view];\n CGPoint previousTouchPoint = [touch previousLocationInView:view];\n\n // use the movement of the touch to decide\n // how much to rotate the carousel\n CGPoint line2Start = currentTouchPoint;\n CGPoint line1Start = previousTouchPoint;\n CGPoint line2End = CGPointMake(center.x + (center.x - line2Start.x), center.y + (center.y - line2Start.y));\n CGPoint line1End = CGPointMake(center.x + (center.x - line1Start.x), center.y + (center.y - line1Start.y));\n\n //////\n // Calculate the angle in radians.\n // (From: http://iphonedevelopment.blogspot.com/2009/12/better-two-finger-rotate-gesture.html )\n CGFloat a = line1End.x - line1Start.x;\n CGFloat b = line1End.y - line1Start.y;\n CGFloat c = line2End.x - line2Start.x;\n CGFloat d = line2End.y - line2Start.y;\n\n CGFloat line1Slope = (line1End.y - line1Start.y) / (line1End.x - line1Start.x);\n CGFloat line2Slope = (line2End.y - line2Start.y) / (line2End.x - line2Start.x);\n\n CGFloat degs = acosf(((a*c) + (b*d)) / ((sqrt(a*a + b*b)) * (sqrt(c*c + d*d))));\n\n CGFloat angleInRadians = (line2Slope > line1Slope) ? degs : -degs;\n //////\n\n [self setRotation:angleInRadians];\n}" ]
[ "iphone", "ipad", "uitouch" ]
[ "Command to remove binding from IIS", "In IIS if i want to remove a binding information, we can go to IIS then right click the required site and click edit bindings. Then select the required row from edit site binding popup and click remove button. The same thing i need a command to perform the same operation" ]
[ "iis", "command", "command-prompt" ]
[ "Shopify - using your JS libraries etc in inline section / snippet scripts", "I want to use a script within the file for a specific section (in my collection-template.liquid in this circumstance, but it could be in any) - I want to place the script at the bottom of the file. However when you use inline scripts in this way, they don't seem to reference other libraries that you have saved on your theme. \n\nIn my example I want to be able to use jQuery in this script, but jQuery doesn't appear to be loaded - i.e. it doesn't recognise any jQuery or any other libraries. It does work for the theme.js, but I need this script to be only in this section/snippet. I need the script to be inline because it uses liquid - moving it to the theme.js is not an option in this case.\n\nCan anyone recommend a solution to include these libraries (perhaps its as simple as including a reference to the vendor.js file or otherwise) - and also if possible explain why these aren't referenced as standard? As it seems strange to me that this issue even exists. I am using the Debut theme." ]
[ "javascript", "jquery", "shopify", "liquid" ]
[ "Prettier - the meaning of parantheses around assigned variables", "VS Code 1.16\n\n\nI format code with Prettier with formatting on save. I get weird parantheses around assigned variables;\n\nI have these two variables \n\nBefore formatting:\n\n tlProjectLoader = new TimelineMax({\n paused: true\n }),\n\n $laoder = $(this).find('.loader');\n\n\nAfter formatting: \n\n (tlProjectLoader = new TimelineMax({\n paused: true\n })),\n\n ($laoder = $(this).find('.loader'));\n\n\nI know this is casued by Prettier, as when I turned it off and that behaviour does not occur. So, why? If I don't need it - how to turn it off?" ]
[ "javascript", "formatting", "format", "prettier" ]
[ "Cucumber capybara stubbing", "I have an index action in a rails controller called images_controller.rb that fetches images from an external service. I am trying to write cucumber scenarios and am struggling with how to write/stub out my visit index page step. How could I stub out the images it fetches without it making the request?\n\nFeature:\n\nScenario: Image Index\n Given an image exists on the image server\n When I am on the images page\n Then I should see images\n\n\nSteps so far:\n\nGiven(/^an image exists on the image server$/) do\n image_server_url = IMAGE_SERVER['base_url'] + \"/all_images\"\n image = \"image.png\"\n image_path = \"development_can/image.png\"\n response = [{image_path => [image]}].to_json\n stub_request(:get, image_server_url).to_return(JSON.parse(response))\nend\n\nWhen(/^I am on the images page$/) do\n body = \"[{\\\"image/development_app\\\":[\\\"the_pistol.jpeg\\\"]},{\\\"image/development_can\\\":[\\\"kaepernick.jpg\\\"]}]\"\n @images = JSON.parse(body)\nend\n\nThen(/^I should see images$/) do\n\nend\n\n\ncontroller:\n\nclass ImagesController < ApplicationController\n def index\n response = image_server_connection.get(IMAGE_SERVER['base_url'] + \"/all_images\")\n @images = JSON.parse(response.body)\n end\nend" ]
[ "ruby-on-rails", "ruby", "cucumber", "capybara" ]
[ "C# set CheckBox value from external class", "I have external class for do some work with my form.\nI have some error end can't handle with it.\n\nMy first variant \n\nmainForm.CheckBox1.Checked = true;\n\n\nit doesn't worked with an error\nCross-thread operation not valid: Control 'CheckBox1' accessed from a thread other than the thread it was created on\n\nSo I tried like in folow post\nstackoverflow question 1\nbut when I wrote\n\nmainForm.CheckBox1.IsCheked = true\n\n\nCompiler gives an error that\nThe error is 'System.Windows.Forms.Control' does not contain a definition for 'IsChecked' and no extension method 'IsChecked' accepting a first argument of type 'System.Windows.Forms.Control' could be found (are you missing a using directive or an assembly reference?)\n\nI saw and found answer in \nsrackoverflow question 2\n\nBut i can't casting my object because when I write\n\n(CheckBox)mainForm.CheckBox1.IsCheked = true\n\n\nit gives an error Can't find name of or namespace (are you missing a using directive or an assembly reference?) for CheckBox. I have using System.Windows.Forms; in the beginning of class.\n\nI'm a beginner in C# so may your give me some suggestions what I do wrong?" ]
[ "c#", "checkbox" ]
[ "failover-abort-no-good-slave master mymaster", "I'm trying to set up a highly available and fault tolerance Redis,\nbut in this scenario, all sentinel stuck and can't select a new master\nI set down-after-milliseconds 1000 and failover-timeout 2000\nwhen all sentinel goes down and then my master goes down when sentinels go up cant select the new master, and show log -failover-abort-no-good-slave master mymaster.\nI know this issue happened because of this part of the code(sentinel.c)\nif (slave->master_link_down_time > max_master_down_time) continue;\ni there any parameter to config sentinel always select a master in failover and don't -failover-abort-no-good-slave master mymaster?" ]
[ "redis", "sentinel" ]
[ "How to use class type of method parameter?", "I have the following classes:\nFoo1 extends Bar and\nFoo2 extends Bar\nI would like to pass the type of either Foo1, or Foo2 in my method to create either a Foo1, or a Foo2, like this:\npublic Bar createMethod( "either type of Foo1, or Foo2" fooType) {\n \n //returns the foo1 or foo2\n}\n\nIs there any approach to achieve this?" ]
[ "java", "oop" ]
[ "Terraform Route53 record delay for EC2 instance", "I am creating EC2 instances but when I add a Route53 record it takes up to 60 seconds for the DNS to replicate and get recognised.\n\nresource \"aws_instance\" \"zk-host\" {\n ami = \"ami-30041c53\" # Amazon Linux Image\n count = \"${var.count}\"\n associate_public_ip_address = false\n\n connection {\n user = \"ec2-user\"\n }\n\n provisioner \"remote-exec\" {\n inline = [\n ... install things here...\n #\"sudo service zookeeper-server start ... after some delay ?\"\n ]\n }\n}\n\n// Make a DNS entry for each host while we're here.\nresource \"aws_route53_record\" \"route53-record-zk\" {\n zone_id = \"${var.route53-zone-id}\"\n count = \"${var.count}\"\n name = \"${var.host-name-prefix}${count.index}.dwh.local\"\n type = \"A\"\n ttl = \"30\"\n\n records = [\n \"${element(aws_instance.zk-host.*.private_ip, count.index)}\"\n ]\n}\n\n\nThe problem is, I am using the remote-exec provisioner to start services in my EC2 instance that rely on DNS to find its peers.\n\nI don't seem to be able to configure the DNS entry before I create the EC2 instance.\n\nIs there a way I can post-process my EC2 instance and start the services later? Or is there a technique to delay the service start until the DNS entries exist?" ]
[ "amazon-ec2", "amazon-route53", "terraform" ]
[ "How to get confirm box return value in ASP.NET C#", "I know a number of people have asked similar questions already. I've read tons of the answers given but none seems to solve my problem.\nI have a form that allows the user to select a file and pick a date that the file should be imported from. When the date is less (before) the last import period (which is a field in database keeping track of last import dates), I want to display a confirmbox to alert the user that continuing with the import could overwrite some data. The user can choose Yes to continue with import or No to cancel import. I have tried the \n\n\n onClientClick\n\n\nmethod of the \n\n\n asp:Button\n\n\ncontrol. The problem with that was, it gets fired immediately the user clicks the submit button and I don't want to display the confirm box until I have checked with the last import period which will be done on the server-side C#. I have tried writing the return value to a hidden field like this:\n\nif (confirm(\"This Import Process Will Overwrite Existing Data. Do You Want to Continue?\")) {\n document.getElementById(\"ans\").value = \"Yes\";\n return true;\n } else {\n document.getElementById(\"ans\").value = \"No\";\n return false;\n }\n\n\nThat did not work either. I have tried the solution from here: Javascript confirm message problem\n\nSomehow, I can't seem to get it to work with my solution because they have some updatePanel they are using. I am using just the DatePicker, a DropDownList (for selecting which client to import data for) and a hidden field (if required). Please help if you can. I can be a tweak of any of the above or a completely new solution. Thanks." ]
[ "javascript", "c#", "asp.net", "confirm" ]
[ "How to use @Html.BeginRouteForm for search form", "I have form to search products:\n\n@using (Html.BeginForm(\"Search\", \"Results\", FormMethod.Get, htmlAttributes: new { @class = \"navbar-form navbar-left\", role = \"search\" }))\n{\n <div class=\"form-group\">\n <input type=\"text\" name=\"txtSearch\" class=\"form-control\" placeholder=\"Products name...\" />\n @Html.DropDownList(\"CategoryId\", null, \"Select category\", new { @class = \"form-control\" })\n <select class=\"form-control\" id=\"FromPrice\" name=\"FromPrice\">\n <option value=\"0\">From price</option>\n <option value=\"2000000\">2,000,000d</option>\n <option value=\"4000000\">4,000,000d</option></select><select class=\"form-control\" id=\"ToPrice\" name=\"ToPrice\">\n <option value=\"0\">To price</option>\n <option value=\"2000000\">2,000,000d</option>\n <option value=\"4000000\">4,000,000d</option>\n <option value=\"6000000\">6,000,000d</option> \n </select>\n <input type=\"submit\" class=\"btn btn-danger form-control\" value=\"Search\" />\n </div>\n}\n\n\nAnd a route in RouteConfig file\n\nroutes.MapRoute(\n name: \"SearchForm\",\n url: \"ket-qua/{txtSearch}-{CategoryId}-{FromPrice}-{ToPrice}\",\n defaults: new { controller = \"Results\", action = \"Search\"}\n)\n\n\nHow can i call the route \"SearchForm\" when i submit search form above with all of parameter." ]
[ "asp.net-mvc", "asp.net-mvc-5" ]
[ "Properties null at component drawing time?", "I have got problem accessing a property of a component. I want to use this property to decide whether to include a particular child component.\n\nFor example:\nMyMainView.mxml lists this component\n\n<view:AnotherView id=\"anotherView\" aPresenter=\"{thePresenter}\"/>\n\n\nNow AnotherView.mxml has a property\n\n<fx:Script><![CDATA[\n [Bindable]\n public var aPresenter:APresenter;\n]]></fx:Script>\n\n\nand then in this AnotherView.mxml when I am adding something e.g.\n\n<s:Spacer height=\"10\" includeInLayout=\"{aPresenter.id != -1}\"/>\n\n\naPresenter is still null hence the spacer get drawn no matter what. On the other hand if I use aPresenter for a dataProvider it works\n\n<mx:Repeater id=\"addressDetailsRepeaterView\" dataProvider=\"{presenter.arrayOfFields}\">\n</mx:Repeater>\n\n\nCan somebody please help me understand the flow of events on creation of a flex component and how I can use the aPresenter property in .\n\nThanks" ]
[ "actionscript-3", "apache-flex", "flash-builder4.5" ]
[ "How do I scrape some text from with no unique class identifier?", "I am new to scraping so please be patient with me. I have this HTML code and I want to extract the type of property e.g. ‘Apartment’, the no. of beds e.g. 2 and the location e.g. ‘Birmingham’ only. I want to save each of these in a list. The problem is that there’s no unique class identifier.\n<div class="extra">\n <span class="tablet-visible">\n <span class="item"><label><i class="ouricon classified"></i><b></b></label>\n <span>For Sale</span></span>\n </span>\n <span class="tablet-visible">\n <span class="item"><label><i class="ouricon house"></i><b></b></label>\n <span>Apartment</span></span>\n </span>\n <span class="">\n <span class="item"><label><i class="ouricon bed"></i><b></b></label>\n <span>2</span>\n </span>\n </span>\n <span class="">\n <span class="item"><label><i class="ouricon locationpin"></i><b></b></label>\n <span>Birmingham</span>\n </span>\n </span> \n</div>\n\nI tried this code but of course this prints all the text in class=extra including the 'For Sale' which is not what I want.\nresults = requests.get(url)\nsoup = BeautifulSoup(results.text, "html.parser")\ndesc_div = soup.find_all('div', attrs={"data-itemid": True})\nfor property in desc_div:\n extra = property.find('div', class_='extra')\n print(extra.text.strip())\n\nAny help would be much appreciated." ]
[ "python-3.x", "web-scraping", "beautifulsoup" ]
[ "CLANG/LLVM : No log2f available Error at backend compilation when created a .ptx file for opencl use", "I have this really simple opencl code that I'm trying to cross-compile for .ptx architecture :\n\n__kernel void lancementKernel\n(\n __global float *tabPhotons\n)\n{\n // idx est l'indice du thread considéré\n unsigned int idx = get_local_id(1) + get_local_size(1) * (get_local_id(0) + get_local_size(0) * ( get_group_id(1) + get_group_id(0) * get_num_groups(1)));\n tabPhotons[idx] = tabPhotons[idx] * log(1.f-(float)idx);\n}; \n\n\nAll it does is calling a log function on a float type.\n\nMy generation script is as follow (note that I don't master clang/llvm so I might have made a mistake or forgot something here):\n\nclang \\\n -target nvptx \\\n -S \\\n -std=CL1.1 \\\n test.cl -o test.ll \\\n -I/usr/local/include/clc/ \\\n -include clc/clc.h \\\n -Dcl_clang_storage_class_specifiers \\\n -fmacro-backtrace-limit=0 \\\n -emit-llvm\n\nllc -march nvptx test.ll -mcpu=sm_20 -mattr=ptx30 -o test.ptx \n\n\nNow what I get is an error from the second step (the llc step) which basically says \n\"Cannot select: 0x1c8a340: i32 = ExternalSymbol'log2f'\"\n\nIt appears my log function is #defined as a log2 function (cf clc/math/log.h).\n\nThe --save_temps option of clang allow me to look at an intermediate .i file where I see my log function has been replace by a _clc_log2 call.\nAnd the /usr/local/include/clc/math/unary_intrin.inc file give me this clue :\n\n__attribute__((overloadable)) float __clc_log2(float f) __asm(\"llvm.log2\" \".f32\");\n\n\nFrom that I tend to think that no llvm.log2 function is implemented for a float type. But there's actually not much else I get so far.\n\nDo you have any idea of what could be (done) wrong ? Or any workaround at least ? \n\nThanks," ]
[ "logging", "opencl", "llvm" ]
[ "how make that a div is contained in other divs and doesn't overflow", "I have this: http://jsfiddle.net/cN2pS/embedded/result/\nAnd I'm looking for the best way to adapt the divs inside the circles (text and number) in order to these divs (text and number) don't overflow of the circles......I don't know if I'm explaining well, but in different resolutions, sometimes, text overflow of circles.....\nWhen you visit the link above of jsfiddle, try to resize the window and you'll can see the left-bottom circle, that contains Zona de Información, its text overflow...\nRegards, Daniel\n\nEDIT: It looks like works better by adding overflow:hidden; and reducing the font-size to 14px. Live example: http://jsfiddle.net/cN2pS/8/embedded/result/\n\nEDIT2: Only one question more: do you know any tutorial, live examples, etc, with efficient use of media queries in order to adapt to resolutions of mobile devices? in order to adapt these circulars divs...Or I have to resize my desktop browser window much times...Any magic tool for this? :) Thanks\n\nThanks very much for help." ]
[ "overflow", "media-queries", "css" ]
[ "IntelliJ IDEA 2016.2 tomcat properties not updated", "I'm dabbling with IntelliJ after working with eclipse for many years. I've setup my tomcat server and I have my application running just fine. I updated a properties file on my file system in my tomcat conf folder, but the new file contents are not showing up. When debugging in IntelliJ, i see that it has the contents of my old properties file. How can I update intelliJ so it see's my new changes?" ]
[ "java", "tomcat", "intellij-idea" ]
[ "Delete memory to window handle from child on close in QT", "Let see my conf:\n\nmainwindow.h\nsecond_window.h\n\n\n\nKeep pointer to second_window in class methods ( public: second_window * h_window; )\nClass mainwindow opens second_window.\n\n\nIn second_window i catch eventClose();\nAnd there i want to delete h_window;\nBut i got a access error, i thought that window is still opened so when i try to delete pointer memory i got error.\n\nOther idea when i should delete this pointer?" ]
[ "c++", "qt", "pointers", "delete-operator" ]
[ "three.js add button on object for showing info about that location", "I have an object loaded with GLTF loader into my scene:\n\n var loader = new THREE.GLTFLoader();\n loader.load( 'files/3.gltf', function ( gltf ) {\n\n gltf.scene.traverse( function ( child ) {\n\n\nI need to create a point on this object to show popup info.\n\nHow can I add a point to a specification location on the object?" ]
[ "javascript", "animation", "three.js", "3d" ]
[ "What the difference between registering a global and local supervisor in erlang", "I'm new to erlang, I'm looking at some of the documentation on starting a supervisor http://erlang.org/doc/man/supervisor.html#start_link-3\n\nThe start_link/3 function has a possible return of\n\n{local, Name :: atom()} |\n{global, Name :: atom()} |\n\n\nThe documetation says:\n\nIf SupName={local,Name}, the supervisor is registered locally as Name using register/2.\nIf SupName={global,Name}, the supervisor is registered globally as Name using global:register_name/2.\n\n\nWhat does it mean to be registered locally vs globally?" ]
[ "erlang", "otp" ]
[ "How to get overflow to work correctly in CSS grid?", "I've just started learning CSS grid and have decided to try and build the technical documentation page challenge from FCC: https://codepen.io/freeCodeCamp/full/NdrKKL\n\nIn my implementation, I can get 85% of the way but I'm struggling to get the overflow to work correctly so that both the sidebar and the content can scroll independently. I think it might be a problem with margin somewhere but can't identify where. \n\nWhen I apply:\n\n overflow: auto;\n\n\nto my content, it cuts off half of my HTML. \n\nWhere am I going wrong? \n\nhttps://codepen.io/braedongough/pen/PVYvzR" ]
[ "html", "css", "css-grid" ]
[ "how to detect Frame_Enter events from a class module", "This is a follow-on question to the one answered here:\nHow to detect a mouse_down on a Userform Frame while the mouse is still down\n\nUsing code from the answer to that question, I can successfully detect MouseDown, MouseUp and MouseMove on any frame on the form. However, there's apparently no Frame_Enter or Frame_Exit events available in the cls. Is there a way to simulate a Frame_Enter event in the class module? \n\nEdit:\nHere's what I'm trying to do. I have 8 frames loaded with 8 pictures that, when combined in a larger frame make up a larger picture. Think of a jigsaw with 8 rectangular pieces. Normally, all 8 frames hold a \"dimmed\" (neutral filter overlay) version of their picture, but when the mouse enters any of them it triggers the loading of an \"undimmed\" version of the picture in the newly entered frame, and a dimmed version of the picture in the just exited frame. So if the mouse is over any of these frames, it's always moving over a bright picture that is surrounded by dimmed pictures. \n\nAs the mouse moves around an undimmed frame, it rolls over an unlimited number of \"hotspot\" triggers that cause a textbox to pop up with more info about what the mouse is currently hovering over. When it leaves that frame and moves over another, the process repeats. \n\nEverything is working except for detecting when the mouse moves across a frame boundary and into the next frame. This has to be detected before any MouseMove events can be handled.\n\nHere's a method that looks promising, if nothing else is suggested:\nhttp://www.mrexcel.com/forum/showpost.php?p=2567141&postcount=28\n\nEdit2: It still looks promising but I can't make it work. It doesn't seem to issue the enter and exit events until after I click on the control, which is of no use to me. \n\nSo chris, back to yours. You're watching the Frame_MouseMove events and waiting for a different Frame to issue the event than last time. I'm wondering if instead of using your auxiliary textBox to signal the change, could you not use a static variable to keep track of currentFrame/prevFrame?" ]
[ "excel", "mouseenter", "userform", "vba" ]
[ ".append() method won't append php properly", "I have a navigation bar saved as menu.php.Then in my main page I created a button called\" Inject\".This is supposed to append a php include tag when clicked.\nHere is my code:\n\n$(document).ready(function(){\n $(\"#inject\").click(function(){\n $(\"body\").append(\"<?php include '../menu.php'; ?>\");\n });\n });\n\n\n<body>\n\n\n<div class=\"container\">\n <div class=\"jumbotron landing\">\n <h1 class=\"text-center\"><span class=\"text-primary\">Hex to Rgb converter V1.0 </span></h1>\n </div> \n <div id=\"inject\" class=\"btn btn-danger\">Inject</div>\n <h1>Enter hex code without <kbd>#</kbd> and press <kbd>Enter</kbd></h1>\n <kbd class=\"h3\">#</kbd><span class=\"h4 bg-primary\">+</span><input type=\"text\" maxlength=\"6\" id=\"hex\" class=\"text-warning bg-info h3 img-rounded\" pattern=\"[A-Fa-f]{6}\" title=\"Type a hex code please\">\n <h1>Rgb</h1>\n <p id=\"rgb\" class=\"h4 text-primary bg-success\"></p>\n</div>\n</body>\n\n\nThe problem That i get on js console(chromium) is\"Uncaught SyntaxError: Unexpected identifier\"\nThe php include tag will work fine when it is not inserted by javascript.\nAny ideas?" ]
[ "javascript", "php", "jquery", "twitter-bootstrap", "localhost" ]
[ "Missing sequence or table: hibernate_sequence", "I am new to hibernate and postgres. Actually I am trying to map potgres database using Hibernate. This is my table stucture in postgresql\n\nCREATE TABLE employee\n(\nid serial NOT NULL,\nfirstname character varying(20),\nlastname character varying(20),\nbirth_date date,\ncell_phone character varying(15),\nCONSTRAINT employee_pkey PRIMARY KEY (id )\n)\n\n\nI am trying to add a record to the database using the following code\n\n System.out.println(\"******* WRITE *******\");\n Employee empl = new Employee(\"Jack\", \"Bauer\", new Date(System.currentTimeMillis()), \"911\");\n empl = save(empl);\n\n\n\n //This is the save function\n\n private static Employee save(Employee employee) {\n SessionFactory sf = HibernateUtil.getSessionFactory();\n Session session = sf.openSession();\n\n session.beginTransaction();\n\n\n int id = (Integer) session.save(employee);\n employee.setId(id);\n\n session.getTransaction().commit();\n\n session.close();\n\n return employee;\n}\n\n\nWhen I execute the code I am getting the following error\n\norg.hibernate.HibernateException: Missing sequence or table: hibernate_sequence\nException in thread \"main\" java.lang.ExceptionInInitializerError\nat org.tcs.com.Hibernate.HibernateUtil.buildSessionFactory(HibernateUtil.java:18)\nat org.tcs.com.Hibernate.HibernateUtil.<clinit>(HibernateUtil.java:8)\nat org.tcs.com.Hibernate.MainApp.list(MainApp.java:51)\nat org.tcs.com.Hibernate.MainApp.main(MainApp.java:17)\nCaused by: org.hibernate.HibernateException: Missing sequence or table: hibernate_sequence\nat org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1282)\nat org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)\nat org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:498)\nat org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1740)\nat org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1778)\nat org.tcs.com.Hibernate.HibernateUtil.buildSessionFactory(HibernateUtil.java:15)\n... 3 more\n\n\nI have the sequence called \"employee_id_seq\" in my database. But I dont know why the database is looking for hibernate_seq. Could someone explain the error and the reason.\n\nThanks in advance!\n\nAdded info\n\nThis is my employee class\n\nimport java.sql.Date;\n\npublic class Employee {\n\nprivate int id;\n\nprivate String firstname;\n\nprivate String lastname;\n\nprivate Date birthDate;\n\nprivate String cellphone;\n\npublic Employee() {\n\n}\n\npublic Employee(String firstname, String lastname, Date birthdate, String phone) {\n this.firstname = firstname;\n this.lastname = lastname;\n this.birthDate = birthdate;\n this.cellphone = phone;\n\n}\n\npublic int getId() {\n return id;\n}\n\npublic void setId(int id) {\n this.id = id;\n}\n\npublic String getFirstname() {\n return firstname;\n}\n\npublic void setFirstname(String firstname) {\n this.firstname = firstname;\n}\n\npublic String getLastname() {\n return lastname;\n}\n\npublic void setLastname(String lastname) {\n this.lastname = lastname;\n}\n\npublic Date getBirthDate() {\n return birthDate;\n}\n\npublic void setBirthDate(Date birthDate) {\n this.birthDate = birthDate;\n}\n\npublic String getCellphone() {\n return cellphone;\n}\n\npublic void setCellphone(String cellphone) {\n this.cellphone = cellphone;\n}\n\n\n\n}" ]
[ "java", "hibernate", "postgresql" ]
[ "Rich Snippets : Microdata itemprop out of the itemtype?", "I've recently decided to update a website by adding rich snippets - microdata.\nThe thing is I'm a newbie to this kind of things and I'm having a small question about this.\n\nI'm trying to define the Organization as you can see from the code below:\n\n<div class=\"block-content\" itemscope itemtype=\"http://schema.org/Organization\">\n<p itemprop=\"name\">SOME ORGANIZATION</p>\n<p itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\">\n<span itemprop=\"streetAddress\">Manufacture Street no 4</span>, \n<span itemprop=\"PostalCode\">4556210</span><br />\n<span itemprop=\"addressLocality\">CityVille</span>, \n<span itemprop=\"addressCountry\">SnippetsLand</span></p>\n<hr>\n<p itemprop=\"telephone\">0444 330 226</p>\n<hr>\n<p><a href=\"mailto:info@snippets.com\" itemprop=\"email\">info@snippets.com</a></p>\n</div>\n\n\nNow, my problems consists in the following: I'd like to also tag the LOGO in order to make a complete Organization profile, but the logo stands in the header of my page, and the div I've posted above stands in the footer and the style/layout of the page doesnt permit me to add the logo in here and also make it visible.\n\nSo, how can I solve this thing? What's the best solution?\n\nThanks." ]
[ "microdata", "rich-snippets" ]
[ "WPF Snapshot of visible area ScrollViewer", "I know how to make a snapshot in WPF.\n\ndraggableObject = new Image();\n\nAssociatedObjectParent.Children.Add(draggableObject);\n\nGrid panel = AssociatedObject as Grid;\n\ndraggableObject.Height = panel.ActualHeight;\ndraggableObject.Width = panel.ActualWidth;\n\nDrawingVisual dv = new DrawingVisual();\n\nusing (DrawingContext dc = dv.RenderOpen())\n{\n VisualBrush vb = new VisualBrush(AssociatedObject);\n\n dc.DrawRectangle(vb, null, new Rect(new Point(0,0), new Size(draggableObject.Width, draggableObject.Height)));\n}\n\ndouble x = draggableObject.Width;\ndouble y = draggableObject.Height;\n\nRenderTargetBitmap renderTargetTd = new RenderTargetBitmap((int)x, (int)y, 96, 96, PixelFormats.Default);\n\nRenderOptions.SetBitmapScalingMode(renderTargetTd, BitmapScalingMode.Fant);\nRenderOptions.SetEdgeMode(renderTargetTd, EdgeMode.Aliased);\n\nrenderTargetTd.Render(dv);\n\n\nBut now I have this ScrollViewer that is 600px wide and Content with 1000px.\nWhen I use this code and my horizontalOffset is 0 (so I haven't scrolled at all), then all is well and I get an image of the ScrollViewer-Control just fine.\n\nHowever when I scroll my ScrollView and make a snapshot just the same way. The snapshot is all messed up.\n\nHow can I make a snapshot of the visible '400 to 1000' area of the scrollview content like I can with the '0 to 600' area of the scrollview?" ]
[ "c#", "wpf", "scrollviewer", "snapshot", "rendertargetbitmap" ]
[ "I dont understand why my variable is NULL", "First of all, sorry my english isnt so good. So i have a problem, when i display my variable, he return me NULL and i dont know why :( \n\nLabel.php\n\nclass Services_Label extends Services_Abstract\n{\n public function getlibelle()\n {\n $sRequest = 'SELECT NAME FROM menu WHERE id_application = 2';\n $this->executeQueries($sRequest);\n $aResult = $this->getAllRows();\n $this->freeStatement();\n return $aResult;\n }\n}\n\n\nIndexController.php\n\npublic function indexAction()\n{\n $oMessage = new Services_Label();\n $toto = $oMessage->getlibelle();\n $this->view->newMenu12 = $toto;\n\n foreach ($toto as $data) {\n foreach($data as $key => $value) {\n echo $value[2] . '<br>';\n }\n }\n\n\nLayout.php\n\n<?php\necho $this->partial('/common/header.phtml', array(\n 'notshowlogout' => (isset($this->notshowlogout) ? true : false),\n 'profils' => $this->profils,\n 'listeHabiUti' => $this->listeHabiUti,\n 'libmenu' => $this->libmenu,\n 'userName' => $this->userName,\n 'siteName' => $this->siteName,\n 'envName' => $this->envName,\n 'newMenu12' => $this->newMenu12,\n));\n?> \n\n\nheader.php\n\n<?php var_dump($this->newMenu12); ?>\n\n\nAnswer : NULL" ]
[ "php", "mysql", "zend-framework" ]
[ "rails fb_graph notification fails because of ssl", "Trying to post a notification in fb_graph gem and rails 3.2. We have done like the docs describe at https://github.com/nov/fb_graph/wiki/notifications:\n\nuser = FbGraph::User.new('matake')\napp = FbGraph::Application.new(APP_ID, :secret => APP_SECRET)\n\napp.notify!(\n user,\n :href => 'http://matake.jp',\n :template => 'Your friend @[12345] achieved new badge!'\n)\n\n\nand alternative way:\n\nuser.notification!(\n :access_token => APP_ACCESS_TOKEN,\n :href => 'http://matake.jp',\n :template => 'Your friend @[12345] achieved new badge!'\n)\n\n\nboth returns \n SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert handshake failure\n\nIs it required a SSL conection? Is there a workaround?" ]
[ "ruby-on-rails", "fb-graph" ]
[ "Appending unique elements to elements with the same class name", "I have a situation where there are a bunch of <div> with the same class name. I need to append unique data to each one of them, but they are only defined by the class. \n\nExample:\n\n<div class='test'></div>\n<div class='test'></div>\n<div class='test'></div>\n<div class='test'></div>\n\n\nIs there a way I can scroll through them and append unique data to them using JQuery's append?" ]
[ "javascript", "jquery" ]
[ "R `sprintf` with HTML tags gives `arguments cannot be recycled to the same length`", "I have a data.frame res with 2 rows and I want to put the values in the sprintf function with the HTML tags. If I use tags$strong(\"some character\") function I get an error. If I type <strong>some character</strong> it works. If I have 3 rows in the df both codes work. Here's a MWE with 2 row data.frame:\n\nres <- data.frame(term = letters[1:2], p.value = c(0.567, 0.123), hazard = c(1.234, 3.421))\nsprintf(\n \"%s: %s %.3f %s %.3f</br>\",\n res$term,\n tags$strong(\"p-value: \"),\n res$p.value,\n tags$strong(\"Hazard Ratio: \"),\n res$hazard\n)\n# Error in sprintf(\"%s: %s %.3f %s %.3f</br>\", res$term, tags$strong(\"p-value: \"), : \n# arguments cannot be recycled to the same length\nsprintf(\n \"%s: %s %.3f %s %.3f</br>\",\n res$term,\n \"<strong>p-value: </strong>\",\n res$p.value,\n \"<strong>Hazard Ratio: </strong>\",\n res$hazard\n)\n# works!\n# [1] \"a: <strong>p-value: </strong> 0.567 <strong>Hazard Ratio: </strong> 1.234</br>\" \n# [2] \"b: <strong>p-value: </strong> 0.123 <strong>Hazard Ratio: </strong> 3.421</br>\"\n\n\nThree row data.frame:\n\nres <- data.frame(term = letters[1:3], p.value = c(0.567, 0.123, 0.231), hazard = c(1.234, 3.421, 5.211))\n\nsprintf(\n \"%s: %s %.3f %s %.3f</br>\",\n res$term,\n tags$strong(\"p-value: \"),\n res$p.value,\n tags$strong(\"Hazard Ratio: \"),\n res$hazard\n)\n\nsprintf(\n \"%s: %s %.3f %s %.3f</br>\",\n res$term,\n \"<strong>p-value: </strong>\",\n res$p.value,\n \"<strong>Hazard Ratio: </strong>\",\n res$hazard\n)\n\n\nThe questions are:\n\n\nWhy it doesn't work when I have 2 rows in df and it works with 3 rows?\nWhy in the two row df it doesn't work with the tags$strong function?" ]
[ "html", "r", "shiny", "printf" ]
[ "Update removable drive list after program launch", "I am making a program in C# and I got a lot of tips from this site. But now I am facing a problem I can't solve.\n\nI want the program to download a file from the internet to an USB device. This USB device must be selected in a Combobox. The code I used for this is:\n\nvar drives = from drive in DriveInfo.GetDrives() //search removable drives\n where drive.DriveType == DriveType.Removable\n select drive;\n\ndropdowndrive.DataSource = drives.ToList(); //add removable drives to combobox\n\n\nIt works but only when I insert the USB drive before booting the program. How can I show a removable device which has been inserted after booting the program?" ]
[ "c#", "filesystems", "usb-drive" ]
[ "insert or update using if exists using merge oracle sql logic", "i am fetching the data from transaction system back end oracle db and which is my source and target is also a same table one to one \n\ni need to write a merge statement for checking insert or update based on new values \n\nSource Transaction table \n\ncreate table product \n(\nproduct_id pk VARCHAR2(3 BYTE),\nproduct_nm VARCHAR2(100 CHAR),\nproduct_cd VARCHAR2(10 CHAR),\nproduct_dec VARCHAR2(500 CHAR),\ninsert_ts date,\nupdate_ts date,\nversion NUMBER(38,0),\nproduct_interval_strt NUMBER(38,0),- these are some numeric values\nproduct_interval_end NUMBER(38,0) - these are some numeric values\n)\n\n\nsince the etl (PDI) throwing error\n\nUnable to get value 'Integer(38)' from database resultset, index 11 Numeric Overflow \n\nso i have used the below so that PDI reads it as Bignumber 37\n\nCAST (product_interval_strt AS number(37,0)) INTERVAL_START ,\nCAST (product_interval_strt AS number(37,0)) product_interval_end\n\nTarget Transaction table \n\ncreate table product_stg \n(\nproduct_id pk VARCHAR2(3 BYTE),\nproduct_nm VARCHAR2(100 CHAR),\nproduct_cd VARCHAR2(10 CHAR),\nproduct_dec VARCHAR2(500 CHAR),\ninsert_ts date,\nupdate_ts date,\nversion NUMBER(38,0),\nproduct_interval_strt NUMBER(38,0),- these are some numeric values\nproduct_interval_end NUMBER(38,0) - these are some numeric values\n)\n\n\nso i have used the below so that PDI reads it as Bignumber 37\n\nCAST (product_interval_strt AS number(37,0)) INTERVAL_START ,\nCAST (product_interval_strt AS number(37,0)) product_interval_end\n\n\nso i need to prepare a merge sql statement to check if product_id exists do update doesn't exist do insert ,but i was not sure i only have to use the below\n\ni need to prepare a simple merge statement if value exists update or insert \n\ncorrect me if the below skeleton/structure is correct \n\nmerge into MY_TABLE tgt\nusing (select [expressions]\n from dual ) src\n on (src.key_condition = tgt.key_condition)\nwhen matched then \n update tgt\n set tgt.column1 = src.column1 [,...]\nwhen not matched then \n insert into tgt\n ([list of columns])\n values\n (src.column1 [,...]);" ]
[ "sql", "oracle", "merge" ]
[ "Lua script to C++ code", "I am writing C functions for Lua.\nI have many calls like lua_gettable, lua_touserdata, etc\n\nMy C function may receive complex structures like table with tables as fields.\n\nIt is hard for me to program stacked machine.\n\nIs there way to write Lua script that would be converted to C code.\n\nOr some other tools that may help me to code such C functions for lua scripts.\n\nThanks.\n\nPS\n\nHere is example:-\n\nlocal data = {}\ndata.x = {}\ndata.x.y = 1\nmyCfunc(data)\n\n\n\n\nint myCfunc(lua_State * L){\n lua_pushstring(L, \"x\");\n lua_gettable(L, 2);\n lua_pushstring(L, \"y\");\n lua_gettable(L, -2);\n double y = lua_tonumber(L, -1);\n lua_pop(L, 2);\n}\n\n\ninstead of \n\nfunction myCfunc(data)\n y = data.x.y\nend\n\n\nMy real code is much more complex and I am looking for some \nautomated code generation that will help me." ]
[ "c", "lua", "stack" ]
[ "find closest div element, logical part. JavaScript", "I am trying to find closest (to current pageYOffset) div element, but i have a problem with logic.\nCan you help me to wright working algorithm?\n\nMy code is:\n\nvar closestDiv = window.pageYOffset - arrayOfSceneDivs[0].offsetTop;\nvar closestDivIndex = 0;\nfor (var a = 0; a < arrayOfSceneDivs.length; a++) {\n if (((window.pageYOffset - arrayOfSceneDivs[a].offsetTop) - closestDiv) < 10 ) {\n closestDiv = window.pageYOffset - arrayOfSceneDivs[a].offsetTop;\n closestDivIndex = a;\n }\n}\nif (closestDivIndex != 0) {\n i = closestDivIndex;\n console.log(arrayOfSceneDivs);\n console.log(i);\n window.scrollTo(0, arrayOfSceneDivs[i].offsetTop);\n}\n\n\nThanks a lot!" ]
[ "javascript", "logic" ]
[ "Excel Customize Workbook with xml", "I'm trying to customize my workbook editing an xml file (CustomUi folders). I'm able to hide all menu, customize ribbon etc. Now I would like to hide \"Help\" button, Minimize, Restore and Close one on the top right of workbook. I tried:\n\n<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\"> \n <button idMso=\"Help\" visible=\"false\"/> \n <button idMso=\"WindowMinimize\" visible=\"false\"/> \n <button idMso=\"WindowRestore\" visible=\"false\"/> \n <button idMso=\"WindowClose\" visible=\"false\"/> \n</customUI>\n\n\nBut it doesn't work.\nCan anyone help me?" ]
[ "xml", "vba", "excel" ]
[ "angular ng-class javascript conditions on modal string", "Am trying to apply style class to based on the modal value.\n\nI am trying to add glyphicons icons based the value in the modal. But I struggle to get that work. Below is the code I use.\n\n<span ng-class=\"{glyphicon:'true','glyphicon-search':(menu.name.indexOf('search')!=-1),'glyphicon-home':(menu.name.indexOf('home')!=-1)}\"></span>{{menu.name}}</a>\n\n\nLet me know what is the issue, or should I not use the index of mehtod in the angular expressions" ]
[ "javascript", "angularjs", "twitter-bootstrap", "ng-class" ]
[ "How can I prevent XAML VisualStates from interfering with Windows UI Composition animation?", "I believe the Windows.UI.Composition tools are conflicting with the XAML VisualStates on buttons.\nGIF #1 When a button is in its Normal state, without the cursor hovering, the animations work and the buttons disappear successfully on scrolling down and then reappear successfully on scrolling up.\nGIF #2 If the cursor is hovering over a button when the composition animation completes, and the mouse exits the button before scrolling up, I believe the PointerOver state gets frozen and the opacity of 0% gets stuck. The only way to fix it is to hover again to unjam the XAML VisualStates.\n\n\nThe buttons are all in the same StackPanel, which is the target of the opacity animation. When one button has this problem, the whole StackPanel gets stuck at 0% opacity. The code below is the general gist, some pieces omitted for brevity. I do not think this is a code issue, I think it is a platform limitation and I am looking for a workaround.\nCompositionPropertySet _scrollerPropertySet = \nElementCompositionPreview.GetScrollViewerManipulationPropertySet((ScrollViewer)sender);\nCompositor _compositor = _scrollerPropertySet.Compositor;\nCompositionPropertySet _props = _compositor.CreatePropertySet();\n_props.InsertScalar("progress", 0);\nvar scrollingProperties = \n_scrollerPropertySet.GetSpecializedReference<ManipulationPropertySetReferenceNode>();\nvar props = _props.GetReference();\nvar progressNode = props.GetScalarProperty("progress");\nExpressionNode progressAnimation = EF.Clamp(-scrollingProperties.Translation.Y / clampSizeNode, 0, 1);\n_props.StartAnimation("progress", progressAnimation);\n\n// StackPanel relevant code:\n\nVisual carOperationButtonStackPanelVisual= \nElementCompositionPreview.GetElementVisual(CarOperationStackPanel);\nExpressionNode carSubtitleObjectOpacityAnimation = 1 - (progressNode * 2);\ncarOperationButtonStackPanelVisual.StartAnimation("Opacity", carSubtitleObjectOpacityAnimation);" ]
[ "uwp", "composition", "winui" ]
[ "Converting a CImg data struct to .Net bitmap class", "I have a C/C++ dll that I use to generate some informations, and, a image from this informations, now, I need to use this dll in C#.\nI have implemented a exported function that write all the CIMg::data into a pre-allocated buffer.\nSo, I tried to convert this pre-allocated buffer into a Bitmap in C#, but, the image has been generated with just some wrong lines...\nAfter this, I tried to implement an alternative version of this functions, that write into a pre-allocated buffer, all the RGB from the image, but, when the system write the image, the image is mirrored.\n\nThis is my function to save all the RGB:\n\nstd::vector<unsigned char> SystemImage::getData()\n{\n if(!_generatedImage)\n this->createImage();\n\n std::vector<unsigned char> data;\n\n unsigned char red, blue, green;\n for (int x = 0; x < _baseImage->width(); x++)\n {\n for (int y = 0; y < _baseImage->height(); y++)\n {\n red = (*_baseImage)(y, x, 0, 0);\n green = (*_baseImage)(y, x, 0, 1);\n blue = (*_baseImage)(y, x, 0, 2);\n\n data.push_back(red);\n data.push_back(green);\n data.push_back(blue);\n }\n }\n\n return data;\n} \n\n\nMy C# function to handle this information:\n\n public Bitmap CreateImage()\n {\n const uint bufferSize = 6113880;\n byte[] data = new byte[bufferSize];\n\n Bridge.System_Bridge.getRGBData(PSystem, data, bufferSize);\n\n int position = 0;\n Bitmap bmp = new Bitmap(1332, 1530);\n for (int x = 0; x < 1332; x++)\n for (int y = 0; y < 1530; y++)\n {\n bmp.SetPixel(x, y, Color.FromArgb(data[position], data[position + 1], data[position + 2]));\n position += 3;\n }\n\n data = null;\n\n return bmp;\n }\n\n\nThere is a more better way to make this ?\nHow I can use the CIMg::Data to make the bitmap ? ( This will reduce a lot of allocated memory!! )" ]
[ "c#", "c++", "cimg" ]
[ "Is the lifetime of a C++ temporary object created in ?: expression extended by binding it to a local const reference?", "It is not clear to me whether the lifetime of a temporary object would be extended by binding it to a const reference in a ?: expression:\n\nclass Foo {...};\n\nFoo *someLValue = ...;\n\nconst Foo& = someLValue ? *someLValue : Foo();\n\n\nIs the lifetime of the temporary created by calling the default constructor Foo() extended by binding it to the local const ref even though the binding is conditional? Or does this create a dangling reference because the temporary value of Foo() would be destroyed at the end of the ?: expression?" ]
[ "c++", "reference", "temporary-objects", "const-reference" ]
[ "NHibernate 2.* mapping files: how to define nullable DateTime type (DateTime?)?", "I know one of the breaking changes with NHibernate 2.* is that the NHibernate.Nullables are no longer supported. Therefore, what do you use in your mapping file to map the nullable DateTime? type? For i.e.:\n\nUnderstandably doesn't work:\n\n<property name=\"CreateDate\" column=\"CreateDate\" type=\"DateTime?\" not-null=\"false\" />\n\n\nAnd no longer supported: \n\n<property name=\"ModifiedDate\" column=\"ModifiedDate\" type=\"Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate\" not-null=\"false\"/>\n\n\nI know it must be so obvious, but I'm not finding it!\n\nAnswer is as simple as:\nNHibernate will reflect over the class in question and discover that the property's reflected type is DateTime? all on its own.\n\nThanks @Justice!" ]
[ "nhibernate", "datetime", "nhibernate-mapping", "nullable" ]
[ "Validate check digit 11 (mod 11) using PHP", "How to validate NHS number using check digit 11 (mod 11) using PHP.\n\nAfter a long search on the internet trying to find a function that I can use to validate check digit 11 (mod 11) number, I couldn't find so I end up developing one myself and share it here. I hope someone my find it useful." ]
[ "php", "modulus", "check-digit" ]
[ "Azure API Management vs Logic Apps", "New to Azure and would like to know what the difference between Azure API Management and Logic Apps is.\n\nSome pros and cons would be nice. Also what the costing for each of these is like.\n\nThanks" ]
[ "azure", "azure-logic-apps", "azure-management-api" ]
[ "Showing long strings in wxpython Combobox dropdown", "In a wxpython Combobox, long strings get left-truncated in the dropdown portion. This can result in some values looking identical when they aren't. I'd like to provide better information to the user than that.\n\nThe following options occur to me:\n\n\nInsert elipses in the middle of the string before adding it to the combobox's dropdown choices and expanding it back before placing back in the edit portion. \nShow a tooltip of the full string when the user mouses/hovers over a value in the dropdown.\n\n\nProblem is, the Combobox class does not expose events that enable either of the above. \n\nHow can I intercept the events corresponding to either of the above? Any other ideas for making long combobox strings visible to the user?\n\nThanks,\nRichK" ]
[ "combobox", "wxpython" ]
[ "Deferred evaluation of bash variables", "I need to define a string (options) which contains a variable (group) that is going to be available later in the script.\n\nThis is what I came up with, using a literal string that gets evaluated later.\n\n#!/bin/bash\n\noptions='--group=\"$group\"' #$group is not available at this point\n\n#\n# Some code...\n#\n\ngroup='trekkie'\neval echo \"$options\" # the result is used elsewhere\n\n\nIt works, however it makes use of eval which I would like to avoid if not absolutely necessary (I don't want to risk potential problems because of unpredictable data).\n\nI've asked for help in multiple places and I've got a couple of answers that were directing me to use indirect variables.\n\nThe problem is I simply fail to see how indirect variables might help me with my problem. As far as I understand they only offer a way of indirectly referencing other variables like this:\n\noptions=\"--group=\"$group\"\"\na=options\ngroup='trekkies'\necho \"${!a}\" # spits out --group=\n\n\nI would also like to avoid using functions if possible because I don't want to make things more complicated than they need to be." ]
[ "bash" ]
[ "Define Symfony 2 tag attribute as an array in XML configuration?", "<service id=\"my_service\">\n <tag name=\"my_transport\" supports=\"feature1, feature2, feature3\" />\n</service>\n\n\nWould be possible to define supports attribute as array when dealing with XML configuration, instead of doing a preg_split?" ]
[ "xml", "symfony", "configuration", "symfony-2.1" ]
[ "Split API into micro-services", "I've have one question about architecture.\n\nWe have api for mobile backed. And now we implementing some new features, like user messaging. \nFor no api uses one database, and I want to have separate api and database for messages. Like micro-services. api.somedomain.com, messages.somedomain.com, etc. \n\nMain api is guarded by implementing access via access keys. And in micro-services databases I need some data from main database, like user info, profile info, etc. \n\nMaybe someone have ideas how to implement such mechanism? \n\nMaybe master-slave replication with slave = database where I need information from main database?" ]
[ "php", "web-services", "api", "symfony" ]
[ "strtok() behavior is different across compilers", "I wrote a program which parses a string according to this format: \n\nsomethingsomething:number:\n\n\nOn my computer, this program works flawlessly.\nHowever, once I have uploaded the code and compiled it on the school's computer, strtok() has a different behavior.\n\nFor instance, with this string: p2test/f4.txt:1:, on my computer the first token would be p2test/f4.txt. However, on the school's computer, the token ends up as p2test/f4.t.\n\nHere is the code segment:\n\n char *token;\n char delim[1] = \":\";\n\n if ((token = strtok(tmp_string, delim)) != NULL) {\n ...\n }\n\n\nHere, tmp_string would be p2test/f4.txt:1:. \n\nHere is my computer's compiler version: gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6) \n\nHere is my school's compiler version: gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux)" ]
[ "c", "strtok" ]
[ "Reading and writing to the same file from two different scripts at the same time", "I have some simple question about reading and writting files using Python.\nI want to read (just reading without writting) the same file from one script and read+write from other script.\n\nScript_1 - Only reading:\n\nwith open(\"log.txt\", \"r\") as f:\n content = f.read()\n\n\nScript_2 - Read and write:\n\nwith open(\"log.txt\", \"a+\") as f:\n content = f.read()\n f.write(\"This is new line,\")\n\n\nAnd my question is - Is this ok? \n\nWill I get some errors or sth when scripts try to access to the same file at exactly the same time? \n(yeah it's hard to test this ^^)\n\nI mean I was reading some posts about this and I'm not sure now." ]
[ "python", "file" ]
[ "Make all div clickable and open link in a blank", "I am tring to make a entire div clickable and to open the link in a blank page:\n\nHTML code:\n\n<div class=\"article-content\">\n <div>\n <p></p>\n </div>\n <div>\n <p></p>\n </div>\n <div><a href=\"http://www.google.ro\" target=\"_blank\">Click me</div>\n\n</div>\n\n\nJS:\n\n$(\".article-content\").click(function () {\n window.location = $(this).find(\"a\").attr(\"href\");\n return false;\n});\n\n\nBut every the link is opened in the same windows.\n\nhave any ideea how to fix this ?" ]
[ "jquery", "html" ]
[ "MSSQL CONCAT query throws Error", "I'm tried to execute the below query in MSSQL 2008 R2,but its throwing error.\nTHE QUERY IS:\n\n SELECT (n_artifactType+(' '+ n_actionPerformed)) AS actionperformed, \n COUNT(n_actionPerformed) total FROM notifications WHERE n_project='JupiterQA'\n GROUP BY actionperformed order by n_actionPerformed;\n\n\nERROR IS:\n\nMsg 207, Level 16, State 1, Line 1\nInvalid column name 'actionperformed'.\n\n\nUsing 'actionperformed' as alias name even though its throwing error.\nHow can I execute above query without error." ]
[ "mysql", "sql-server", "mssql-jdbc" ]
[ "Creating a description using phpdocumentor", "I can't figure out how to make a description for my script. On the official website and in the tutorials, they write blocks like this:\n/**\n * This is the summary for a DocBlock.\n *\n * This is the description for a DocBlock. This text may contain\n * multiple lines and even some _markdown_.\n */\n\nI use it for my script:\n<?php\n\n/**\n * Small Descripton.\n *\n * Large description to my script\n */\n\nrequire_once("path2file.php");\n\necho "start report\\n";\n\nfunction myFunc() {\n // ...\n}\n\nThis does not work\nphpDocumentor -f doc_b_test2.php -t doc2\noutput:\nenter image description here\nNo description at this picture.\nI managed to create a description for a function or class, but I want to get a description for the script. What am I doing wrong? Maybe this is impossible?" ]
[ "php", "phpdoc" ]
[ "Pyspark Runtime Error Dictionary Changed size during iteration", "I am trying to map a cef file to a data frame and ultimately to an output file. I'm getting RuntimeError: dictionary changed size during iteration.\n\nI've tried these solutions: 1, 2, 3, 4, etc. I'm not even sure where this dictionary is (in the lambda?) that the error is referring to. I do not believe this is a duplicate of the others as I am not explicitly using a dictionary anywhere in the code, so calling .keys() or .items() is not an option\n\nI created a simple text file with the cef access and security events example: \n\nI then ran the code below:\n\nimport pyspark\nfrom pyspark.sql import SparkSession\nfrom pyspark.streaming import StreamingContext\nsc = SparkContext('local[2]','NetworkLog')\nspark = SparkSession(sc)\ntarget_data = sc.textFile('log.txt')\n\nimport re\ndef parse(str_input):\n ...\n return values\n\nparsed = target_data.map(lambda line:parse(line))\ndf = parsed.map(lambda x: (x['rt'],x['dst'],x['dhost'],x['act'],x['suser'],x['requestClientApplication'],x['threat name'],x['DeviceSeverity'],x['riskscore'])).toDF(['source_time','ip','host_name','act','suser','requestClientApplication','threatname','DeviceSeverity','riskscore'])\n\n\n*parser found here\n\nThis may be a separate question, but sometimes the code breaks when values in parsed are missing/null/0.0.0, so I'd also need a way to write null or 0.0.0 to the dataframe." ]
[ "apache-spark", "lambda", "pyspark", "apache-spark-sql", "spark-streaming" ]
[ "How to reuse non Widget classes in Flutter?", "I know we are supposed to use composition over inheritance in Flutter. And that works great when we are talking about Widgets.\n\nBut what am I supposed to do when a class is not a Widget?\nFor example, I want my TextFields in some screens to have a specific set of values in their InputDecoration.\n\nShould I extend InputDecoration? How can I reuse this specific InputDecoration in many TextFields?\n\nEDIT:\nFollowing Rémi Rousselet's guidance, I extended InputDecoration. Here's the final result: \n\n\nclass LoginInputDecoration extends InputDecoration {\n @override\n InputBorder get errorBorder =>\n UnderlineInputBorder(borderSide: BorderSide(color: AppColors.danger));\n\n @override\n EdgeInsetsGeometry get contentPadding => const EdgeInsets.symmetric(\n horizontal: Dimens.halfSpace,\n vertical: Dimens.singleSpace,\n );\n\n @override\n InputBorder get border =>\n UnderlineInputBorder(borderSide: BorderSide(color: AppColors.primary));\n\n @override\n TextStyle get labelStyle =>\n TextStyle(color: AppColors.white, decorationColor: AppColors.white);\n\n @override\n InputBorder get enabledBorder =>\n UnderlineInputBorder(borderSide: BorderSide(color: AppColors.primary));\n\n @override\n TextStyle get hintStyle =>\n TextStyle(color: AppColors.white, decorationColor: AppColors.white);\n\n LoginInputDecoration({String labelText}) : super(labelText: labelText);\n}" ]
[ "inheritance", "flutter", "dart" ]
[ "Keep getting Could not read CA certificate when trying to start docker", "I am attempting to migrate from boot2docker to docker-machine.\n\nI followed the directions here to install docker but I keep getting the following message:\n\nCould not read CA certificate \"/Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem\": open /Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory\n\n\nwhen I run most any docker command." ]
[ "macos", "docker", "boot2docker", "pem" ]
[ "does removing all non-numeric characters effectively escape data?", "I use this function to strip all non-numeric from a field before writing to a MYSQL dB:\n\nfunction remove_non_numeric($inputtext) {return preg_replace(\"/[^0-9]/\",\"\",$inputtext);\n\n\nDoes this effectively escape the input data to prevent SQL Injection? I could wrap this function in mysql_real_escape_string, but thought that might be redundant." ]
[ "sql", "sql-injection", "mysql-real-escape-string" ]
[ "“You must pass in a non null View” when getting profile picture from firebase", "The app give me an error when i tried to load uploaded image into the nav header in my Homepage.\n\nerror: \n\nFATAL EXCEPTION: main Process: com.example.cqaai.tutorpal, PID: 23741 java.lang.IllegalArgumentException: You must pass in a non null View\nat com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:685)\nat com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:457)\nat com.example.cqaai.tutorpal.activity.HomeActivity$3.onDataChange(HomeActivity.java:199)\nat com.google.android.gms.internal.zzbmz.zza(Unknown Source)\nat com.google.android.gms.internal.zzbnz.zzYj(Unknown Source)\nat com.google.android.gms.internal.zzboc$1.run(Unknown Source)\nat android.os.Handler.handleCallback(Handler.java:751) \nat android.os.Handler.dispatchMessage(Handler.java:95) \nat android.os.Looper.loop(Looper.java:159) \nat android.app.ActivityThread.main(ActivityThread.java:6097) \nat java.lang.reflect.Method.invoke(Native Method) \nat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) \nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)\n\n\nthe last if statement is the cause of the error:\n\nprivate void getUserInfo() {\n mTuteeDatabase.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(dataSnapshot.exists() && dataSnapshot.getChildrenCount()>0){\n Map<String, Object> map = (Map<String, Object>) dataSnapshot.getValue();\n\n if(map.get(\"FullName\")!=null){\n mFullName = map.get(\"FullName\").toString();\n txtFullName.setText(mFullName);\n }\n\n if(map.get(\"UserName\")!=null) {\n mUserName = map.get(\"UserName\").toString();\n txtUserName.setText(\"@\" + mUserName);\n }\n\n if(map.get(\"profileImageUrl\")!=null){\n mProfileImageUrl = map.get(\"profileImageUrl\").toString();\n Glide.with(getApplication()).load(mProfileImageUrl).into(mProfileImage);\n }\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n}\n\n\nI added additional links in gist.github just incase. which contains the related xml and database structure. Forgive me if I ask question in the wrong way..\n\ncomplete codings: HomeActivity.java, activity_home, etc here" ]
[ "android", "firebase-realtime-database", "android-glide" ]