texts
list
tags
list
[ "How to download multiple PDFs with curl in Terminal.app", "In terminal.app I entered this line\n\ncurl -o http://print.nap.edu/pdf/0309065577/pdf_image/[1-319].pdf\n\nAnd it in Terminal it says:\n\ncurl: no URL specified!\n\nHow is this possible? I'm just trying to download a bunch of successively numbered PDF files from a web server. If I leave off the -o it just downloads a bunch of gibberish into the Terminal window but not as a file. Am I doing anything wrong here?" ]
[ "curl", "terminal" ]
[ "Setting href target dynamically for fancybox?", "Ok, I have used fancybox already with some success, but I was wondering if I could pass a value for the href? I've kinda put a clunky solution together, but the box tells me \" The requested content cannot be loaded.\nPlease try again later.\"\nWhat I've done is created a separate function to trigger the launch of the fancybox....\n\nFirst here's the html of the iframe/fancybox element (which as a tiny button the user cannot see):\n\nHere's my code:\n\n<a id=\"link2\" href=\"ContentPage.aspx\"><input id=\"Btn1\" type=\"button\" value=\"GetContent\" class=\"smallBtnCls\" /></a>\n\n\n..and the javascript:\n\nfunction launchCont(rid){\n var lnk = 'ContentPage.aspx ?act=Add&id=' + rid;\n $('#link2').attr('href',lnk);\n\n //alert($('#link2').attr('href'));\n $(\"#Btn1\").fancybox().trigger('click');\n } \n\n\nand the fancy box config is:\n\n $(\"#Btn1\").click(function() {\n $(\"#link2\").fancybox({\n 'width': '55%',\n 'height': '45%',\n 'autoScale': false,\n 'modal': true,\n 'transitionIn': 'elastic',\n 'transitionOut': 'elastic',\n 'type': 'iframe',\n onStart: function() {\n //return window.confirm('Continue?');\n $.fancybox.showActivity();\n },\n onCancel: function() {\n //alert('Canceled!');\n },\n onComplete: function() {\n //alert('Completed!');\n $.fancybox.hideActivity();\n },\n onCleanup: function() {\n //return window.confirm('Close?');\n },\n onClosed: function() {\n //alert('Closed!'); \n }\n });\n\n\n});\n\n\nAny Ideas???? Or am I looking at it the wrong way?" ]
[ "jquery", "fancybox" ]
[ "Find inside a seq of Tuple", "I have seq of Tuple of type (x: int, y:bool) and I want to find the min x of the items who has y=isMin in valList if isMin is true.\n\nlet valList = seq{ for i =0 to 8 do yield (GetVal (i,not isMin),not isMin) } \nlet onlyMinType (x: int, y:bool) = if y==isMin then x\nlet maxVal = valList |> Seq.collect(onlyMinType) |> if isMin then Seq.min else Seq.max\nmaxVal\n\n\nI dont know what to do here\nSeq.collect(onlyMinType) and function onlyMinType" ]
[ "f#" ]
[ "How to make dataguard switchover seamlessly", "In my Dataguard configuration on a 12c environment, when I perform a switchover from primary (foo) to standby (bar) and then try to sqlplus in with user@foo, I receive the \"ORA-011033: ORACLE initialization or shutdown in progress\" error instead of being able to connect to the new primary(bar).\n\nNow, I know that this is because the connection is still pointing to the foo address instead of the bar address, and according to many articles, you need to create a new \"virtual\" service to handle the different connections, as well as a trigger to stop/start this service after a rolechange. \n\nI did this and with the service_names parameter set to this new \"virtual\" service, a switchover will work and can also switch back but when trying to sqlplus with user@foo it throws ORA-011033. The trigger is useless and the service continues to run on both foo and bar because it seems that having that parameter set overrides whatever the trigger tries to do. \n\nNow if I don't define that parameter, my switchover works fine, and the triggers do their job, and when I sqlplus user@foo, it will correctly redirect me to the bar address. However, when I try to switchover back to foo, I receive the following in the DG alert log:\n\nRedo transport problem detected: redo transport to database foo has the following error:\nORA-16047: DGID mismatch between destination setting and target database\n08/05/2016 16:01:02 \nInitialization of connection failed. \nExpected destination db_unique_name is foo.\nDatabase actually reached is bar \nFailed to send message to site foo. Error code is ORA-16642. \nData Guard Broker Status Summary:\nType Name Severity Status\n Configuration foo_dg Warning ORA-16607\n Primary Database bar Error ORA-16778\n Physical Standby Database foo Error ORA-16642 \n\nON FOO:\n\n\n log_archive_dest_2='service=\"bar\"','ASYNC NOAFFIRM delay=0 optional\n compression=disable max_failure=0 max_connections=1 reopen=300\n db_unique_name=\"bar\"\n net_timeout=30','valid_for=(online_logfile,all_roles)'\n fal_client='foo' fal_server='bar'\n\n\nON BAR:\n\n\n log_archive_dest_2='service=\"foo\", ASYNC NOAFFIRM delay=0 optional\n compression=disable max_failure=0 max_connections=1 reopen=300\n db_unique_name=\"foo\" valid_for=(online_logfile,all_roles)'\n fal_client='bar' fal_server='foo'\n\n\nEntries in LDAP:\nfoo:\n\n\n (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=foo_home)(PORT=15940))(ADDRESS=(PROTOCOL=TCP)(HOST=bar_home)(PORT=15940)))(CONNECT_DATA=(SERVICE_NAME=virtual_foo)(FAILOVER_MODE=(TYPE=SESSION)(METHOD=basic))))\n\n\nbar:\n\n\n (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=bar_home)(PORT=15940)))(CONNECT_DATA=(SERVICE_NAME=bar)))\n\n\nI'm not sure what I'm missing or misunderstanding. Can anyone shed any light as to what I might be doing wrong? Can provide more info if needed." ]
[ "oracle", "dataguard" ]
[ "get data from web page android and tostring", "See the image \n\nI want to get some data and save in string in my app\n\nMy aim web page is http://self.shahroodut.ac.ir/Ghaza.aspx?date=970229 \n\nI read some topics but did't help me\n\nfor example i want save \n\n\n جوجه كباب\n\n\nand \n\n\n شويد پلو + تن ماهي - ش\n\n\nin string1\n\nand next line in string2 . . .\n\nI had tried some topics but not helped\n\nI think this data's in \n\n\n table>tr>td>ol>li\n\n\nbut i dont know how to get them in android studio\n\n\nEdited : I want to get data from that table (link that i write in top) and save theme in strings in my app programmaticly and use theme later" ]
[ "android", "html" ]
[ "How to play the song in specific time on Android?", "I need to play the song from memory card in the specific time like 10am, 1pm and 5pm. So here my questions are, How to auto start the application? and How to play that songs in regular intervals? Anyone help me for this." ]
[ "android", "autostart" ]
[ "Kafka topic not created automatically on remote kafka after spring boot start(and create on local kafka server)", "1) I start kafka on my machine\n\n2) I start my spring boot server with config:\n\n@Bean\npublic NewTopic MyTopic() {\n return new NewTopic(\"my-topic\", 5, (short) 1);\n}\n\n@Bean\npublic ProducerFactory<String, byte[]> greetingProducerFactory() {\n Map<String, Object> configProps = new HashMap<>();\n configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, \"localhost:9092\");\n configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\n configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);\n return new DefaultKafkaProducerFactory<>(configProps);\n}\n\n@Bean\npublic KafkaTemplate<String, byte[]> unpMessageKafkaTemplate() {\n return new KafkaTemplate<>(greetingProducerFactory());\n}\n\n\nresult - server is start successfully and create my-topic in kafka.\n\nBut if I try do it with remote kafka on remote server - topic not create. \n\nand in log spring write:\n\n12:35:09.880 [ main] [INFO ] o.a.k.clients.admin.AdminClientConfig: [] AdminClientConfig values: \n bootstrap.servers = [localhost:9092]\n\n\nIf I add this bean to config:\n\n@Bean\npublic KafkaAdmin admin() {\n Map<String, Object> configs = new HashMap<>();\n configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, \"remote_host:9092\");\n return new KafkaAdmin(configs);\n}\n\n\ntopic create succesfully.\n\n1) Why it happens?\n\n2) Do I have to create KafkaAdmin ? why for the local Kafka is not required?\n\nEDDIT\n\nMy current config:\n\nspring:\n kafka:\n bootstrap-servers: remote:9092\n producer:\n key-serializer: org.apache.kafka.common.serialization.StringDeserializer\n value-serializer: org.apache.kafka.common.serialization.ByteArraySerializer\n\n\nand\n\n@Configuration\npublic class KafkaTopicConfig {\n\n @Value(\"${response.topics.topicName}\")\n private String topicName;\n\n @Bean\n public NewTopic responseTopic() {\n return new NewTopic(topicName, 5, (short) 1);\n }\n\n}\n\n\nAfter start I see:\n\nbootstrap.servers = [remote:9092]\n client.id = \n connections.max.idle.ms = 300000\n metadata.max.age.ms = 300000\n metric.reporters = []\n metrics.num.samples = 2\n metrics.recording.level = INFO\n metrics.sample.window.ms = 30000\n receive.buffer.bytes = 65536\n\n\n...\n\nBut topic not create" ]
[ "spring", "spring-boot", "apache-kafka", "spring-kafka" ]
[ "Ruby on Rails - Join two tables add results to JSON", "New to Ruby on Rails 4.0 and I am having some trouble getting my JSON to add the data from my joined table. I am using AngularJS on the front end, and I can't seem to find a good example on here to help me out.\n\nIn short, I have a Invite with a User ID. I have a User with a User ID. Knowing the Invite ID, I want to get the name of the User that corresponds to that invite.\n\nInvite 1: UserID: 10\nInvite 2: UserID: 11\nInvite 3: UserID: 12\n\nUserID: 10 Name: Owen\nUserID: 11 Name Greg\n\n\nController - Invites\n\n# GET /invites/1\n# GET /invites/1.json\ndef show\n @invite = Invite.includes(:user).find(params[:id]).to_json(include: :user)\nend\n\n\nModel - Invite\n\nclass Invite < ActiveRecord::Base\nbelongs_to :user\nhas_one :meal\nhas_one :event\nhas_one :registry\nend\n\n\nModel - User\n\nclass User < ActiveRecord::Base\n has_one :invite\nend\n\n\nHowever I only get this whenever I check the /invites/1.\n\n{\"id\":1,\"created_at\":\"2013-12-06T20:14:39.001Z\",\"updated_at\":\"2013-12-06T20:58:15.597Z\",\"event_id\":7,\"meal_id\":8,\"registry_id\":0,\"rsvp\":false,\"user_id\":9}\n\n\nAny help here is much appreciated!" ]
[ "ruby-on-rails", "ruby", "json", "ruby-on-rails-4" ]
[ "How to show bootstrap nav-tabs dropdown item as active", "In my view, I have a bootstrap nav-tab which includes a dropdown. So here I need to show the current item of the dropdown as active when the user goes to a certain dropdown item (for example, to Modifier Groups). But the existing way shows all the dropdown items as active.\n\n\r\n\r\n<ul class=\"page-title__nav common-list nav nav-tabs\" style=\"margin-bottom: -5px;width: 700px;\">\r\n <li class=\"dropdown active\">\r\n <a href=\"#\" data-toggle=\"dropdown\" class=\"dropdown-toggle\">Inventory<b class=\"caret\"></b></a>\r\n <ul class=\"dropdown-menu\" style=\"margin-left: 5px; margin-right: 5px\">\r\n <li><a data-toggle=\"tab\" onclick=\"loadCategories()\">Categories</a></li><br>\r\n <li><a data-toggle=\"tab\" onclick=\"loadItems()\">Items</a></li><br>\r\n <li><a data-toggle=\"tab\" onclick=\"loadModifierGroups()\">Modifier Groups</a></li><br>\r\n </ul>\r\n </li>\r\n <li><a data-toggle=\"tab\" onclick=\"loadTenders()\">Orders</a></li>\r\n</ul>" ]
[ "html", "twitter-bootstrap-3", "nav" ]
[ "How to insert a HTML character into this Html.ActionLink?", "I'm using the following code to generate this:\n\n<p>@Html.ActionLink(\"Read\", \"Index\", \"News\", null, new { @class = \"btn btn-default\" })</p>\n\n\n\n\nBut I want to make a button that looks like this (with the use of HTML character »):\n\n\nHowever when I do the following:\n\n<p>@Html.ActionLink(\"Read »\", \"Index\", \"News\", null, new { @class = \"btn btn-default\" })</p>\n\n\nI get this:\n\n\n\nHow do I fix this?" ]
[ "c#", "html", "css", "asp.net-mvc", "twitter-bootstrap" ]
[ "Adding property to JSON object in Javascript", "I am using xml2js to convert xml to js object and add new nodes to the content\n\nEx1:\n<abc>\n <my-node>123</my-node>\n <my-node>456</my-node>\n</abc>\n\n\nEx2:\n<abc>\n <my-node>123</my-node>\n</abc>\n\n\nIn the Ex1, the my-node property will be an array whereas in the Ex2, it will be non-array item.\n\nHow to add extra my-node to the same. I can do in below format but looking for better solution?\n\nif(typeof abc.my-node == Array){\n abc.my-node.push(xxx);\n} else {\n //create empty array\n //add existing element\n //add xxx\n //set the array to json object\n}" ]
[ "json", "xml", "node.js", "xml2js" ]
[ "Ag-grid: Count the number of rows for each filter choice", "In my ag-grid I want to display counts of rows next to each filter choice in a set filter, and maybe sort choices by that count (descending).\nThis is what it looks like by default:\n\n\n\nI want the choices to be displayed as \n\n\nSelect All (88)\nKatie Taylor (2)\nDarren Sutherland (1)\nJohn Joe Nevin (1)\nBarack Obama (0)\n...\n\n\nWhat is the most efficient way to get those counts (and maybe sort the choices accordingly) from the row data, taking into account filters already set in the other fields (if any)?" ]
[ "ag-grid" ]
[ "Android Screen Orientation", "I am using both landscape and portrait for an application. \n\nMy problem is,whenever i rotate the screen,the TTS I am using in my application automatically \n\nstarts from first.\n\nHow do I solve this problem?" ]
[ "java", "android" ]
[ "wpf ItemsControl binding problem", "I bind to a ItemsControl in my codebehind:\n\nColumnVisibilityItems.DataContext = gc.ColumnVisibility;\n\n\nwhere ColumnVisibility is a ObservableCollection, also tried it with dictionary.. \n\nmy markup\n\n <ItemsControl x:Name=\"ColumnVisibilityItems\">\n <Label Content=\"{Binding Path=Name}\" />\n </ItemsControl>\n\n\nwhile stepping through, i see the collection bound having 11 items. but ItemsControl renders only the first item in collection.\n\nIs ItemsSource property necessary to be set for this to work? because whenever i try to set that in code behind, i get the exception saying items cannot be modified because they exist already." ]
[ "wpf", "binding" ]
[ "How do I enable debug mode in Yii2?", "I have the base version. I read the article http://www.yiiframework.com/doc-2.0/yii-debug-module.html but I do not understand in which file to insert the code, which includes debugging?\n\nI searched the information and found that in config/web.php\nNow I wrote in it debug in the section YII_ENV_DEV like this:\n\nif (YII_ENV_DEV) {\n // configuration adjustments for 'dev' environment\n $config['bootstrap'][] = 'debug';\n $config['modules']['debug'] = [\n 'class' => 'yii\\debug\\Module',\n // uncomment the following to add your IP if you are not connecting from localhost.\n 'allowedIPs' => ['85.89.139.124'],\n ];\n\n $config['bootstrap'][] = 'gii';\n $config['modules']['gii'] = [\n 'class' => 'yii\\gii\\Module',\n // uncomment the following to add your IP if you are not connecting from localhost.\n //'allowedIPs' => ['127.0.0.1', '::1'],\n ];\n}\n\n\napp/web/index.php\n\n <?php\n defined('YII_DEBUG') or define('YII_DEBUG', true);\n defined('YII_ENV') or define('YII_ENV', 'dev');\n\n\nBut it does not work and I see just a 404 error." ]
[ "yii2" ]
[ "Help with generating ical ics files", "I would like to generate ics files. Are there any libraries or APIs that would be of help please? Thank you" ]
[ "iphone", "cocoa", "cocoa-touch", "icalendar" ]
[ "SSO login based on OAuth2 AccessTokenProvider", "My application login is externalized into an external form based on OAuth2 Authorization Code Flow.\n\nI wonder how to solve the problem explained in the Spring IO forum taking into account that AccessTokenProvider (org.springframework.security.oauth2.client.token.AccessTokenProviderChain) will always complain by an Anonymous user (obviously physical customer is trying to authenticate and no authentication object is set yet):\n\nif (auth instanceof AnonymousAuthenticationToken) {\n if (!resource.isClientOnly()) {\n throw new InsufficientAuthenticationException(\n \"Authentication is required to obtain an access token (anonymous not allowed)\");\n }\n}" ]
[ "spring", "oauth" ]
[ "Encode a byte array with an alphabet, output should look randomly distributed", "I'm encoding binary data b1, b2, ... bn using an alphabet. But since the binary representations of the bs are more or less sequential, a simple mapping of bits to chars results in very similar strings. Example:\n\nencode(b1) => \"QXpB4IBsu0\"\nencode(b2) => \"QXpB36Bsu0\"\n...\n\n\nI'm looking for ways to make the output more \"random\", meaning more difficult to guess the input b when looking at the output string.\n\nSome requirements:\n\n\nFor differenent bs, the output strings must be different. Encoding the same b multiple times does not necessarily have to result in the same output. As long as there are no collisions between the output strings of different input bs, everything is fine.\nIf it is of any importance: each b is around ~50-60 bits. The alphabet contains 64 characters.\nThe encoding function should not produce larger output strings than the ones you get by just using a simple mapping from the bits of bs to chars of the alphabet (given the values above, this means ~10 characters for each b). So just using a hash function like SHA is not an option.\n\n\nPossible solutions for this problem don't need to be \"cryptographically secure\". If someone invests enough time and effort to reconstruct the binary data, then so be it. But the goal is to make it as difficult as possible. It maybe helps that a decode function is not needed anyway.\n\nWhat I am doing at the moment:\n\n\ntake the next 4 bits from the binary data, let's say xxxx\nprepend 2 random bits r to get rrxxxx\nlookup the corresponding char in the alphabet: val char = alphabet[rrxxxx] and add it to the result (this works because the alphabet's size is 64)\ncontinue with step 1\n\n\nThis appraoch adds some noise to the output string, however, the size of the string is increased by 50% due to the random bits. I could add more noise by adding more random bits (rrrxxx or even rrrrxx), but the output would get larger and larger. One of the requirements I mentioned above is not to increase the size of the output string. Currently I'm only using this approach because I have no better idea.\n\nAs an alternative procedure, I thought about shuffling the bits of an input b before applying the alphabet. But since it must be guaranteed that different bs result in different strings, the shuffle function should use some kind of determinism (maybe a secret number as an argument) instead of being completely random. I wasn't able to come up wih such a function.\n\nI'm wondering if there is a better way, any hint is appreciated." ]
[ "algorithm", "random", "encoding", "base64" ]
[ "unserialize data from the response I am getting react", "I am getting a data serialize I think that is causing an issue with POST request, its getting success but the pdf or any file when I try to view from the source it generates error or blank image.\n\nHow to unserialize the data what I am getting this below data\n\n\nAnd This is the function \n\nonFileChangeHandler = (e) => {\n this.setState({\n files: e.target.files[0].name\n });\n };\n\n<input type=\"file\" name=\"Upload\" onChange={this.onFileChangeHandler.bind(this)}/>\n\n\nWith this Input component. Also here I am adding this file with API call to the source Where I have to deserialize\n\nif(this.state.files !== undefined){\n try {\n sp.web.lists.getByTitle(this.props.listName).items.add({\n Title: item.Title\n }).then(r => {\n // this will add an attachment to the item we just created to push t sharepoint list\n r.item.attachmentFiles.add(this.state.files, \"Here is some file content.\");\n });\n\n\nI think because of serialize data my attachment file is showing failed or blank. I searched internet and thought that deserialize will solve this.\nCan anyone help me with this? deserializing the above data." ]
[ "javascript", "reactjs", "typescript", "sharepoint", "deserialization" ]
[ "Should @RequestParam or @RequestBody be used for POST requests in Spring Boot?", "@RequestBody requires that a class be created for the JSON body to deserialize into, while @RequestParams do not.\nWhich one should be used for POST requests, assuming that the params don’t need to be obfuscated? Does it matter? Is either one recommended over the other?" ]
[ "java", "spring", "spring-boot", "rest", "http" ]
[ "Y Combinator in Haskell", "Is it possible to write the Y Combinator in Haskell?\nIt seems like it would have an infinitely recursive type.\n Y :: f -> b -> c\n where f :: (f -> b -> c)\n\nor something. Even a simple slightly factored factorial\nfactMaker _ 0 = 1\nfactMaker fn n = n * ((fn fn) (n -1)\n\n{- to be called as\n(factMaker factMaker) 5\n-}\n\nfails with "Occurs check: cannot construct the infinite type: t = t -> t2 -> t1"\n(The Y combinator looks like this\n(define Y\n (lambda (X)\n ((lambda (procedure)\n (X (lambda (arg) ((procedure procedure) arg))))\n (lambda (procedure)\n (X (lambda (arg) ((procedure procedure) arg)))))))\n\nin scheme)\nOr, more succinctly as\n(λ (f) ((λ (x) (f (λ (a) ((x x) a))))\n (λ (x) (f (λ (a) ((x x) a))))))\n\nFor the applicative order\nAnd\n(λ (f) ((λ (x) (f (x x)))\n (λ (x) (f (x x)))))\n\nWhich is just a eta contraction away for the lazy version.\nIf you prefer short variable names." ]
[ "haskell", "y-combinator" ]
[ "Unable to start debugging on the web server. The underlying connection was closed. The connection was closed unexpectedly", "All of the sudden I'm getting the following error on my local web server (Win7 64bit, IIS 7.5). I've uninstalled & reinstalled IIS locally and it didn't fix it. IIS is set to start up automatically and I can see that the service has been successfully started. Upon a fresh reboot if I go into IIS and click on start website I get the following error:\n\n\n The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020\n\n\nIf I try to start debugging on my local website project I get the following error:\n\n\n Unable to start debugging on the web server. The underlying connection was closed. The connection was closed unexpectedly.\n\n\nAny ideas on what I can try? I've been doing research on the issue and Microsoft suggest making sure no other service is listening on the same ports. I've verified that this isn't the issue." ]
[ "iis" ]
[ "How to handle clob column in iics/informatica cloud", "I am trying to map data from my oracle database to flatfile. But as I have CLOB column in my source table, my synchronization job is failing with error \"Internal error. The DTM process terminated unexpectedly. Contact Informatica Global Customer Support\". But if I convert the CLOB using to_char and try, it's working.But it works only for data less than 4000 chanracters. I have data lot more than this size. Please suggest." ]
[ "informatica-cloud" ]
[ "Issue with saving words to linked lists in C", "#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <time.h>\n\ntypedef struct node\n{\n int priorityc;\n char *itemName;\n struct node *next;\n} node;\nnode *head;\n\nvoid save();\nvoid printcontents();\nint search(char *itemName);\nint serve(char *itemName);\nvoid load();\nvoid inserted();\nvoid deleted(char *itemName);\n\nint main()\n{\n load();\n printcontents();\n save();\n}\n\nvoid load()\n{\n head = NULL;\n FILE *fp;\n fp = fopen(\"California.txt\", \"r\");\n int tempPriority;\n char tempName[200];\n\n while(fscanf(fp, \"%s %d\", tempName, &tempPriority) == 2)\n {\n //The issue seems to arise somewhere in the remaining code of the load function\n node *tempNode = (node *)malloc(sizeof(struct node));\n tempNode->priorityc = tempPriority;\n tempNode->itemName = tempName;\n tempNode->next = head;\n head = tempNode;\n printf(\"%s\\n\", head->itemName);\n }\n fclose(fp);\n printf(\"%s\\n\", head->itemName);\n}\n\nvoid printcontents()\n{\n\n node *current = head;\n while(current != NULL)\n {\n printf(\"%s %d\\n\", current->itemName, current->priorityc);\n current=current->next;\n }\n}\n\nvoid save()\n{\n FILE *fp;\n node *current = head;\n fp = fopen(\"California.txt\", \"w\");\n while(current != NULL)\n {\n fprintf(fp, \"%s %d\\n\", current->itemName, current->priorityc);\n current=current->next;\n }\n fclose(fp);\n}\n\n\nThe input file aka California.txt is a simple notepad file with the following information.\n\nDesktop-computer 100\nDesktop-screen 100\nDesktop-keyboard 100\nTV-set 80\nAudio-system 75\nBed 65\nNight-table 65\nHibachi 35\n\n\nAfter the save function all the numbers do make it through but the following is what the console prints out and what is rewritten on the California.txt file.\n\n{°@u&0@ 35\n{°@u&0@ 65\n{°@u&0@ 65\n{°@u&0@ 75\n{°@u&0@ 80\n{°@u&0@ 100\n{°@u&0@ 100\n{°@u&0@ 100\n\n\nI tried to making char tempName (string found in load) into a pointer and running the function like that but then the console prints out and saves to california file.\n\nHibachi 35\nHibachi 65\nHibachi 65\nHibachi 75\nHibachi 80\nHibachi 100\nHibachi 100\nHibachi 100\n\n\nI've really run into a dead end here and I can't figure out how to fix the problem, any advice would help. If it was working correctly it should print out the following to the console.\n\nHibachi 35\nNight-table 65\nBed 65\nAudio-system 75\nTV-set 80\nDesktop-keyboard 100\nDesktop-screen 100\nDesktop-computer 100" ]
[ "c", "pointers", "struct", "linked-list", "nodes" ]
[ "Crawler4j - Getting exception java.lang.NoSuchMethodError", "I am trying to setup crawler4j via eclipse(juno).\nWhen I run it, I am getting the below exception(even though the program keeps running without logging anything):\n\n\n \"Exception in thread \"main\" java.lang.NoSuchMethodError:\n com.sleepycat.je.EnvironmentConfig.setAllowCreate(Z)Lcom/sleepycat/je/EnvironmentConfig;\n at\n edu.uci.ics.crawler4j.crawler.CrawlController.(CrawlController.java:90)\n at\n packCrawler.BasicCrawlController.main(BasicCrawlController.java:81)\"\n error?. I am also getting the same error. When I clicked on\n (CrawlController.java:90)\"\n\n\nI could see that there is no source attached for CrawlController in crawler4j-3.4.jar. So I can't make out whether there is method \"setAllowCreate\" or not. \n\nThere is similar post at : NoSuchMethodError in crawler4j CrawelController class\n\nBut it does not exactly say how the problem got fixed. Does anybody have any suggestion?\n\nThanks very much for your time.\nNeha" ]
[ "crawler4j" ]
[ "When i run \"npm start\" on my react project, the network address doesn't work on my phone", "I started using React and encountered a little problem.\nI ran \"npx create-react-app first-react\" then \"cd first-react\" and finally \"npm start\" which started the server.\n\nI am able to use the localhost in my desktop browser and everything works fine.\nBut whenever I try to access the network address on my phone or my other laptop, I get the error:\n\n\n This site can't be reached\n\n\nI am able to view application running in the desktop browser. \n\nI am using the following URL to access the app:\n\n\n Local: http://localhost:3000/\n \n On Network: http://192.168.x.xx:3000/ (this doesn't work on my phone.)\n\n\nI tried running:\n\nHOST=0.0.0.0 npm run start\n\n\n...but to no avail.\n\nI also tried creating the .env file and adding PORT = 4000 but it does not fix the problem.\n\nNot sure what the problem is, but I am still learning so maybe the answer is simple." ]
[ "javascript", "reactjs", "npm" ]
[ "Aspose pdf java PdfFileSignature setAuthority not working", "I'm trying to use Aspose pdf java to digitally sign a document. This is my code\npublic ByteArrayOutputStream signDocument(Document doc, String signedBy) throws Exception {\n\n PdfFileSignature pdfSignSingle = new PdfFileSignature();\n pdfSignSingle.bindPdf(doc);\n pdfSignSingle.setCertificate(prop.getSigningKeyStorePath(), prop.getKeystorePassword());\n PKCS7 signature = new PKCS7(prop.getSigningKeyStorePath(), prop.getKeystorePassword());\n pdfSignSingle.setSignatureAppearance(prop.getSimploudLogo());\n\n signature.setAuthority("Authority");\n signature.setDate(new Date());\n signature.setContactInfo("email");\n signature.setLocation("Location");\n signature.setReason("reason");\n pdfSignSingle.sign(1, true, new java.awt.Rectangle(100, 100, 200, 200), signature);\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n pdfSignSingle.save(baos);\n pdfSignSingle.dispose();\n doc.dispose();\n return baos;\n }\n\nIn picture is shown how the signature looks in adobeReader.\n\nAs you can see both image and Authority are not shown. I tried image to be both in pdf and png format. I've also tried to make it smaller then Rectangle area. As for authority i really need it to be customizable so that text in first line in picture can be\nSigned by "customParameter"" ]
[ "java", "pdf", "digital-signature", "aspose" ]
[ "Why doesn't the console prompt for an input?", "import java.io.*;\n\npublic class ConsoleDemo {\n\npublic static void main(String[] args) {\n String str;\n Console con;\n\n con = System.console();\n\n if (con == null)\n return;\n\n str = con.readLine(\"Enter a string : \");\n con.printf(\"Here is your string %s\", str);\n }\n}\n\n\nI copied this code from the book, which says that I would get a prompt on the screen for entering a string, but my IDE just gives the message that the execution has termination, without giving me a prompt." ]
[ "java", "io", "console" ]
[ "What's the difference between clear() and stop() in PooledConnectionFactory in ActiveMQ?", "I'd like to know the difference between clear() and stop() in the PooledConnectionFactory class. Is it safe to stop the connections directly without clearing them first?" ]
[ "java", "jms", "activemq", "connection-pooling" ]
[ "Discover Kubernetes Service DNS Record", "I work on a variety of different Kubernetes clusters in a variety of different clouds. My problem here is that it's difficult to discover what the FQDN for a kubernetes Service is as different clusters have different configurations.\n\nIs there a way via kubectl to get the FQDN for a service? I don't see it when I use kubectl describe svc.\n\nIt should be something like my-svc.my-namespace.svc.cluster-domain.example according to this article:\nhttps://kubernetes.io/docs/concepts/services-networking/dns-pod-service/\n\nHow do I figure out the cluster-domain.example part of the FQDN? I could just go with my-svc.my-namespace.svc and have it resolve, but I'd like to use the FQDN if I can." ]
[ "kubernetes" ]
[ "Too many records extracted from RSS feed Scala", "I need to extract some data from XML and write it to the database. I have created Record entity for that:\n\ncase class Record (title: String, description: String)\n\n\nI want to write titles and descriptions to Record entities. If I have about 12 records in XML I want to have an output of 12 records. However, I get an output of 12*12 records, which means each record is printed 12 times. What may be the reason of it?\n\nHere is the main method:\n\ndef main(args: Array[String]): Unit = {\n val response: HttpResponse[String] = Http(\"link\")\n .timeout(connTimeoutMs = 2000, readTimeoutMs = 5000)\n .asString\n val xmlString = response.body\n val xml = XML.loadString(xmlString)\n val titleNodes = (xml \\\\ \"item\" \\ \"title\")\n val descriptionNodes = (xml \\\\ \"item\" \\ \"description\")\n\n val output: Seq[Record] = for{\n title <- titleNodes\n description <- descriptionNodes\n }yield Record(title.text, description.text)\n output.foreach(println)\n}\n\n\nI have started to code in Scala only recently so I would be grateful for any advice!" ]
[ "xml", "scala", "for-loop", "rss" ]
[ "MyBatis+Spring MapperScan with Mulitple Data Sources", "I am pulling data from two different databases using MyBatis 3.3.1 and Spring 4.3. The two configuration classes to scan for mappers look at follows:\n\n @Configuration \n @MapperScan(value=\"com.mapper1.map\", \n SqlSessionFactoryRef=\"sqlSessionFactory1\")\n public class AppConfig {\n @Bean\n public DataSource getDataSource1() {\n BasicDataSource dataSource = new BasicDataSource();\n dataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n dataSource.setUrl(\"jdbc:mysql://localhost:3306/database1\");\n dataSource.setUsername(\"user\");\n dataSource.setPassword(\"pw\");\n return dataSource;\n }\n @Bean\n public DataSourceTransactionManager transactionManager1() {\n return new DataSourceTransactionManager(getDataSource1());\n }\n @Bean\n public SqlSessionFactory sqlSessionFactory1() throws Exception {\n SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();\n sessionFactory.setDataSource(getDataSource1());\n return sessionFactory.getObject();\n }\n} \n\n @Configuration\n @MapperScan(value=\"com.mapper2.map\", \n SqlSessionFactoryRef=\"sqlSessionFactory2\")\n public class AppConfig {\n @Bean\n public DataSource getDataSource2() {\n BasicDataSource dataSource = new BasicDataSource();\n dataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n dataSource.setUrl(\"jdbc:mysql://localhost:3307/database2\");\n dataSource.setUsername(\"user\");\n dataSource.setPassword(\"pw\");\n return dataSource;\n }\n @Bean\n public DataSourceTransactionManager transactionManager2() {\n return new DataSourceTransactionManager(getDataSource2());\n }\n @Bean\n public SqlSessionFactory sqlSessionFactory2() throws Exception {\n SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();\n sessionFactory.setDataSource(getDataSource2());\n return sessionFactory.getObject();\n }\n} \n\n\nThe code deploys fine, but only mappers from data source 1 works. When I try to use a mapper from data source 2, I get a \"No table found\" exception from my database. The problem is that although I am setting the specific SqlSessionFactory that I want to use in the mapperScan, it ends up using the other SqlSessionFactory for all the mappers. If I comment out the SqlSessionFactory in configuration 1, then Configuration 2 will work. \n\nNote that if I don't use MapperScan, but instead use a MapperScannerConfigurer bean, I am able to correctly retrieve data.\n\nHas anyone else had problems using @MapperScan with multiple data sources?" ]
[ "spring", "mybatis", "spring-mybatis", "mappers" ]
[ "Require.js : Uncaught TypeError: Object function ... has no method", "I'm getting an Uncaught TypeError when i refresh the page, my js/app/main.js file can't call the method update() on js/app/utilities/resize.js.\n\nError output\n\n\n Uncaught TypeError: Object function U(n){return n&&typeof n==\"object\"&&!me(n)&&ne.call(n,\"wrapped\")?W(n)} has no method 'update'\n\n\nI haven't managed to isolate/replicate the issue into a simplified working example unfortunately. But you can click on the js files within the folder tree below for gists.\n\n\nindex.html\njs / \n\napp.js\nlib /\n\nrequire.js\njquery.js\n... etc\n\napp /\n\nmain.js - Uncaught TypeError @line 566\nutilities /\n\nresize.js\nscroll.js\n... etc\n\n\n\n\n\napp.js\n\nrequire.config({\n\n urlArgs: \"bust=\" + (new Date()).getTime(),\n\n baseUrl: WP.THEME_URL+\"/js\",\n\n paths: {\n app : \"app\"\n , jquery : \"lib/jquery-2.0.2.min\"\n , ...\n , resize : \"app/utilities/resize\" \n , ...\n }\n});\n\nrequire([\"app/main\"],function(){});\n\n\nThe method update() is being called on resize.js from main.js;\n\nmain.js\n\n\n define([ 'require' , 'jquery' , ... ,'resize' ], function( require , $ , ... , resize ) { \n \n ...\n \n function setup() {\n\n resize.update(); // Uncaught TypeError happens here\n\n \n } \n \n $doc.ready( setup );\n\n\nresize.js\n\ndefine([],function () { \n\n var resizeItems = [],\n update = function () {\n\n for (i = 0; i < resizeItems.length; i++){\n var item = resizeItems[i];\n item.callback( App.screen.width , App.screen.height );\n }\n };\n\n return {\n update : update,\n add : function( item ) { resizeItems.push( item ); }\n }\n});\n\n\nThanks in advance\n\n\n\nEdit : It seems it was a dependancy issue. Adding \"resize\" to require on app.js has resolved it;\n\nrequire([\"resize\",\"app/main\"],function(){});\n\n\nI thought suppling \"resize\" to define() in main.js would have ensured correct deps;\n\ndefine([ 'require' , 'jquery' , ... ,'resize' ], function( require , $ , ... , resize )..." ]
[ "javascript", "requirejs", "amd", "js-amd" ]
[ "SwiftUI Printing a View", "I am attempting to print a view from swiftui to a printer. Everything seems to work fine except when the print dialog appears the preview is an empty view. My PrintView has a large black box with text in it just for testing but will not appear in print preview.\n\nfunc fPrint() {\n let printingView = UIHostingController(rootView: PrintView()).view\n\n // GET VIEW AS NSDATA FOR PDF\n let pdfData:NSMutableData = NSMutableData()\n let pageSize:CGRect = CGRect()\n UIGraphicsBeginPDFContextToData(pdfData, pageSize, nil)\n let pdfContext:CGContext = UIGraphicsGetCurrentContext()!\n\n // CREATE A SINGLE PAGE PDF\n UIGraphicsBeginPDFPage()\n printingView?.layer.render(in: pdfContext)\n UIGraphicsEndPDFContext();\n\n // SETUP PRINT INFO\n let printInfo = UIPrintInfo(dictionary:nil)\n printInfo.outputType = UIPrintInfo.OutputType.general\n printInfo.jobName = \"Print Job\"\n printInfo.orientation = .portrait\n\n // SETUP PRINT CONTROLLER\n let printController = UIPrintInteractionController.shared\n printController.printInfo = printInfo\n printController.showsNumberOfCopies = true\n printController.showsPaperSelectionForLoadedPapers = true\n printController.printingItem = pdfData\n printController.present(animated: true, completionHandler: nil)\n}" ]
[ "swift", "printing", "view", "swiftui" ]
[ "Deploy Rest + gRPC server deploy to k8s with ingress", "I have used a sample gRPC HelloWorld application https://github.com/grpc/grpc-go/tree/master/examples/helloworld. This example is running smoothly in local system.\n\nI want to deploy it to kubernetes with use of Ingress. \n\nBelow are my config files.\n\nservice.yaml - as NodePort\n\napiVersion: v1\nkind: Service\nmetadata:\n name: grpc-scratch\n labels:\n run: grpc-scratch\n annotations:\n service.alpha.kubernetes.io/app-protocols: '{\"grpc\":\"HTTP2\"}'\nspec:\n type: NodePort\n ports:\n - name: grpc\n port: 50051\n protocol: TCP\n targetPort: 50051\n selector:\n run: example-grpc\n\n\ningress.yaml\n\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n name: grpc-ingress\n annotations:\n nginx.org/grpc-services: \"grpc\"\n kubernetes.io/ingress.class: \"nginx\"\n kubernetes.io/tls-acme: true\nspec:\n tls:\n - hosts:\n - xyz.com\n secretName: grpc-secret\n rules:\n - host: xyz.com\n http:\n paths:\n - path: /grpc\n backend:\n serviceName: grpc\n servicePort: 50051\n\n\nI am unable to make gRPC request to the server with url xyz.com/grpc. Getting the error\n\n{\n \"error\": \"14 UNAVAILABLE: Name resolution failure\"\n}\n\n\nIf I make request to xyz.com the error is \n\n{\n \"error\": \"14 UNAVAILABLE: Trying to connect an http1.x server\"\n}\n\n\nAny help would be appreciated." ]
[ "go", "grpc", "http2", "kubernetes-ingress", "grpc-go" ]
[ "Jquery UI Dialog not closing within ajax sucess", "I was trying to send ajax call from submit of dialog button,\nAnd on success of ajax i need to close dialog with another dialog \nI have a Dialog box code below\n\n$(\"#Forgot-password\").dialog({\n autoOpen: false,\n heigth: 50,\n width: 320,\n modal: true,\n buttons: {\n \"Submit\": function () {\n var bValid = true;\n allFields.removeClass(\"ui-state-error\");\n\n bValid = bValid && checkLength(forgotUsername, \"username\", 3, 16)\n if (bValid) {\n $(\".validateTips\").text(\"Wait....\");\n $.ajax({\n type: \"POST\",\n url: url,\n async:true,\n data: { \"REQUESTTYPE\": 1, \"USERNAME\": forgotUsername.val() },\n dataType: \"json\",\n success: function(result) {\n $(\".validateTips\").text(\"All form fields are required.\");\n $(this).dialog(\"close\");\n $(\"#dialog-forgot-message\").dialog(\"open\");\n },\n\n }); \n\n }\n },\n \"Cancel\": function () {\n $(this).dialog(\"close\");\n $(\".validateTips\").text(\"All form fields are required.\");\n }\n },\n close: function () {\n allFields.val(\"\").removeClass(\"ui-state-error\");\n $(\".validateTips\").text(\"All form fields are required.\");\n }\n});\n\n\nSo, Success code is not working, Can any one help me out , where i am wrong here" ]
[ "javascript", "jquery", "ajax" ]
[ "How to install a Maven/Gradle project along with all its dependencies to a local repository?", "I have a Gradle project that depends on several open-source projects up on Maven Central. I'd like to install the project – along with all its direct and transitive dependencies – to my local maven repository, so that I could later zip it all up and put it on offline machines.\n\nHow do I do it with Gradle/Maven?" ]
[ "maven", "gradle" ]
[ "Django - Error importing module context_processors", "Newbie question for you.\n\nI am trying to create my first custom context processor \n\nmy settings.py\n\nTEMPLATE_CONTEXT_PROCESSORS = (\n 'mmaprophet.context_processors.seasons.active'\n\n)\n\n\nMy project directory is called \"mmaprophet\", so I created a folder called \"context_processors\", and in it, I created a file called \"seasons.py\". That file contains the function active defined above.\n\nmy seasons.py\n\nfrom seasons.models import Season\n\n\ndef active(request):\n '''\n A context processor to add the \"active season\" to the current Context\n '''\n\n active_season = Season.objects.get(active=True)\n\n return {'active_season': active_season}\n\n\nBut then I get this error:\n\n ImproperlyConfigured at /\nError importing module mmaprophet.context_processors.seasons: \"No module named models\"\nRequest Method: GET\nRequest URL: http://127.0.0.1:8000/\nDjango Version: 1.6.2\nException Type: ImproperlyConfigured\nException Value: \nError importing module mmaprophet.context_processors.seasons: \"No module named models\"\nException Location: /home/ymorin007/workspace/sites/mmaprophet.com/src/mmaprophet/context_processors/seasons.py in <module>, line 2\nPython Executable: /home/ymorin007/.virtualenvs/mmaprophet/bin/python\nPython Version: 2.7.6\nPython Path: \n['/home/ymorin007/workspace/sites/mmaprophet.com/src',\n '/home/ymorin007/workspace/sites/mmaprophet.com/src',\n '/home/ymorin007/.virtualenvs/mmaprophet/lib/python2.7',\n '/home/ymorin007/.virtualenvs/mmaprophet/lib/python2.7/plat-x86_64-linux-gnu',\n '/home/ymorin007/.virtualenvs/mmaprophet/lib/python2.7/lib-tk',\n '/home/ymorin007/.virtualenvs/mmaprophet/lib/python2.7/lib-old',\n '/home/ymorin007/.virtualenvs/mmaprophet/lib/python2.7/lib-dynload',\n '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n '/usr/lib/python2.7/lib-tk',\n '/home/ymorin007/.virtualenvs/mmaprophet/local/lib/python2.7/site-packages']\nServer time: Thu, 22 May 2014 13:13:31 -0400" ]
[ "django" ]
[ "How to show emojis on my website?", "When the user clicks the drop down menu, I want to show emojis. But the problem is the only way I know how to do that is to input an emoji one by one. \n\nMy question is how do I show all the emojis? I want to when the user clicks the drop down menu and when they click the emoji, add it to the text area. \n\n\n home.php:\n\n\n\r\n\r\n<textarea id=\"textf2\" rows=\"3\" maxlength=\"3000\" placeholder=\"Enter text\" cols=\"35\">\r\n</textarea>\r\n<button id=\"bt6\" type=\"submit\" name=\"search\">Post status</button>\r\n\r\n<div class=\"dropdown\" id=\"div1\">\r\n <button onclick=\"myFunction()\" class=\"dropbtn\">Dropdown</button>\r\n <div id=\"myDropdown\" class=\"dropdown-content\">\r\n\r\n </div>\r\n</div>\r\n\r\n<script>\r\n /* When the user clicks on the button, \r\n toggle between hiding and showing the dropdown content */\r\n function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n }\r\n\r\n // Close the dropdown menu if the user clicks outside of it\r\n window.onclick = function(event) {\r\n if (!event.target.matches('.dropbtn')) {\r\n var dropdowns = document.getElementsByClassName(\"dropdown-content\");\r\n var i;\r\n for (i = 0; i < dropdowns.length; i++) {\r\n var openDropdown = dropdowns[i];\r\n if (openDropdown.classList.contains('show')) {\r\n openDropdown.classList.remove('show');\r\n }\r\n }\r\n }\r\n }\r\n</script>" ]
[ "javascript", "css", "html" ]
[ "Node.js detect user online or not", "I'm using Node.js to implement a system to detect the user is online no not.\n\nHere is the way I'm using:\n\n\nSet every user's default session MaxAge to 30 seconds\nLet each user sends the server a signal to prolong their session every 20 seconds.\nOnce they come offline and stop sending signals, their sessions expire.\n\n\nHowever, I found another post on stackoverflow says that to detect the user offline, we can do:\n\nreq.session.cookie.expires = false;\n\n\nThen the session will automatically expire once the user close the browser???\n\nHow to make the session expire after a browser close in node.js with express?\n\nCan anyone tell me if this is a correct solution? Thank you!" ]
[ "node.js", "session", "cookies" ]
[ "Android plus PHP special characters", "I'm currently sending info by webservice from Android to a function in PHP which sends that data to the database.\n\nAlthough, if I have accents in my words like names, I receive this error from PHP:\n\n\n Incorrect string value: '\\xE1\\xE1mos ...' for column 'firstname' at\n row 1\n\n\nThe names could have accents, like:\nAntónio, João, etc.\n\nIn PHP function, before inserting into database, I did this without success:\n\n$db->set_charset('utf8');\n$query = $db->prepare(\"SET NAMES 'utf8';\"); \n$query->execute();\n\n\nIf I send the data without any kind of accents, the service works perfectly.\n\nEdit: Solved using utf8_encode(variable)." ]
[ "php", "android", "special-characters" ]
[ "How to italicize reStructuredText when something other than a space follows?", "I'm trying to italicize (or bold) text in reStructuredText, but after the asterisk, there is not a space. Here's an example:\n\n*function_name*(args)\n\n\nI want it to look like: function_name(args)\n\nI want function_name to be italicized, but I do not want the parentheses or \"args\" to be italicized. The problem is that rst does not recognize the closing asterisk because there is no space after this. Any ideas?" ]
[ "restructuredtext" ]
[ "Codeigniter + doctrine weird behavior with onetomany objects", "I'm just started with Doctrine with Codeigniter.\n\nI've got a entity called Material with a relatioship onetomany with another entity called elementCombination.\n\nTo retrieve all materials I use this code\n\n$query = $this->doctrine->em->getRepository('Entities\\Material')->createQueryBuilder('m');\n$materials = $query->getQuery()->getResult();\n\n\nWhen I lookup the elements (ElementCombination entity) of each material using the getCombination() function I always get the same result for all \"material\", actually it looks like to merge results as one material could have more elements than others. It's weird, for me.\n\nI \"fixed\" this by doing this , requerying or refreshing the combination of each material:\n\n foreach ($materials as $key => $material)\n {\n $this->doctrine->em->flush();\n $this->doctrine->em->clear();\n\n //$m_combination_1 is a ArrayCollection of ElementCombination\n\n $m_combination_1= $this->doctrine->em->getRepository('Entities\\ElementCombination')->findBy(array('material' => $material->getId()));\n $material->setCombination($m_combination_1);\n }\n\n\nI see this is not a good way to do it, so, I'd like to know if is this behavior normal?, What am I doing wrong?\n\nThe yml entities are like this.\n\nMaterial\n\nEntities\\Material:\n type: entity\n table: materials\noneToMany:\n similars:\n targetEntity: Similar\n mappedBy: parent\n combination:\n targetEntity: ElementCombination\n mappedBy: material\n .....\n\n fields:\n id:\n type: integer\n id: true\n generator:\n strategy: AUTO\n.....\n\n\nAnd ElementCombination\n\nEntities\\ElementCombination:\n type: entity\n table: element_combinations\n manyToOne:\n material:\n targetEntity: Material\n inversedBy: combination\n fields:\n symbol:\n type: string\n length: 3\n nullable: false\n id: true\n maxValue:\n type: decimal\n precision: 6\n nullable: false\n column: max_value\n minValue:\n type: decimal\n precision: 6\n nullable: false\n column: min_value\n avgValue:\n type: decimal\n precision: 6\n nullable: false\n column: avg_value\n\n\nThanks in advance.\n\nEDIT:\n\nI've found the solution (I tnink) the schema is wrong, I've changed to this, and I could get rid off lots of stuff in the code\n\nEntities\\Material:\n type: entity\n table: materials\n oneToMany:\n similars:\n targetEntity: Similar\n mappedBy: parent\n manyToMany:\n combination:\n targetEntity: ElementCombination\n inversedBy: materials\n cascade: {\"remove\" , \"persist\"}\n joinTable:\n name: material_element_combinations\n joinColumns:\n material_id:\n referencedColumnName: id\n inverseJoinColumns:\n element_combination_id:\n referencedColumnName : id\nuniqueConstraints:\nmaterial_index:\n columns:\n - reference\n - inner_name\n\n\nand for the elementcombination\n\nEntities\\ElementCombination:\n type: entity\n table: element_combinations\n fields:\n id:\n type: integer\n id: true\n generator:\n strategy: AUTO\n symbol:\n type: string\n length: 3\n nullable: false\n maxValue:\n type: decimal\n precision: 6\n nullable: false\n column: max_value\n minValue:\n type: decimal\n precision: 6\n nullable: false\n column: min_value\n avgValue:\n type: decimal\n precision: 6\n nullable: false\n column: avg_value\n\n\nRegards" ]
[ "codeigniter", "doctrine-orm" ]
[ "create a text file and reopen a text file with binary mode", "I wrote a program that creates a text file and reopens the text file with binary mode, here is a code:\n\n#include <stdio.h>\n#include <stdlib.h>\n\nvoid main() {\n char ch;\n FILE *fp;\n fp = fopen(\"/home/brushmonk/television_table_barchart.txt\", \"w+\");\n /* fp is an input stream */\n if (fp == NULL) {\n fprintf(stderr,\n \"Can't create television_table_barchart.txt.\\n\");\n exit(EXIT_FAILURE);\n }\n\n char *p = \"Television is one of the means whereby these feelings are \n created and conveyed.\\nThe table and bar chart show how journey time \n in a city centre changed after improvements were made to the transport \n network, and the costs of using different forms of transport in the \n city.\";\n fputs(p, fp);\n\n fp = fopen(\"/home/brushmonk/television_table_barchart.txt\", \"rb\");\n /* fp is an output stream */\n while((ch = getc(fp)) != EOF)\n putchar(ch);\n putchar('\\n');\n\n if (fclose(fp) != 0)\n fprintf(stderr,\n \"Error in closing television_table_barchart.txt.\\n\");\n\n exit(EXIT_SUCCESS);\n}\n\n\nbut I run it in linux. output turned out to be nothing! what is going on? because textbook says in linux OS \"rb\" and \"r\" in fopen() funtion make no difference." ]
[ "c", "file" ]
[ "CouchDB and PouchDB are producing duplicate records when recreating same CouchDB from scratch with a script", "We have a couch DB we are developing on. We have a script that, for development purposes, just recreates the couch database from some json files from scratch every time we run that script. All the data we are inserting into couch from this script have unique _id's within all of the databases/documents.\n\nThe problem is, after we run this script, the pouch database in the browser starts creating duplicates when it synchronizes with couch. This results in duplicate data both in pouch and couch because when pouch replicates back to couch, couch will now contain duplicate data too.\n\nDoes anyone know if  there any way or method to prevent this duplication from occurring? It was my understanding the _id field was suppose to be unique, but that's clearly not the case, because both couch and pouch are creating duplicate records with the same _id fields." ]
[ "couchdb", "pouchdb", "couchdb-futon", "couchdb-2.0", "couchdb-mango" ]
[ "SQL Keep only records with time after", "I have a table with a Nr, DateTime, Status\n\nIf booked out status is 1 if booked in status is 0.\n\nI need to get a list daily where I want to see if it was booked out on the day but not return.\n\nI need to look for status 1, and after that time if there is not a status 0.\n\nI tried this.\n\nSELECT A1.Number, A1.Time TimeOut, A2.Time TimeIn \nFROM dbo.Items A1 LEFT JOIN dbo.Items A2 ON A1.Number = A2.Number \n AND A2.Time !< A1.Time \n AND A1.State = 1 \n AND A2.State = 0 \nWHERE A2.Time IS NULL\n\n\nThe output should be:\n\nNr : TimeOut : TimeIn : \n\n10 2017/09/15 12:00 NULL\n15 2017/09/15 15:45 NULL\n\n\nThe data is:\n\nNR : Status : Date\n5 0 2017/09/15 09:00\n10 0 2017/09/15 12:00\n5 1 2017/09/15 13:00\n15 0 2017/09/15 15:45" ]
[ "sql", "sql-server", "sql-server-2008" ]
[ "Window with no title bar in wxWindows/wxPython", "Is there a way to have a window without a title bar using wxPython? If so, how would I go about doing that?" ]
[ "python", "user-interface", "wxpython", "titlebar", "wxwidgets" ]
[ "Read a register in arm64 using C using the QNX compiler", "I want to read a register named x0 in arm64 (not x86_64) using C language. What's the best way (bug free and portability?)\n\nI search all the network, I just find some ways:\n\nregister int *foo asm (\"a5\"); //1\nregister int foo asm (\"a5\"); //2 which right?\n\n\nor \n\nintptr_t sp;\nasm (\"movl %%esp, %0\" : \"=r\" (sp) ); //3\n\n\nThe first way have some bugs I think. x0 in arm64 is 64bit. I think int *f can not hold the 64 bit addr.\n\nThe second way is for x86. It seem not work make it in this way:\n\nasm (\"movl %x0, %0\" : \"=r\" (sp) );\n\n\nSo what's the correct way read a register in C" ]
[ "c", "assembly", "arm64", "qnx" ]
[ "How can one to dynamically parse a CSV file using C# and the Smart Format Detector in FileHelpers 3.1?", "As per in this FileHelpers 3.1 example, you can automatically detect a CSV file format using the FileHelpers.Detection.SmartFormatDetector class.\n\nBut the example goes no further. How do you use this information to dynamically parse a CSV file? It must have something to do with the DelimitedFileEngine but I cannot see how.\n\nUpdate:\n\nI figured out a possible way but had to resort to using reflection (which does not feel right). Is there another/better way? Maybe using System.Dynamic? Anyway, here is the code I have so far, it ain't pretty but it works:\n\n // follows on from smart detector example\n\n FileHelpers.Detection.RecordFormatInfo lDetectedFormat = formats[0];\n\n Type lDetectedClass = lDetectedFormat.ClassBuilderAsDelimited.CreateRecordClass();\n\n List<FieldInfo> lFieldInfoList = new List<FieldInfo>(lDetectedFormat.ClassBuilderAsDelimited.FieldCount);\n foreach (FileHelpers.Dynamic.DelimitedFieldBuilder lField in lDetectedFormat.ClassBuilderAsDelimited.Fields)\n lFieldInfoList.Add(lDetectedClass.GetField(lField.FieldName));\n\n FileHelperAsyncEngine lFileEngine = new FileHelperAsyncEngine(lDetectedClass);\n int lRecNo = 0;\n lFileEngine.BeginReadFile(cReadingsFile);\n try\n {\n while (true)\n {\n object lRec = lFileEngine.ReadNext();\n if (lRec == null)\n break;\n\n Trace.WriteLine(\"Record \" + lRecNo);\n lFieldInfoList.ForEach(f => Trace.WriteLine(\" \" + f.Name + \" = \" + f.GetValue(lRec)));\n\n lRecNo++;\n }\n }\n finally\n {\n lFileEngine.Close();\n }" ]
[ "parsing", "csv", "dynamic", "flat-file", "filehelpers" ]
[ "What happened to BasePagingLoadResult in gxt 3.x?", "I'm developing a GXT app and in the examples I have seen so far on the web there is reference to the class com.sencha.gxt.data.shared.loader.BasePagingLoadResult. However, this is deprecated in GXT 3.0 jar I am using (3.0.1). What is the correct way to use this now? Do I need to implement the interface myself?" ]
[ "java", "gwt", "gxt" ]
[ "How do I make A JPanel grid?", "i'm trying to create a gui for chess-like game (6x6 board with less pieces).\n\ncreating the board is pretty easy with for loops and JPanels but I have no idea how to put the pieces on top of the JPanel. I tried adding one piece by creating a JLabel object with an icon and add it to JPanel but it doesn't look good. \n\npublic class BoardPanel extends JPanel\n{\n public static final int LENGTH = 6;\n private final Color[] COLOR_ARRAY = {Color.decode(\"#FFFACD\"), Color.decode(\"#593E1A\")};\n\n public BoardPanel() \n {\n //grid layout 6x6\n setLayout(new GridLayout(LENGTH, LENGTH));\n int numView = 0;\n //tiles color determined by odd/even\n for (int i = 0; i < LENGTH; i++) \n {\n for (int j = 0; j < LENGTH; j++)\n {\n add(new TileView(numView, COLOR_ARRAY[j % 2]));\n }\n\n swap();\n }\n\n }\n\n private void swap() {\n\n Color temp = COLOR_ARRAY[0];\n COLOR_ARRAY[0] = COLOR_ARRAY[1];\n COLOR_ARRAY[1] = temp;\n }\n}\n\n\nis there a particular class that i need to use in order to do this properly?\ndefault board:\n\n\n\nboard with one piece:\n\n\n\nThanks," ]
[ "java", "swing" ]
[ "How to enable App Group in Xamarin IOs", "I am trying to enable app group in my ios application(Entitlements.plist), but for some reason Xamarin gives me an error that I don't have any Apple developer Accounts. When I am trying to add one, xamarin suggests to Authenticate with Fastlane and nothing is happening.\n\n\n\nI have no idea why Xamarin can't see my apple IDs account.\nThanks in advance." ]
[ "ios", "macos", "xamarin", "mobile" ]
[ "I'm having this error when I check the console :\"Uncaught SyntaxError: missing ) after argument list\"", "My d3.js objects don't appear as well. How do I fix this?\nI am learning d3.js for a project. I intend to use it to make an interactive visual that gets its data from multiple csv files.\n\n<html>\n <title>Loans</title>\n <head>\n <script src=\"http://d3js.org/d3.v3.js\" charset=\"utf-8\"></script>\n\n\n\n </head>\n <body>\n <script>\n var canvas = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"width\".500)\n .attr(\"height\".500);\n var circle= canvas.append(\"circle\")\n .attr(\"cx\",1000)\n .attr(\"cy\",1250)\n .attr(\"r\",100000)\n .attr(\"fill\",\"blue\");\n })\n </script>\n </body>\n</html>" ]
[ "javascript", "d3.js" ]
[ "Random integers from an exponential distribution between min and max", "I would like to generate random integers on an interval min to max. For a uniform distribution in numpy:\n\nnumpy.random.randint(min,max,n)\n\n\ndoes exactly what I want.\n\nHowever, I would now like to give the distribution of random numbers an exponential bias. There are a number of suggestions for this e.g. Pseudorandom Number Generator - Exponential Distribution as well as the numpy function numpy.random.RandomState.exponential, but these do not address how to constrain the distribution to integers between min and max. I'm not sure how to do this, whilst still ensuring a random distribution." ]
[ "python", "numpy", "random", "exponential-distribution" ]
[ "How to remove a specific contact from contact list", "I am trying to delete specific contact but it is not deleting.\n\nHere is my code:\n\npublic static boolean deleteContact(Context ctx, String phone) {\n\n Uri contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phone));\n Cursor cur = ctx.getContentResolver().query(contactUri, null, null, null, null);\n try {\n if (cur.moveToFirst()) {\n do {\n String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));\n Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);\n ctx.getContentResolver().delete(uri, null, null);\n } while (cur.moveToNext());\n }\n\n } catch (Exception e) {\n System.out.println(e.getStackTrace());\n }\n return true;\n }" ]
[ "android", "contacts" ]
[ "Component based vs full stack framework?", "I don't understand what these 2 words mean.\n\nI think symfony is a full-stack framework while yii is a component-based framework.\n\nIs this correct?\n\nIf so, what are the main differences?" ]
[ "php", "frameworks" ]
[ "uic can't find shared library", "I am trying to make a Qt5 part of my source tree, so I haven't installed it on my machine, just copied it from source control. I am having a problem when I try to run uic.exe:\n\n stiopa@stiopa-VirtualBox:~/ct/LinuxLibs/Qt/bin > ./uic\n\n ./uic: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory\n\n\nI am still getting the same error even when I copy the libQt5Core library to bin directory. How is uic looking for shared libraries? Is there any environment variable I need to set to fix it?" ]
[ "linux", "qt5" ]
[ "setOnCheckedChangeListener is never called", "I am trying all day to understand, why my method setOnChangeListener is never called...it works well until the first Toast...The second toast never appear. What is wrong? Should i pass someway the view to the onCheckedChangeListener? I have activity, where user can click on button, then he get alertdialog, with 3 radio buttons and radiogroup inside. I want to get, what radiobutton he has choosen. No matter what i tried. Nothing worked. I get always only the one radio button as checked, which i checked in xml layout...Help...\n\nButton setWeekType = (Button) findViewById(R.id.setWeekType);\n if (setWeekType != null) {\n setWeekType.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n new AlertDialog.Builder(report_activity.this, R.style.DialogTheme)\n .setView(R.layout.dialog_type_day)\n .setCancelable(true)\n .setPositiveButton(\"Choose\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n final View child = getLayoutInflater().inflate(R.layout.dialog_type_day, null);\n final RadioGroup radiogroup = (RadioGroup)child.findViewById(R.id.radiogroup);\n final RadioButton bhome = (RadioButton)child.findViewById(R.id.bhome);\n final RadioButton bwork = (RadioButton)child.findViewById(R.id.bwork);\n final RadioButton bschool = (RadioButton)child.findViewById(R.id.bschool);\n bwork.setChecked(true);\n Toast.makeText(getApplicationContext(), \"1\", Toast.LENGTH_SHORT).show();\n\n radiogroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n Toast.makeText(getApplicationContext(), \"1\", Toast.LENGTH_SHORT).show();\n\n if (checkedId == bhome.getId()) {\n bhome.setChecked(true);\n }if (checkedId == bwork.getId()) {\n bwork.setChecked(true);\n }if (checkedId == bschool.getId()) {\n bschool.setChecked(true);\n }\n\n }\n\n });\n\n }\n\n })\n .setNegativeButton(\"Cancel\", null)\n .show();\n\n\n\n\n\n }\n });\n }" ]
[ "android", "radio-button", "android-alertdialog", "radio-group" ]
[ "VBA Userform: Text of same font size changes size based on Top property", "I have a userform. In multiple cases across several different controls, I have observed the objects with the same Width, Height, Font, and Font Size display different font sizes depending on where they are placed on my userform.\n . . . . \nAbove is an example of this. The two textbox's are both 26H and 48W, with a Left of 90. Both have font Tahoma Regular size 18. The only difference between them is their Top property. And yet visually, the upper one has much wider text than the lower one. The picture on the right has added dots to prove this is not an optical illusion. The upper one can only fit one dot between the letter and the edge. The lower one can fit at least two dots between the letter and the edge.\nCan anyone explain why this is happening? What is happening? Or how I could stop it from happening?" ]
[ "vba", "text", "font-size", "userform", "display" ]
[ "Details of some facebook friends not coming in facebook sdk", "In my app I am using facebook sdk to retrieve friend's b'day, location, likes, profile picture and so on. But in some case I am not able to getting some friends b'day, location, and likes. Only name and profile picture I am getting. I can see those details on my facebook account. But not in my app. What may be the problem? Thanx \n\nThis is my fql query\n\nselect \n name, hometown_location, current_location, birthday_date, uid, \n pic_square, music, movies, sports, books \nfrom \n user \nwhere \n uid in (select uid2 from friend where uid1 = me()) \norder by name;" ]
[ "android", "facebook-graph-api", "facebook-fql", "facebook-sdk-3.0" ]
[ "What is the proper encapsulation syntax?", "I have publication and library two classes and in publication class. How to manipulate(as encapsulation) genre, media, and target_age, If I want them to be separate classes. It's not class inside another class. \nThe genre have more type's as (fiction, non-fiction, self-help, performance) as well as media and age. I have done my research I'm serchin for the proper syntax for it. \n\nclass Publication { \n private:\n string title;\n string authore;\n string copyright;\n Genre genre;\n Media media;\n Age target_age;\n string isbn;\n bool checked_out;\n string patron_name;\n string patron_phone;\n\n public:\n void check_out(string patron_name, string patron_phone ){}\n void check_in(){}\n bool is_checked_out(){}\n string to_string(){}\n};" ]
[ "c++", "encapsulation" ]
[ "Issue with .htaccess file for R301 redirections", "Good morning,\n\nI changed the architecture of my website www.sirima.net, and I would like to setup R301 redirections from the old structure to the new structure, thanks to an .htaccess file.\n\nUnfortunately, the .htaccess file below does not work. :-(\n\nThanks in advance for your help.\n\nOptions +FollowSymlinks\nRewriteEngine On\nRewriteRule ^/une_partie_d_elle.html http://www.sirima.net/ [R=301,L]\nRewriteRule ^/bio/bio2.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/bio/bio3.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/bio/bio4.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/bio/bio5.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/bio/bio6.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/bio/index.html http://www.sirima.net/biographie/ [R=301,L]\nRewriteRule ^/disco/credits.html http://www.sirima.net/discographie/credits.php [R=301,L]\nRewriteRule ^/disco/index.html http://www.sirima.net/discographie/ [R=301,L]\nRewriteRule ^/disco/sirima01.html http://www.sirima.net/discographie/01-sometimes-love-i sn-t-enough.php [R=301,L]\nRewriteRule ^/disco/sirima02.html http://www.sirima.net/discographie/02-no-reason-no-rhyme.php [R=301,L]\nRewriteRule ^/disco/sirima03.html http://www.sirima.net/discographie/03-his-way-of-loving-me.php [R=301,L]\nRewriteRule ^/disco/sirima04.html http://www.sirima.net/discographie/04-kym.php [R=301,L]\nRewriteRule ^/disco/sirima05.html http://www.sirima.net/discographie/05-a-part-of-me.php [R=301,L]\nRewriteRule ^/disco/sirima06.html http://www.sirima.net/discographie/06-i-need-to-know.php [R=301,L]\nRewriteRule ^/disco/sirima07.html http://www.sirima.net/discographie/07-ticket-to-the-moon.php [R=301,L]\nRewriteRule ^/disco/sirima08.html http://www.sirima.net/discographie/08-i-believed.php [R=301,L]\nRewriteRule ^/disco/sirima09.html http://www.sirima.net/discographie/09-daddy.php [R=301,L]\nRewriteRule ^/disco/sirima10.html http://www.sirima.net/discographie/10-was-it-a-dream.php [R=301,L]\nRewriteRule ^/hommage.html http://www.sirima.net/raphael-torr-ballade-pour-sirima.php [R=301,L]\nRewriteRule ^/interviews/0003xx01.txt http://www.sirima.net/interviews/2000-03-la-bas-secrets-de-chansons-mars-2000.php [R=301,L]\nRewriteRule ^/interviews/8711xx01.txt http://www.sirima.net/interviews/1987-11-ok-magazine-620-novembre-1987.php [R=301,L]\nRewriteRule ^/interviews/880404.txt http://www.sirima.net/interviews/1988-04-top-50-109-4-10-avril-1988.php [R=301,L]\nRewriteRule ^/interviews/891213.txt http://www.sirima.net/interviews/1989-12-ici-paris-2319-13-au-19-decembre-1989.php [R=301,L]\nRewriteRule ^/interviews/8912xx01.txt http://www.sirima.net/interviews/1989-12-a-part-of-me-coffret-promo.php [R=301,L]\nRewriteRule ^/interviews/9001xx01.txt http://www.sirima.net/interviews/1990-01a-paroles-et-musiques-25-janvier-1990.php [R=301,L]\nRewriteRule ^/interviews/9001xx02.txt http://www.sirima.net/interviews/1990-01b-paroles-et-musiques-25-janvier-1990.php [R=301,L]\nRewriteRule ^/interviews/index.html http://www.sirima.net/interviews/ [R=301,L]\nRewriteRule ^/menu.html http://www.sirima.net/ [R=301,L]\nRewriteRule ^/menu_texte.html http://www.sirima.net/ [R=301,L]\nRewriteRule ^/merci.html http://www.sirima.net/merci.php [R=301,L]\nRewriteRule ^/photos/index.html http://www.sirima.net/photos/ [R=301,L]\n\nRewriteCond %{HTTP_HOST} !^www\\.sirima\\.net [NC]\nRewriteCond %{HTTP_HOST} !^$\nRewriteRule ^/?(.*) http://www.sirima.net/$1 [L,R,NE]" ]
[ ".htaccess" ]
[ "External, internal and no linkage or why this does not work?", "According to C standard:\n\n\n In the set of translation units and libraries that constitutes an entire program, each\n declaration of a particular identifier with\n external linkage\n denotes the same object or\n function. Within one translation unit, each declaration of an identifier with\n internal\n linkage\n denotes the same object or function. Each declaration of an identifier with\n no\n linkage\n denotes a unique entity.\n\n\nIn my example we have three separate declarations with each identifier having a different linkage.So why doesn't this work?\n\nstatic int a; //a_Internal\n\nint main(void) {\n int a; //a_Local\n {\n extern int a; //a_External\n }\n return 0;\n}\n\n\nError:\n\n\n In function 'main':\n Line 9: error: variable previously declared 'static' redeclared 'extern'\n\n\nWhy does compiler insist that I'm redeclaring instead of trying to access external object in another file?\n\nValid C++ example for reference:\n\nstatic void f();\nstatic int i = 0; // #1\nvoid g() {\n extern void f(); // internal linkage\n int i; // #2 i has no linkage\n {\n extern void f(); // internal linkage\n extern int i; // #3 external linkage\n }\n}\n\n\nBoth Clang and VC seem to be okay with my C example; only some versions of GCC (not all) produce the aforementioned error." ]
[ "c", "language-lawyer", "linkage" ]
[ "React-Native Android: DeviceInfo native module is not installed correctly", "Since upgrading to react-native 0.44, I've had this issue on Android only (iOS works fine) :\n\n\n\nI've tried: rm -rf ./node-modules && yarn to no avail.\n\nI am running only one packager and it's for the correct application (this is in reference to these two posts)\n\nTo run my app, I hit run in Android Studio with a packager running and it launches my app in the Emulator.\n\nRunning it with react-native run-android doesn't work - it complains about something else : \n\n\n \n What went wrong:\n A problem occurred configuring project ':app'.\n \n \n Could not resolve all dependencies for configuration ':app:_debugApk'.\n A problem occurred configuring project ':react-native-firebase'.\n The SDK Build Tools revision (23.0.3) is too low for project ':react-\n native-firebase'. Minimum required is 25.0.0\n \n \n\n\nI'm less concerned about the latter since I was able to run the app from Android Studio, but if you have a solution for this one too, I'll take it :)\n\nAny idea why it's complaining about the DeviceInfo module ?" ]
[ "android", "firebase", "react-native", "react-native-android" ]
[ "Is it possible to automatically update Google My Business information from a website?", "I am creating a website with a Google My Business account. I was wondering if it is possible to link the information from either the website to update the Google My Business account, or to have the Google My Business account update the website.\nIf it's possible, what is the best approach to solve this issue?" ]
[ "php", "google-my-business-api" ]
[ "How to force a redraw of my application's entry in the taskbar?", "I have a Windows form application written in C#. I update the title of the form frequently, but there's a substantial lag between the title changing and the title dislayed in the taskbar being updated. \n\nWhat's a clean way to force an update / redraw of the task bar's entry for my program? Failing that, how can I force a redraw of the entire task bar?\n\nElaboration: It turns out that the delay in updating the taskbar is fixed at about 100ms, however this seems to be a delay based on when the Form.Text was last modified. If you modify the text faster then that - say, every 10ms, the taskbar is not updated until the Form.Text has been left unchanged for at least ~100ms.\n\nOS: Vista 32." ]
[ "c#", ".net", "taskbar" ]
[ "Is there a Linux radio standard?", "We're about to embark upon implementing a device running Linux that (among other things) will be attached to a software defined FM/AM radio that can also receive RDS data describing playlists and other such stuff. It's a relatively stupid device that mostly contains a DSP or two that act as tuners and otherwise does very little processing of the signal.\n\nI was thinking that kernel drivers for the device and then a userland hardware abstraction layer that provided a standardized interface and abstracted away the details of exactly when the RDS data was received and dealt with error handling and all the other messy stuff. Is there already a userland layer like this? It would be nice to either avoid making it at all, or make our stuff plug-compatible with something that already exists so we could use other projects for the radio UI if we wanted." ]
[ "linux", "embedded", "radio", "hal" ]
[ "How to fix overriding of default AccessDeniedHandler (AccessDeniedHandlerImpl) in Spring Security (Java) config?", "I have a small web application based on Spring MVC and Spring Security. I have difficulties setting my own AccessDeniedHandler that should redirect unauthorized users to my custom error page. \n\nI use http.exceptionHandling().accessDeniedHandler(accessDeniedHandler) in my config class that extends WebSecurityConfigurerAdapter. The default AccessDeniedHandler keeps being invoked despite the setting (I debugged ExceptionTranslationFilter). As a result the container-defined error page is displayed instead of my custom one.\n\nDo you have an idea what I am missing here? What could be the issue? Thank you kindly for your help.\n\nAn excerpt from my WebSecurityConfigurerAdapter super class:\n\n\n@Override\nprotected void configure(HttpSecurity http) throws Exception {\n http.authorizeRequests()\n .antMatchers(\"/static/**\", \"/login/*\", \"/login\").permitAll()\n .antMatchers(\"/site/admin*\").hasRole(\"ADMIN\")\n .anyRequest().authenticated()\n .and().formLogin()\n .loginPage(\"/login\")\n .usernameParameter(\"user-name\")\n .passwordParameter(\"password\")\n .defaultSuccessUrl(\"/site/welcome\", true)\n .loginProcessingUrl(\"/process-login\")\n .failureUrl(\"/login?login_error=1\")\n .and().logout()\n .logoutUrl(\"/logout\")\n .logoutSuccessUrl(\"/login\")\n .and().sessionManagement()\n .invalidSessionUrl(\"/login\")\n .and().csrf()\n .and().exceptionHandling().accessDeniedHandler(accessDeniedHandler);\n}\n\n\nMy custom AccessDeniedHandler implementation:\n\n@Component\npublic class CustomAccessDeniedHandler implements AccessDeniedHandler {\n private static Logger LOG = Logger.getLogger(CustomAccessDeniedHandler.class);\n\n @Override\n public void handle(HttpServletRequest request, HttpServletResponse response,\n AccessDeniedException accessDeniedException) throws IOException, ServletException {\n final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n if (authentication != null) {\n LOG.warn(String.format(\"User [%s] attempted to access the protected URL [%s]!\", authentication.getName(), request.getRequestURI()));\n }\n\n response.sendRedirect(request.getContextPath() + \"/site/403\");\n }\n}" ]
[ "java", "spring", "spring-mvc", "spring-security", "access-denied" ]
[ "Laravel Routes Issues when using wildcards", "I have looked in quite a few places to no avail so I thought it was time to ask the experts.\n\nI am playing about with laravel and I am having some issues with routing.\n\nI have a cms of sorts and also a product catalogue, each of which uses no prefix to the pages.\n\nA product might be 'example.com/my-product' and a page might be 'example.com/my-page'\n\nIn my routes I want to check if the url matches a page or a product or neither and then redirect to a specific controller/action depending on which it is.\n\ncurrently I have \n\nRoute::any('/{slug}', function($slug) {\n $page = App\\Models\\Page::firstByAttributes(['slug' => $slug]);\n if($page) {\n // go to pagesController@find\n }\n})->where('slug', '.*');\n\n\nTo differentiate between a page and a product is fine, I'll just pop an elseif after the if($page) for the product check but I am stumped as to how to get to the PagesController once I have determined that the url points to a page on the db.\n\nAny help would be massively appreciated.\n\nEdit:\n\nMy Pages Controller:\n\nclass PagesController extends BaseController {\n\n public function find()\n {\n echo 'asdaasda'; die;\n }\n}\n\n\nI can get this to work after a fashion but its not what I want. I need the url to remain as it was and the PagesController to handle the processing and rendering of the page. The only way I can get it to work is by adding a Route::controller('pages', 'PagesController') to the routes file then modifying the find function to getFind but that just ends up with a url that looks like example.com/pages/find/ rather than the original url that might have been something along the line of example.com/about-us." ]
[ "php", "laravel" ]
[ "Android ndk static load (perform task after launching app)", "Before I can use C++ library in my project with NDK I should load it use:\n\nstatic {\n try { \n System.loadLibrary(\"MyLibrary.so\");\n }\n}\n\n\nMyLibrary.so contains method jint JNI_OnLoad(JavaVM* vm, void* reserved) which start perform after load. So maybe there's a way that load library after start application without performing load method (I want that my C++ library performs something after user launches application without straight execution). Also, I can't extending of Application." ]
[ "android", "c++", "android-ndk" ]
[ "how to read the data from the JSP in a MXML through actionscript?", "We are collecting the data at run time in Collection object in JSP page. We want to read this data from the JSP in a MXML through actionscript.\npls share the sample if you have.\n\nthanks,\nSudarshan" ]
[ "actionscript-3" ]
[ "Tapping into a phone's sensors to detect movement and stoppage", "I'm a beginner with Android development. I noticed that my Nexus 5 can detected when I'm moving and when I'm stopped. I want to build an app that detects when I'm moving but when I've stopped and walked a few feet away from where I stopped, I want it to send a notification.\n\nI know the sensors detect that I'm driving with a few seconds but I don't know if it detects that driving has stopped as quickly. I know that android has motion sensors APIs but I don't know which sensor to use and what sensor type is best for this type of movement detection.\n\nI also know I would have to use GPS Permissions or whatever but I was wondering if anyone knew more about how I can approach this. \"Approach\" is not the best word since it makes it look like I'm trying to get people to help me solve this problem but I don't know how to word it.\n\nAny help is appreciated." ]
[ "android", "android-activity", "android-hardware", "google-now", "nexus-5" ]
[ "Is there any flag in Webchat that indicate the bot has finished voicing out the message?", "I am trying to enable the mic soon after voicing out the welcome message. I want to know if there is any flag that indicates the message has been voiced out by the bot. Right now, I am enabling the mic through click method by giving a timeout of 4 seconds. Which fails in some cases when the bot takes time to initialize and voice out the message. So in those cases, while the mic turns on, the message stops voicing out suddenly." ]
[ "angular", "botframework", "web-chat" ]
[ "MYSQL Many-to-many select (chats, latest message, username) in one statement", "I'm trying to select a list of the user's chats in one statement, together with each chats latest message and the massage's sender's name.\n\nThe abstract problem is:\nEver chat can have multiple participating users. \nA message is sent to a \"chat\", not a specific user.\n\nThese are the tables I came up with\n\nTABLE users (id, username)\nTABLE chats (id)\nTABLE messages (id, message, chat_id, user_id)\n\n\nAnd lastly a many-to-many relation table between chats and participants\n\nTABLE chats_users (chat_id,user_id)\n\n\nI want to list all the chats a certain user participates in, together with the latest message and it's sender's username.\nHow would I go about that in one statement?\n\nIm running Mysql 5.0.9 and php 7." ]
[ "mysql", "sql" ]
[ "Facebook developer JSON format Quick reply", "i would like to add a image to quick reply button itself. \n\nHowever lets say i have 2 quick reply button, how i put 2 different image in 2 different quick reply in JSON format. \n\nthis is facebook developer documentation\nhttps://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies" ]
[ "json", "node.js", "image", "facebook", "button" ]
[ "How to stretch small wizard image over whole area in Inno Setup?", "I need to stretch small wizard image in Inno Setup over the whole bitmap area and hide the labels like \"select installation folder\"... etc. What would be the corresponding code for this?" ]
[ "inno-setup" ]
[ "rpart execution in R Studio", "I am working on Titanic dataset. I am trying to fill in blanks in CABIN column. I have extracted first letter from CABIN column values, then put those in CABIN_NEW column. After that I use rpart for prediction, but somehow every time I run the code below, R takes a lot of time (haven't finished one time yet, every time, I have to terminate it).\n\nDATAset has 1309 rows and the columns I am using are below in code. The system I am using is running on 4 GB Ram, i5 processor and Window 7.\n\ncombifit <- rpart(Cabin_New ~ Pclass + Sex + Age + SibSp + Parch + Fare + Embarked + Title\n + FamilySize + Surname + FamilyID,\n data = combi[!is.na(combi$Cabin_New),], method = 'class')" ]
[ "r", "analytics", "prediction", "rpart" ]
[ "Create a date counter variable starting with a particular date", "I have a variable as:\nstart_dt = 201901 which is basically Jan 2019\nI have an initial data frame as:\nmonth\n0\n1\n2\n3\n4\n\nI want to add a new column (date) to the dataframe where for month 0, the date is the start_dt - 1 month, and for subsequent months, the date is a month + 1 increment.\nI want the resulting dataframe as:\nmonth date\n0 12/1/2018\n1 1/1/2019\n2 2/1/2019\n3 3/1/2019\n4 4/1/2019" ]
[ "python", "pandas", "datetime" ]
[ "codeigniter multiple submit button clicks. ( Not prevent multiple submission or clicks )", "I have a register form and i have already set email column to be unique in DB so there is no duplicate email to be allowed if a user register with a used email address.\n\nMy problem is, if a user register with a new email (means no in DB) and he/she clicking too fast or what. The first submit request will successful insert to the DB and return an error message which is \"the email is not available or used\". \n\nHow to i prevent the second or the rest request if a user clicking too fast?\n\nNote, i need prevent in server side not client side like disable button" ]
[ "php", "forms", "codeigniter" ]
[ "React17 /react-router-dom Redirection Problem", "have a good day!\nRedirection Problem Online but not in local\nimport React from 'react';\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport './App.css';\n....\n\nfunction App() {\n\nreturn (\n\n<BrowserRouter >\n\n <Switch>\n\n <Route exact path="/"><Home /></Route>\n <Route path="/Accueil"><Home /></Route>\n ...\n <Route path="/AuPaletDOr"><AuPaletDOr /></Route>\n ...\n \n </Switch>\n\n</BrowserRouter>\n\nand a table and link within\n<td className="linkSortie" dangerouslySetInnerHTML={{ __html: titre }}></td>\n\nwhere titre=\n<a href=/AuPaletDor>Au palet d'Or</a>\n\nin a data.\nWhen i'm work in localhost i have no problem in redirection with the Link. But when the website is online, the link is'nt find and i've 404 error.\nI understand that's when i click a link, some Javascript runs that manipulates the URL in the address bar, without causing a page refresh( same problem if i refresh anywhere on the website).\nI'm lost with which API from react-router-dom i should run my website correctly.\nThanks You." ]
[ "reactjs", "redirect", "routes", "react-router-dom" ]
[ "Google App ScriptError - 401 UNAUTHENTICATED after redeplyment", "I'm getting this below exception while running the script after redeployment.Earlier it was working fine but when I added some new functions and redeployed it as API executable., started getting this error.\n\n[17-07-08 20:48:45:404 PDT] {\n \"error\": {\n \"code\": 401,\n \"message\": \"ScriptError\",\n \"status\": \"UNAUTHENTICATED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.apps.script.v1.ExecutionError\",\n \"errorMessage\": \"Authorization is required to perform that action.\",\n \"errorType\": \"ScriptError\"\n }\n ]\n }\n}" ]
[ "javascript", "google-apps-script", "google-api" ]
[ "Facebook PHP SDK Verify Like returns \"NOT A FAN\" for some Fans", "We are struggling with a problem that is driving me insane.\n\nUsing this code...\n\n$facebook = new Facebook($config);\n\n$uid = $facebook->getUser();\n\nif ($uid) {\n try {\n $user_profile = $facebook->api('/me');\n } catch (FacebookApiException $e) {\n error_log($e);\n $uid = null;\n }\n}\n\nif(!$uid) {\n$params = array(\n 'scope' => 'email',\n 'redirect_uri' => 'https://www.mysite.com/'\n);\n\n$loginUrl = $facebook->getLoginUrl($params);\n\nheader(\"Location: $loginUrl\");\n}\n\n$email = $facebook->api('/me?fields=email');\n$email = $email['email'];\n\n$verifyLike = $facebook->api('/me/likes/page_id');\nif($verifyLike['data']) {\n echo \"FAN\"; \n} else {\n echo \"NOT A FAN\";\n}\n\n\nWe are getting about 8% of users who are seeing \"NOT A FAN\" and they are in fact a Fan of our page.\n\nI can't for the life of me figure out the problem, and I am running out of ideas.\n\nAnyone have any idea what is causing this issue, and more importantly what we can do to fix it?\n\nThank you.\n\nUPDATE 2/25/12\nReported the bug to Facebook, and they changed the bug status to \"Triaged\" and the priority to \"Low\", but they don't yet have a solution and are still looking into it. No one else is experiencing this issue?" ]
[ "php", "facebook", "sdk", "facebook-page" ]
[ "Read multiple single column text files (varying length) to data frame where filename is column header", "I have many (600+) text files which each contain only a single column of data which I would like to read into a data frame in R. The catch is I need the values from each file to be imported as a separate column and the number of values in each file is not equal. The text files all start with the heading 'Area' which I don't need (I am trying to set the filename as the header instead) and then proceed with a column of numbers (4000 - 10000 values) e.g.\n\nArea\n0.0034556\n0.0002345\n....\n\n\nThe closest I have come is with:\n\nfilenames <-dir()\nn <- length(filenames)\nfor (i in 1:n) {data[i] <- read.csv(filenames[i]}\n## printing data at this point gives lists for each value of i\n\n\nI tried then to rbind the value containing lists to the filenames to use as individual columns (under the variable c) I was then hoping to piece together the individual columns to a dataframe:\n\nfor (i in 1:n) {c[i] <- rbind(filenames[i], data[i])}\n\n\nWhen c is printed though this seems to give a list with two elements - the name of the last file and the number of values it contains.\n\nI am concerned that even if I can bind the lists imported with read.csv to the column headers I still won't be able to combine this into a dataframe because the number of values varies between files. I have seen may solutions for combining the values of multiple text files into a single column (and have got this working) - but can't find a solution to this problem where each imported file needs its own column online or in swirl.\n\nI would be grateful for any help!\nAngus" ]
[ "r", "data-processing" ]
[ "how to change ReadWriteTimeout for powershell Invoke-WebRequest or Invoke-RestMethod?", "We are trying to download search results from Splunk using the below mentioned Rest API endpoint through PowerShell Invoke-RestMethod and Invoke-WebRequest methods(both work). But some of our searches run for longer than 5 minutes due to which no data is returned to be written into a local file by Powershell's Invoke-RestMethod and Invoke-WebRequest methods and hence requests are timed out exactly after 5 mintues. We want to increase the ReadWriteTimeout mentioned on https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.readwritetimeout(v=vs.110).aspx page for Powershell's Invoke-RestMethod and Invoke-WebRequest methods, is it possible?\n\nSplunk Rest API Endpoint:\n https://${server}:port/services/search/jobs/export\n\nNOTE:- This Splunk endpoint starts streaming results after completing the search only.\n\nMany might suggest to use another CURL client for making this Rest API call, we have already tried that and it's working since other clients like curl in Cygwin don't have the default 5 minute ReadWriteTimeout." ]
[ "powershell" ]
[ "Is there any trick to use a variable that is read early, in a switch case statement?", "I'm working on a practice question that our teacher has given us and it calculates the roots of a quadratic equation. We are said not to use if in it and to use switch_case instead. in this code, I'm asking the user to enter three integer values and after some math operation, the result is the delta that needs to be defined that if it is positive, negative or equal to 0 and then do the appropriate operation on it. like below:\n\nint opt=0,a,b,c,delta;\ndouble x1,x2,real,img;\nprintf(\"Enter the integer coefficients a, b and c respectively: \");\nscanf(\"%i%i%i\",&a,&b,&c);\ndelta = b*b - 4*a*c;\n\n\nnow to link the correct operation to delta's sign, I need to use switch_case like this:\n\nswitch(delta){\n case delta>0:\n x1=(-b+sqrt(delta))/(2*a);\n x2=(-b-sqrt(delta))/(2*a);\n printf(\"the roots of the quadratic equation you entered are x1=%.3lf & x2=%.3lf\",x1,x2);\n break;\n case 0:\n x1=(-b)/(2*a);\n printf(\"the roots of the quadratic equation you entered are the same and equal to x=%.3lf\",x1);\n break;\n case delta<0:\n real=(-b)/(2*a);\n img=sqrt(-delta)/(2*a);\n printf(\"the roots of the quadratic equation you entered is x1=%.3lf+i%.3lf & x2=%.3lf-i%.3lf\",real,img,real,img);\n break;\n default:\n printf(\"an error accured during operation\");\n}\n\n\nbut since the delta is not predfined and is being calculated during the execution of the code, the cases don't work and I face with the error \"case label does not reduce to an integer constant\"\nIs there any trick or regular way to use switch_case with such variables(not predefined)??" ]
[ "c", "switch-statement" ]
[ "How can I import a locally stored module via absolute path?", "I have a file file.py which I want to import a local module. A server I do some work on doesn't allow me to install modules so I am trying to include them in my projects locally to reference. I have downloaded the necessary modules but I'm unable to install them.\n\n#!/usr/bin/env python3\n\nfrom sys import exit\n\ntry:\n import \"/modules/pandas\"\n import \"/modules/numpy\"\nexcept ImportError:\n print(\"Modules not found!\")\n exit(1)\n\nif __name__ == '__main__':\n print(\"Modules loaded properly.\")\n exit(0)\n\n\nAbove is the general idea of what I'm trying to do. My directory structure is like so:\n\nparent/\n-- file.py\n-- modules/\n-- -- pandas/\n-- -- -- ...\n-- -- -- __init__.py\n-- -- -- ...\n-- -- numpy/\n-- -- -- ...\n-- -- -- __init__.py\n-- -- -- ...\n\n\nHow can I access these modules in this situation? \n\nIf it matters, the server is running Red Hat Linux and it does not have pip." ]
[ "python", "python-3.x", "import" ]
[ "Socket.setTcpNoDelay() vs host setting (Nagle's Algorithm)", "I just wanted some insight into how Nagle's algorithm is handled in regards to an application vs host.\n\nSo, say the host had TCP_NODELAY enabled, but the Java application didn't, which would take priority?\n\nWhat about the other way round?" ]
[ "java", "sockets", "tcp", "nagle" ]
[ "Couldn't uninstall the nodejs from ubuntu", "I'm trying to uninstall the nodeJS from ubuntu. I tried following commands\nsudo apt-get purge nodejs\nsudo apt-get autoremove\nsudo apt-get purge nodejs\nsudo apt-get purge --auto-remove nodejs\nNothing really worked. Could anyone help me uninstalling the nodeJS and npm on ubuntu? And Help me in Installing the latest version of nodeJS and npm.\nI'd appreciate the help\nThanks enter image description here" ]
[ "node.js", "ubuntu-16.04" ]
[ "Queries equality in Solr / Lucene", "The problem:\n\nTrying to recognize that 2 different queries are actually the same.\n\nFor example:\n\nfield1:[1 TO 3] OR field1:5\n\n\nis actually the same query as:\n\nfield1:5 OR field1:1 OR field1:3 OR field1:2\n\n\nThe idea:\n\nIs there any way to normalize a query to some kind of canonical form so that after being normalized, a simple string comparison will do the trick?\n\nFor example, with the above example, both queries could become:\n\nfield1:1 OR field1:2 OR field1:3 OR field1:5\n\n\nAnd then can be simply compare to determine whether they are equal.\n\nOr maybe there actually exists some kind of service that is able to determine if two queries are equal. I could not find any.\n\nThanks for helping." ]
[ "solr", "lucene", "normalization", "solrj" ]
[ "Get the result of a WMIC command and store it in a variable", "I have seen some batch scripts working that way, including all around stackoverflow.\n\nMy question is simple: Why the MEM part isn't working?\n\n@echo OFF\n\nSET CPU=\"$CPU\"\n\necho CPU: %NUMBER_OF_PROCESSORS%\n\nFOR /F \"delims=\" %%i IN ('wmic computersystem get TotalPhysicalMemory') DO set MEM=%%i\n\necho MEM: %MEM%" ]
[ "batch-file", "scripting", "wmic" ]
[ "How to remove Baidu's cookie", "How to remove viglink & baidu's cookie.\n\nI create a empty html file and testing on my Chrome\n\nI notice there are 3 files is reading from baidu 2 from viglink\n\nI use Chrome Network to check this what files are reading.\n\nI'm not sure what are those files for, r those secure?\n\nI check cookies and try to remove it from Chrome\n\nbut it comeing back.\n\nhm.js?3d143f0a07b6487f65609d8411e5464f\nhm.baidu.com\n\nvglnk.js\ncdn.viglink.com/api\n\nping?format=jsonp&key=084c74521c465af0d8f08b63422103cc&loc=http%3A%2F%2Flocalhost%2Fz.php&v=1&ref=http%3A%2F%2Flocalhost%2F&jsonp=vglnk_jsonp_13800321595965\napi.viglink.com/api\n\nhm.gif?cc=1&ck=1&cl=32-bit&ds=1920x1080&ep=59502%2C7996&et=3&fl=11.8&ja=1&ln=zh-TW&lo=0&lt=1380031859&nv=0&rnd=632137474&si=3d143f0a07b6487f65609d8411e5464f&st=4&su=http%3A%2F%2Flocalhost%2F&v=1.0.47&lv=3&u=http%3A%2F%2Flocalhost%2Fz.php\nhm.baidu.com\n\nhm.gif?cc=1&ck=1&cl=32-bit&ds=1920x1080&et=0&fl=11.8&ja=1&ln=zh-TW&lo=0&lt=1380031859&nv=0&rnd=998891479&si=3d143f0a07b6487f65609d8411e5464f&st=4&su=http%3A%2F%2Flocalhost%2F&v=1.0.47&lv=3\nhm.baidu.com" ]
[ "cookies" ]
[ "Laravel Eloquent ORM hasMany where other pivoted relationship exists", "I would like to query all models of a hasMany relationship that also have a pivoted relationship with a specified other model.\n\nExample:\n\nCustomer:\n belongsToMany -> Entry\nEntryGroup:\n hasMany -> Entry\nEntry:\n belongsToMany -> Customer\n belongsTo -> EntryGroup\n\n\nThe belongsToMany relationship between Customer and Entry is stored in a pivot table.\n\nI now want to collect the relationship to all Entries that belong to a specified Customer on an EntryGroup. Without this filtering restriction, I would have a function like\n\nclass EntryGroup extends Model\n{\n ...\n\n public function entries()\n {\n return $this->hasMany(Entry::class);\n }\n}\n\n\nThanks in advance for any suggestions you might have." ]
[ "laravel", "eloquent", "laravel-5.6" ]
[ "WPF & Video processing by frame", "can any one give me sample on how to access webcam in WPF and process it frame by frmae for video processing ,in faster way?\non each frame i have to find objects for further image processing" ]
[ "wpf", "image-processing", "webcam", "video-processing" ]
[ "Access root BASE API URL from a child (or deep sub-child) elements in Polymer 1.0", "I have created many elements in my Polymer 1.0 environment. Some elements are lists based on data I get from my DB server using iron-ajax. Currently I am using my root application to pass in the API URL as an element property to each element (or sub-element) that requires it so it may make the call and display the results.\n\nSomething feels off about the approach though. Should I be passing in AJAX URLs from the root element to the child elements that require it or is there a way for child elements to know what the globally set app API URL is?" ]
[ "ajax", "polymer-1.0" ]
[ "avoid automatic jump to bottom on page with iframe video", "I have a video showing on a page like this\n\n<div class=\"embed-responsive embed-responsive-16by9\">\n<iframe class=\"embed-responsive-item\" src=\"{{skin url=\"video/hande.mp4\"}}\"></iframe>\n</div>\n\n\nbut when loading the page on tablet / mobile the page automatically jumps to the bottom where the video is. I tried adding something like this\n\n<iframe style=\"display: none;\" onload=\"this.style.display='block';\" href=\"...\"></iframe>\n\n\nfollowing from this question iframe on the page bottom: avoid automatic scroll of the page but the suggestions on there don't work for me.\n\nCan anyone point me in the right direction? Thank you" ]
[ "iframe", "video-embedding" ]
[ "relation between Function and function in javascript", "I would like to understand the relation between Function and function in javascript.\n\nLet me make an example:\n\nFunction.prototype.bind // function () { [native code] }\n\nvar foo = function () {};\nfoo.bind; //function () { [native code] }\n\n\nMy question is\nFunction.prototype.bind and foo.bind refers to the same code?\nIf yes, can someone explain me the relation?" ]
[ "javascript", "prototype" ]
[ "Router not working for identical modules. No error", "I am trying to use the express router for a simple project here is my main app.js file:\n\n\"use strict\";\n\nconst express = require(\"express\");\nconst mongodb = require(\"mongodb\");\nconst path = require(\"path\");\nconst index = require(\"./routes/index\");\nconst error = require(__dirname + \"/routes/error\");\n\nconst app = express();\n\napp.set(\"view engine\", \"ejs\");\n\napp.use(\"/\",index);\napp.use(\"/new\",error);\n\n\napp.listen(4000);\n\n\nThis is my index file which is exporting and rendering with no problem.\n\nconst express = require(\"express\");\nconst router = express.Router();\n\nrouter.get(\"/\",function(req,res){\n res.render(\"index\");\n});\n\nmodule.exports = router;\n\n\nAnd this is my error file which is following the exact same logic when you send a get request to \"/new\" but it says \"Cannot GET /new\" and no other errors. Please tell me what is going on here. \n\nconst express = require(\"express\");\nconst router = express.Router();\n\nrouter.get(\"/new\",function(req,res){\n res.render(\"error\");\n});\n\nmodule.exports = router;\n\n\nNote: I have an index.ejs and error.ejs file" ]
[ "node.js", "express", "router" ]
[ "Explain the fatal error detected by java runtime EXCEPTION_ACCESS_VIOLATION", "Ive been working on my programs today and it was running fine this morning and then out of no where i received A fatal error has been detected by the Java Runtime Environment I then reffered to the log file it creates but I dont know how to make any of sense of the log file, could someone help explaining how to go about this error?\n\nI am programming in eclipse using jdk 7 and I tried reinstalling it and still recieve same error.\n\nhere is the first section of the file:\n\n#\n# A fatal error has been detected by the Java Runtime Environment:\n#\n# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0a4d6fc1, pid=4852, tid=5072\n#\n# JRE version: 7.0-b147\n# Java VM: Java HotSpot(TM) Client VM (21.0-b17 mixed mode, sharing windows-x86 )\n# Problematic frame:\n# C [delta.dll+0x26fc1]\n#\n# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows\n#\n# If you would like to submit a bug report, please visit:\n# http://bugreport.sun.com/bugreport/crash.jsp\n# The crash happened outside the Java Virtual Machine in native code.\n# See problematic frame for where to report the bug.\n#\n\n\nAnd here is a copy of the rest of the file: http://pastebin.com/R4gTizCQ\n\nIf you need more info let me know" ]
[ "windows", "swing", "java" ]
[ "Select filter dhtmlx show html encoded special chars", "I have a Select filter on a dhtmlx grid table,\n\non this filter, we have values that containst \"&\", \"<\", and \">\".\n\nOn the table, the values of these fields, are good, but on the select filter, the values of these fields are on html encoded \"&\" -> &, \"<\" -> < and \">\" -> >\n\nHow we can show the correct character on Select Filter?" ]
[ "dhtmlx" ]
[ "Prestashop get product attribute as per the csv and write them again on csv", "I have a csv file. The file is like this\n\nProduct_id, Product_quantity\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n\n\nNow I have developed a module where it will get all those product quanity from the product id\nand write them on the csv file without changinging any names\n\nSo for that I have my code is like this\n\nClass GetProducts extends Module {\n public function __construct() {\n $this->name = 'getproducts';\n $this->tab = 'pricing_promotion';\n $this->version = '1.0.0';\n $this->author = 'NewUser';\n $this->need_instance = 0;\n $this->bootstrap = 'true';\n parent::__construct();\n $this->displayName = $this->l('Get Products');\n $this->description = $this->l('lorem ipsum');\n $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');\n $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);\n }\n\n public function install() {\n $return = (parent::install() \n && $this->registerHook('header'));\n return $return; \n }\n\n public function uninstall() {\n if ( !parent::uninstall() )\n return false;\n return true; \n }\n\n public function hookHeader() {\n $this->getProductQuantity();\n }\n\n public function getcsvUpdate() {\n $file = \"http://localhost/projects/product.csv\";\n $csv = array_map(\"str_getcsv\", file($file,FILE_SKIP_EMPTY_LINES));\n $keys = array_shift($csv);\n print_r($keys); //getting csv headers\n\n $stock_array = array();\n if (($handle = fopen($file, \"r\")) !== FALSE) {\n fgetcsv($handle);\n\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $stock_array[] = $this->get_qty($data[0]);\n }\n fclose($handle);\n }\n\n foreach( $stock_array as $stock ) {\n print_r($stock); //getting quantity and product id in array\n }\n\n }\n\n public function get_qty($id_product) {\n $product = new Product();\n $product_data[] = $id_product;\n $product_data[] = $product->getQuantity($id_product);\n return $product_data;\n }\n\n}\n\n\nYou can see I have got the csv header and the array where I get the product id with its\nquantity. So can someone tell me how to write those values to the csv\nwithout deleting existing data in the csv? Any help and suggestions will be really\nappreciable." ]
[ "php", "prestashop", "fgetcsv" ]