query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
8d9b825b9bdccaad73e014df55fde5fe9168f1a34cb57435f6f2afa00b73c39d
['ab0cc069595448b2ba92e3f0aade1644']
Could go either way. It really depends on the specific token, whether it is just to save looking something up or a few keystrokes and isn’t likely to ever change, so that doing the replacement before ever render is a waste, or whether it makes sense to do so because it’s replacement is in any way needing a current dynamic value. Good point. I’ll put your comment as an answer and I’ll pick it instead, as most often it would apply even if not in this case.
c4ef38b8d8dbdfda3f98559a69aa94f960b75fb0dee2c3d68ea4ebf549fba418
['ab0cc069595448b2ba92e3f0aade1644']
The only thing I don't like about this Q&A format is that I can't select two answers. Both answers here are very good. I liked dg99's explanation but your links are also very important. Then again, I think me giving you a sincere THANK YOU is more important than a few extra reputation points :).
193e3451dcc327a4ef1945fe1d0d6061abd6a612126bf0555b6a95ee284bc5a2
['ab115687d40744e2b4a407c22f1684a9']
Disclaimer: this question is directly related to programming exercise from a text book. I'm working on a C++ programming exercise from a text book but could not figure out how to get it working. Hope if anyone could point out the error in my code. Here comes the problem... "Use an istream_iterator, the copy algorithm and a back_inserter to read the contents of a text file that contains int values separated by whitespace. Place the int values into a vector of ints. The first argument to the copy algorithm should be the istream_iterator object that's associated with the text file's ifstream object. The second argument should be an istream_iterator object that's initialized using the class template istream_iterator's default constructor - the resulting object can be used as an "end" iterator. After reading the file's contents, display the contents of the resulting vector." I built following code. The code compiles, but does not do anything. int main() { std<IP_ADDRESS>vector< int > testVector; std<IP_ADDRESS>ifstream inputFile( "/Users/GrinNare/Documents/Study/C++/Chapter 16/Chapter 16/16_10_Text_File.txt", std<IP_ADDRESS>ios<IP_ADDRESS>in ); std<IP_ADDRESS>istream_iterator< int > inputFromFile( inputFile ); std<IP_ADDRESS>copy( inputFromFile, std<IP_ADDRESS>istream_iterator< int >(), back_inserter( testVector ) ); for ( int i = 0; i < testVector.size(); i++ ) std<IP_ADDRESS>cout << testVector[i] << "\t"; std<IP_ADDRESS>cout << std<IP_ADDRESS>endl; return 0; } Text file contains the following: "12 23 43 34" I tried to debug the code and noticed that values in the text file are not read properly into int vector because they are separated by whitespace, not new line. Could anyone please help?!
c0075d978b4f78a4e54be8c478e934968bdb1d8e85177ad331ea59c758619167
['ab115687d40744e2b4a407c22f1684a9']
I'm having difficulty wrapping my head around this odd behavior of Java inheritance. Say, I have Parent class with private method method1. Then there's a class Child that extends Parent class. Child also defines method called method1, but it is public. Please see below for example: public class Main { public static void main(String[] args) { Parent p = new Child(); p.method2(); } } class Parent{ private void method1() { System.out.println ( "Parent's method1()" ); } public void method2() { System.out.println ( "Parent's method2()" ); method1(); } } class Child extends Parent { public void method1() { System.out.println ( "Child's method1()" ); } } What I don't understand is that the output is below!!! Parent's method2() Parent's method1() I know that since method1 is private in Parent, method1 in Child has nothing to do with that of Parent. If so, then when method2 invokes method1, why is Parent's method1 is called not Child's? Especially when the actual type is Child. It seems like there's absolutely no clue which method1 is called from method2. Am I missing a inheritance rule? Please please help!!!
b83652a844541e398e593aca77c89941e236f28c83f5fba4772964f2172dfd26
['ab165b61f047470e9f15a6b345f90714']
I was wondering what kind of method I could use to directly embed videos or pictures contained in twitter tweets directly ... For example .. below is a tweet from <PERSON> President <PERSON>: "Right now, we have a real chance to reduce gun violence in America." http://t.co/tmCoUsPyyB #TimeToAct The link that starts with htttp:// could be a picture .. How can I actually program it so that tweets are directly displayed with the images from the urls ? I know PHP and I used the twitter API before , but I dont know how I could easily achieve that . Any help would be appreciated
50076651bcab40f7f449a6d4f32bd5f042c965c04d1ec4d20501ae6dbc30fb38
['ab165b61f047470e9f15a6b345f90714']
How can I make sure that two commas are not entered in an Array .. this is for a web application that generates an array from user input and it's a text field .. I cant change it to anything else. example .. var names=["Kim",,"Andrew","Ashley"]; in this array , we have two consecutive commas, instead of one .. how can i make sure that if the user enters any character that wouldn't be good , I just take it out .. like comma , dot, etc .. for the example of the extra comma , how would this be achieved considering that I have no other option but deal with a text field generating an array like this
5f6e45148b6ae9130c9eefa368e2a946f3b61131eabd2df63ed355be33bb454e
['ab1e1e1cc43846e1be2c8b9c8feacb06']
I have a oData model with entities : Order, OrderInformation. There is 1 : 1 an association between Order and OrderInformation. Now in the view, based on a value in OrderInformation, I should hide / display a button. In the controller, following logic to get the value of OrderInformation->appUrl does not work but I can read the property of entity 'Order'. Init: function(){ // Not working var prop = this.getView().getModel().getProperty("/OrderInformations('"+ this._orderId + "')/appUrl"); // Working var prop = this.getView().getModel().getProperty("/Orders('"+ this._orderId + "')/orderType"); } In transaction /IWFND/GW_CLIENT, following query gives me correct value /sap/opu/odata/sap/<<ServiceURL>>/OrderInformations('132123')/appUrl I also tried with the attachRequestCompleted but still no success. Init:function(){ var oModel = this.getView().getModel(); oModel.attachRequestCompleted(function(oEvent){ var myval = model.getProperty("/OrderInformations('"+ this._orderId + "')/appUrl"); }); } Can someone provide any idea what can be going wrong ? BR Nilesh
bfa0d65cb9b0b0cb29e1f4dad692bbe12edf8bd7ca8bb60da6158f52c6f4aae5
['ab1e1e1cc43846e1be2c8b9c8feacb06']
I am trying to implement a Variant management in SAPUI5 using Personalization service of sap.ushell.Container. I have written functions to Save, Manage(delete, rename) and select Variants from the drop down. However i see strange behavior when i select a variant in the method mentioned below. onSelectVariant: function (oEvent) { var sSelectedVariantKey = oEvent.getParameter('key'); Assume i have existing variants 'A1', 'A2' and 'A3'. When i SaveAs a new variant with new values (lets call it 'X1'), the new variant is created. Then i select another already existing variant from dropdown( A1 or A2 or A3), i see the corresponding values. Now i again select the newly created variant X1 but i don't see the new values. When i debug the above mentioned method, i see that for all the existing variants, the oEvent.getParameter('key') returns the variant indexs like 0,1,2,3 etc. but for the newly created variant X1, it returns the value 'sv1579082806311' and hence it doens't find it in variantset oPersonalizationVariantSet.getVariant(sVariantKey) and then it doesn't show the new values. If i run the program again, i see that previously created variant X1 now shows correct values as the method oEvent.getParameter('key') returns the index and not 'sv....'. but if i now create a new variant X2, the same issue happens with X2. I am running the App on cloud WebIDE and not on the FIORI launchpad. Can someone help me what may be going wrong while saving the variant ? Thanks <PERSON>
4f98635d2ca9ab94bea1f49b228f123e62fa0b2a4665514db43a3239cad6dd1c
['ab37bd27e82e49cba99d7a5e7d87de4c']
Hi I have Navigation based application in which there is a timer in one view. (View like : A, B & C) I have timer in C when I start timer it's working fine but when I push back to any view and again come to View C it's not showing updated values. here is my code . App Delegate -(int)updateTimer { timer_value--; return timer_value; } View "C" Code - (IBAction)buttonClick:(id)sender { [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(update) userInfo:nil repeats:YES]; } -(void)update { MFAppDelegate *appDelegate = (MFAppDelegate *) [[UIApplication sharedApplication]delegate]; int Time=[appDelegate updateTimer]; int minute=Time/60; int second=Time-(minute*60); NSString *strValue=[NSString stringWithFormat:@"%d:%d",minute,second]; NSLog(@"%@",self.lbl_timer.text); [self.lbl_timer setText:strValue]; } update function is calling every time and NSlog of label text is showing correct. Anything I am doing wrong ? please help me out.
0cb28e9fcc2f257a7c58add8a803c6bbf905ec539ee08a8dec50e33ef30f7f1c
['ab37bd27e82e49cba99d7a5e7d87de4c']
I am very new developer for Android application so please ignore if there is some technical mistakes in my question. I have five screen (Home, SR-1, SR-2,SR-3,SR-4 ) in my Android application and I can switch any screen at give time. When we are pressing device back button it will take we to the previous screen where I was lastly. But whenever I am pressing Home it will take me to landing screen If in this state I am pressing device back button I will take me to previous view but I want to remove this state maintenance. (i.e. : When I am coming to Home and I pressed back button It will exit from my application) Thank you
3a4bc3497ce3be300cb7cbb7593735b53cea427d0bc1169787c7f742ebefb585
['ab57d0881f5e4edbb3bae3aa650a5121']
I found out the issue thanks to http://vkubushyn.wordpress.com/2011/05/31/smart-gwt-restful-spring-mvc Had to use Spring's InitBinder @InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false)); }
b31ef157788d9bc7dc8f55f0f7fcff2fc6fb553ae1ebb33c25ad72594e81c9ff
['ab57d0881f5e4edbb3bae3aa650a5121']
I am trying to capture error messages in my Java code from stored procedures in Sybase using RAISERROR, but nothing is being caught, even though when I call the proc directly I can see the error is thrown. I understand that Mybatis-Spring translates MyBatis exceptions into Spring DataAccessException So I have coded my Mapper class thusly: void insertData(Data toInsert) throws Exception, DataAccessException; I'm trying to catch both of these exceptions, but nothing is caught. Does anyone have any ideas? Thanks, <PERSON>
90c650bf4bc3a0c9f7f6e2b362f92ea02540d3a964227df9fafe17798422e021
['ab58112ec5364bbe8754919511e958fb']
I am given a string of characters that I have to encode and decode using the ideas of the huffman tree. The original string of characters is uploaded as a file, and the return for the encode method is a new file containing the translation table and the encoded message, in order. Here is an example of what an output file would contain. {0=0100, 1=0111, 2=11, 3=00, 4=10, 5=0110, =0101} 0110101100111101110100011100111000100011001011100101 My encode method: Map<Character, Integer> freq = new HashMap<>(); //store char, freq in map for (char c: message.toCharArray()) { //thank you enhanced for loop freq.put(c, freq.getOrDefault(c, 0) + 1); } //queue stores nodes PriorityQueue<Node> pq; pq = new PriorityQueue<>(Comparator.comparingInt(l -> l.freq)); //nodes will be sorted by comparator //using hashmap we add the nodes to the queue for (var entry : freq.entrySet()) { pq.add(new Node(entry.getKey(), entry.getValue())); } while (pq.size() != 1) //must be more than 1 node { //removes the two nodes of lowest freq Node left = pq.poll(); Node right = pq.poll(); //connect new nodes int sum = left.freq + right.freq; //summary of freq, for parent pq.add(new Node('\0', sum, left, right)); //add back } //root of tree Node root = pq.peek(); //new map for huffman codes Map<Character, String> huffmanCode = new HashMap<>(); coding(root, "", huffmanCode); //testing //print the <PERSON> codes so we can know them (move this later) //System.out.println("Huffman code is " + huffmanCode); //testing //print encoded message StringBuilder sb = new StringBuilder(); for (char c: message.toCharArray()) { sb.append(huffmanCode.get(c)); } //System.out.println("Encoded string is : " + sb); //check file format Pair<Map,StringBuilder> p = new Pair<Map,StringBuilder>(huffmanCode,sb); return p; I convert the pair into a string in the main method. In order to decode this string, I am supposed to re-upload the file and use the information it contains to create a new file with the original uncoded message. I would have no problem decoding the message if it weren't for the uploading requirement. I lose access to the huffman tree I previously encoded and I have been unable to preserve it in the output files as I am required to only return strings. I have tried splitting strings and working backwards from the table, but without the tree I am really struggling to decode the string without the huffman tree. Is there any way to preserve the tree in the output file, or is there a way to reconstruct the tree using the translation table? Thanks.
9bbcc49f6b56867939dc39bbaed130d34b4573e9a209144b3973ce3d9d276c09
['ab58112ec5364bbe8754919511e958fb']
I am working on a code that puts new elements on MyStack if they are unique. I had to copy and paste the node starting code, so I'm having a bit of trouble with an issue. I keep getting two error messages, even after trying various workarounds and I'm not really understanding why. I've even tried using some helper functions I've previously made that have worked before so I'm extra confused. The two errors I consistently get are: -cannot infer type arguments for MyStack.Node (actual and formal arguments differ in length) -constructor node cannot be applied to given types. Required, no arguments, found: anything, Here's my code: public class MyStack<Anything> { private Node first, last; private class Node<Anything> { Anything item; Node next; } public boolean contains(Anything value) { for (Node curr = first; curr != null; curr = curr.next) { if (value.equals(curr.item)) { return true; } } return false; } public void add(Anything value) //method that adds a new value to the end of the list //COMPLETE { Node temp = first; while(temp.next!=null){ //finds the end temp=temp.next; } temp.next=new Node(value, null); //assigns new value } public void enqueue(Anything info){ if (this.contains(info)==true) { //if the info is already present System.out.println("the stack already contains this value"); return; } //if we actually need to add the info if (first == null) { //if there is nothing in the stack Node temp= first; first = new Node<>(info,temp); first = temp; return; } if (first != null) { //if there is already stuff Node temp = first; while (temp.next == null) { Node newNode= new Node<>(info, temp); temp.next = newNode; } return; } } }
3105e3d503d5377d71909502c171b8327fb2221444f9efbb47d6ccc4a8d1b7a2
['ab6601e3ee694e4e845686fe9d524ece']
Say I have a class like this: public class RegularStuff { public int getAmountOfStuff() { int stuff = getAmount(); return stuff; } public int getAmount() { return 10; } } Now let's say I have a unit test like so: @RunWith(PowerMockRunner.class) public class StuffTest { private RegularStuff testobject; @Before public void setUp() { testObject = new RegularStuff(); } @Test public void testGetAmountOfStuff() { int result = testObject.getAmountOfStuff(); assertEquals(5, result); } } Note that the above assertion is invalid. It will fail because the method getAmountOfStuff calls another method that always returns 10. I split these up to make the code simpler to analyze. It might seem trivial given this example, but I often find myself creating much larger methods. Thus, I split up code in a given function. Otherwise the sheer amount of text becomes too big/confusing to analyze or fix- let alone test. So what I need to know is how to control the output of certain methods in the class I'm testing.
7984f7f237a8a232576c53638ab89d0980db5688f596522ece452644bbe0fb98
['ab6601e3ee694e4e845686fe9d524ece']
So let's say I have the following HTML: <select ng-model="MyCtrl.getCargo().handler.cargo" ng-options="cg.name for cg in MyCtrl.getCargo().handler.cg"> </select> And cargo looks something like this: this.cg = { cgCategory: "", cgName: "" } Both cg and cargo are getting their data from an external json object. It's worth noting that while they have the same exact data and structure, cg and cargo are separate arrays. This is so that selecting an item from the select dropdown doesn't cause the others to disappear. After a lot of trial and error, I got the code to work. However, I want each item of the select tag to show both the cargo's category, and its given name. Any help would be greatly appreciated.
d3cb9cf964ac09af09230df6a95478de9645d17adf63430b89a0255ec6d02768
['ab854c849bfc425083bfb71be9de837d']
<PERSON> Many thanks for the topics. I'm already familiar to most of them, and although the advices there do helped me along these months of uncertainty, I did not find them correlating too close to my specific problem. You see, my worst fear is of being seen as corrupt because of the data issue I had... I did not find a topic to have a similar problem so far...
de70689b98673ca487506134559e05ee9925caf566176c84e4d2b8d6f558f0b5
['ab854c849bfc425083bfb71be9de837d']
<PERSON> the journal does not exist anymore. But apparently it used to print what they call articles (with no author name) with various reviews in it (from a number of authors). Basically, a book. So, from what I've seen, they had used one of these articles as a book, and the authors of this book, which is a compiled of several articles, are the editors. Now, what I did (dumbly, I must say) is: I used the citation for the authors as in the book, but with the article details (journal, volume etc)...
a0fb503f62d4bd47643e8c71684b2da154d270df995aab45690e438feb8f52d0
['aba32d91e30447e1b40412a8aa466b65']
I have the following rule set configured using UFW on Debian Jessie 8.2.0: Status: active Logging: on (low) Default: deny (incoming), deny (outgoing) New profiles: skip To Action From -- ------ ---- 20,21,22,53,80,442/tcp ALLOW OUT Anywhere 20,21,22,53,80,442/udp ALLOW OUT Anywhere 20,21,22,53,80,442/tcp ALLOW OUT Anywhere (v6) 20,21,22,53,80,442/udp ALLOW OUT Anywhere (v6) When I disable UFW, web browsing in Iceweasel works correctly. Once enabled, it appears to be blocking all web traffic. I have tried accessing web pages utilizing the IP address retrieved via PING - to no avail. My understanding is that the set rules are exceptions to the "deny (outgoing)". Hence, port 53 should allow the DNS request, while 80 and 443 subsequently allow HTTP and HTTPS traffic. I was utilizing this exact same rule set on another Debian Jessie box, without issue.
50adec47f98c1cc4da5a5bb413322c81fc41f99a98b9106bb7e80859d0c2c692
['aba32d91e30447e1b40412a8aa466b65']
Seems you didn't understand it. The *species average lifespan* is in the order of 1 to 10 million years, with mammals taking the lowest margin (1 million years before going extinct, on average - see https://en.wikipedia.org/wiki/Background_extinction_rate). Now you suppose our intelligence will allow us to survive much longer, when it seems equally (or far more) probable that our love for guns and bombs will destroy us (and the rest of life on Earth) much earlier!
d73c9e7e5dbf07951002372ea57e63807e66c70d0854a4762a88fd529885e3bc
['aba6b79dbad540f9bf3b39e457bba980']
Thanks for the responses. The image textures themselves are fine. I am evaluating the materials in the rendered view it's just that it looks similar to the material view in this case and I wanted to remove the effect of lighting which I've played with to no effect. That being said, I am beginning to think that the lighting is playing a bigger role here than I thought so I'll investigate.
12a513214e3900563a21e42b7e88e49b9d8751261613fa8ff885c41da44b64bc
['aba6b79dbad540f9bf3b39e457bba980']
<PERSON> While I agree with your assertion that no native speaker would use "All the flights having been cancelled..." in conversation, I can see it being used in something like a retelling or account of a day's events. I agree it's still a bad question, but there is a context where the "correct" answer would make sense to me.
4f6856c92372724a27240a6147c29447ebf3cb469707c12c20c82f3f7e02c31f
['abab8c0e90c44a9989312be1e5fb1f6c']
Не соглашусь с аргументом по песне: для специфического жанра (как саундтрек к [Производственному фильму](https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9_%D1%84%D0%B8%D0%BB%D1%8C%D0%BC) ) или песни-пародии, отличное слово.
6c1bfa8ce7f5bff9edc74118c90389bfd6c176e5b2dc3e0c793d644e99654eed
['abab8c0e90c44a9989312be1e5fb1f6c']
Согласно Д. Э. Розенталю, Параграф 104, пункт 2г: Запятая перед союзами и, да (в значении «и»), или, либо не ставится, если части сложносочиненного предложения:Источник: http://rosental-book.ru/punct_xxvii.html#sect104 ... г) выражены двумя вопросительными, или двумя восклицательными, или двумя побудительными предложениями, например: Неужели впереди болото и путь к отступлению отрезан? Как часто мы встречались вместе и какие вели интересные беседы! (Фурманов); Также, в старом издании, Параграф 30, пункты 3.2 и 3.3: Запятая перед соединительным и разделительным союзами в сложносочиненном предложении не ставится, если в его состав в качестве частей входят: ... 2) побудительные предложения: Подпустить врага и огонь дать по команде! (Фурманов) — объединяет побудительная интонация; Пусть кончится холод и наступит тепло! — объединяет побудительная частица; Да будет свято имя героя и память о нём сохранится в веках! — объединяет побудительная частица; 3) восклицательные предложения: Как он смешон и как глупы его выходки! — объединяет восклицательная интонация; Как часто мы собирались вместе и какие вели интересные беседы!; Сколько скрытого смысла в этих словах и какой отклик вызывают они у слушателей! Приведенные примеры без запятой, на мой взгляд, четко соответствуют 2г (побудительная форма). Приведенные пример с запятой нарушают приведенное правило. Возможно, просто потому что нарушают. Возможно, потому что автор не вкладывал должной "побудительности" (простите за выражение) или восклицательной интонации. Как минимум, ни в одном из примеров с запятой нет восклицательного знака. Постановка или непостановка запятой в данном случае может быть очень непростым решением, особенно, если неизвестен контекст и интонация.
26f096e81681c94828cf3be7d180d6234e0c3085dfb8d21c658e67d05a27f30f
['abac94ca92fa479e811d9184cb7ef7dc']
I'm using Zend Framework to connect Google web services (i.e. gmail) using OAuth. The following code works okay; but it cannot detect denied access. For example, when the user hit "deny", I'll get an error saying "Could not retrieve a valid Token response from Token URL: The request token is invalid" Here's the code: $THREE_LEGGED_CONSUMER_KEY = 'mydomain.com'; $THREE_LEGGED_SIGNATURE_METHOD = 'HMAC-SHA1'; $THREE_LEGGED_CONSUMER_SECRET_HMAC = 'mySecret'; $THREE_LEGGED_SCOPES = array('https://mail.google.com/'); $options = array( 'requestScheme' => Zend_Oauth<IP_ADDRESS>REQUEST_SCHEME_HEADER, 'version' => '1.0', 'consumerKey' => $THREE_LEGGED_CONSUMER_KEY, 'callbackUrl' => 'http://mydomain.com/oauth', 'requestTokenUrl' => 'https://www.google.com/accounts/OAuthGetRequestToken', 'userAuthorizationUrl' => 'https://www.google.com/accounts/OAuthAuthorizeToken', 'accessTokenUrl' => 'https://www.google.com/accounts/OAuthGetAccessToken' ); $options['signatureMethod'] = 'HMAC-SHA1'; $options['consumerSecret'] = $THREE_LEGGED_CONSUMER_SECRET_HMAC; $consumer = new Zend_Oauth_Consumer($options); $conf = new Zend_Config_Ini('../application/configs/application.ini', 'production'); $db = Zend_Db<IP_ADDRESS>factory($conf->database); $sql = 'SELECT * FROM gmail_oauth WHERE id=123 LIMIT 1'; $accessToken = $db->fetchRow($sql); if ($accessToken['GoogleAccessToken']=='') { if (!isset($_SESSION['REQUEST_TOKEN'])) { $_SESSION['REQUEST_TOKEN'] = serialize($consumer->getRequestToken(array('scope' => implode(' ', $THREE_LEGGED_SCOPES)))); $consumer->redirect(array('hd' => 'default')); } else { $accessToken = serialize($consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN']))); $data = array('GoogleAccessToken'=>$accessToken); $db->update('gmail_oauth',$data,'id=123'); unset($_SESSION['REQUEST_TOKEN']); } } $db->closeConnection(); return; The line of code that throw an exception when user hit "deny" is $accessToken = serialize($consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN']))); How do I detect denied access??
04417c599cf6740b16b4efb483d13ac961bafef2166b4a5ccf58be6aa95ef696
['abac94ca92fa479e811d9184cb7ef7dc']
If I receive an email from A.com without DKIM-Signature in the header, how could I know if A.com is using DKIM? I am trying to figure out if a domain is using DKIM, but if I didn't or can't receive an email from A.com, how could I konw if A.com is using DKIM?
6d3df3dcaf81f69733ab3fbaccbbdbe9c8d556ae24ef35a5baa832217d4f400e
['abc459eeb76e4be6b4eca1484e6dbd73']
I want to show a multiple select box that uses a placeholder (nothing unusual). I've prepended a blank item to the list, which enables the placeholder to be displayed, as expected. <select id="county_id" name="county_id" multiple="" tabindex="-1" class="select2-hidden-accessible" aria-hidden="true"> <option value="" selected="selected"></option> <option value="1">Adams</option> <option value="2">Ashland</option> <option value="3">Barron</option> But when I select an item in the list, a blank box (the first, blank option) is shown as the first selection, right before the item I've selected. Note the first list item below: <span class="select2-selection select2-selection--multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0"> <ul class="select2-selection__rendered"> <span class="select2-selection__clear">×</span> <li class="select2-selection__choice" title=""><span class="select2-selection__choice__remove" role="presentation">×</span></li> <li class="select2-selection__choice" title="Kenosha"><span class="select2-selection__choice__remove" role="presentation">×</span>Kenosha</li> If I don't prepend the list with the blank option, then the placeholder does not work and the first list item is selected by default. The closest example on the select2 site uses option groups (my list does not), and does not appear to have a blank option. I don't recall running into this issue with v3.5x. I don't have any options set except placeholder. What could I be doing wrong? How can I get rid of this extra blank selection?
a075e0b980717fff4f3b751998bee4fa94233276288a6c0fffb44f1af2014ca7
['abc459eeb76e4be6b4eca1484e6dbd73']
To bind radio buttons to boolean values instead of string values in Vue, use v-bind on the value attribute: <input type="radio" v-model="my-model" v-bind:value="true"> <input type="radio" v-model="my-model" v-bind:value="false"> I'll leave it to you to figure out how to match these values with your backend data. Checkboxes are not so good for this scenario; the user could leave them both blank, and you don't get your answer. If you are asking a yes/no or true/false question where you want only one answer, then you should be using radio buttons instead of checkboxes.
e46b847c69db093207b9da2dfb10e5979ba42a35807b6d7c4b3192a69b0e90e1
['abd04b03455743e39d3b6ac521d98a07']
OK this segmentation fault is the root cause, actually my rPI2 is ARM6 and geckodriver is available for ARM7 only: https://github.com/mozilla/geckodriver/issues/796 https://github.com/mozilla/geckodriver/issues/560 So I have to go compile it for ARM6 or use a RPI3. Unless someone already compiled it for ARM6?
8395a4d2da1338b5d5e016f587fda3d782cb32e38fb1556cd7384846e55500f0
['abd04b03455743e39d3b6ac521d98a07']
I have the following configuration: Raspberry Pi2 with Stretch Python 2.7 with pip installed Firefox 52.9.0 (from apt-get install firefox-esr) geckodriver 0.17.0 (from https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-arm7hf.tar.gz), copied to /usr/local/bin Selenium 3.4.0 So according to https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/Support.html, this should work. However, running this simple python script: from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(1024, 768)) display.start() driver = webdriver.Firefox() driver.get('http://www.google.com/') print browser.title driver.quit() display.stop() returns the error: Service geckodriver unexpectedly exited. Status code was: -11 I tried many things like update Selenium/geckodriver to latest releases, tried some releases in between (Selenium 3.0.2, Geckodriver 0.11.1 as stated in Selenium Firefox webdriver results in error: Service geckodriver unexpectedly exited. Status code was: 2) but still same error -11 (crash). Any idea or working configuration? Thanks, <PERSON>
4fbb1e3fed0f3889a76385360631b97e95eae03a7f7bf9a037bc29ef9a35c6f1
['abd0a12c56644b34b290f0718d2f40d9']
I'm developing an app using Cordova and the camera plugin by cordova. I'm having an issue where, when using the photo library as an image source, if i select an image over about 3mb, the app crashes. I have found no consistency other than file size to my crashes. I have added a few other fields and conditions to both the config.xml and android manifest as per other suggestions online to no avail. <uses-feature android:name="android.hardware.camera" android:required="false" /> <feature name="Camera"> <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" /> </feature> Has anyone else encountered this problem and could point me in the right direction. Testing on a nexus 5.
b45f225a9a8a4f02409fa9185d300ff2463bf6c1284dc7aa3250e991ffd3b840
['abd0a12c56644b34b290f0718d2f40d9']
Im developing an android app with cordova and am having some issues with the soft keyboard. (using this tutorial: https://ccoenraets.github.io/cordova-tutorial/creating-view-classes.html ) When I tap on an input field on my test device (nexus 5), the soft keyboard opens and the view becomes scrollable, as expected. However, the page view shinks and some of my content is left floating on whitespace if you scroll the view up (see link below) (grey is the background image im testing with, it is shrunk by about 40% when the keyboard opens) http://i57.tinypic.com/v6t89t.png I spun up a tutorial version of JQuery mobile and they do not have this issue. The page loads and scrolls in full and I believe they are using some JS to hard set the height of the main element or something to that matter. Is there a way of solving this white space issue without using an existing framework as I'd rather not want to have to hard override the JQuery mobile CSS Cheers
9ead4cf50641a8b46625a8f334353c8e166bf4aad413cfdc324fd79c4cc564dd
['abdae35b4d95430d8c37e61da3d67e63']
Documenting process a little better was second on my list for probably two months. You can infer my list from the fact that I never got to it. Unlike most things I don't do, this is something I said I'd do, so I greatly regret that it remains as undocumented as it was when it arrived. Sword, ready yourself! I fall upon thee!
8f3e86235e23180b7cc635d3bc11a0360ff37480cd9b993c2f0d5f764c3f971f
['abdae35b4d95430d8c37e61da3d67e63']
I took other peoples' answers and scriptified them into something a little more worky for me. I still had to delete a couple by hand out of /usr/local/cellar. #!/usr/bin/env bash # brew install gnu-sed sudo gem pristine --all --no-extensions gems=$(gem -v 2>&1 | grep called | gsed -r -e 's#^.*specifications/##' -e 's/-[0-9].*$//') for gem in $gems do echo Fixing $gem... sudo gem pristine $gem -- -build-arg done
b066b6a7b3f1dbcce0656c648fc9abd3c7cd75bb0aeb9357fc3c186dde48f6ec
['abe81c3c6fc74dd699640a1d1b58e3ee']
I'm really new to AngularJS and I've found that ng-model doesn't work for a file type input tag. I want to be able to allow users to upload pictures to my app, but nothing I've tried so far has worked. I've tried to use both ng-file upload and angular-file upload, but they both require dependency injection and whenever I try that my entire app crashes. I've been reading that a new directive can be created, but I am so new to Angular that I'm not understanding how to do that. Any insight would be great! postImage.html : <div id="postimage container" > <div > <input type="file" name="image" np-model="$ctrl.image"/> <button ng-click="$ctrl.upload($ctrl.image)">Upload</button> </div> postimage.js : angular.module('main') .component('postimage', { controller: function () { this.upload = function (data) { console.log(data) } }, templateUrl: '../templates/postImage.html' });
84b8da7aa296af549103f8258bc5ab661beac1e8a5febc2779c6475ecb8c7a2a
['abe81c3c6fc74dd699640a1d1b58e3ee']
I'm creating a project using xCode9.4 and everything was working fine. My app started to update without the changes in the code so I (stupidly) used the Hardware>Erase All Content and Settings option. Now the icon for my app won't appear at all. I've tried deleting the build folder and rebuilding and I've tried restarting the device. I'm not entirely sure what erasing and resetting did so I don't know what to do to fix it. Any suggestions would be great! Thanks!
8264f8f2694db8811adb4ea762d2eeadb907343f10fb6db022a1944ea0dc69b2
['abec8ab8f83e441fb202c8ca204c8b7d']
I have an index (similar to say, the Consumer Price Index) which contains a number of weighted items. I have time-series data for each of the items that comprise this index, in addition to the index itself. Ideally I would like to find out what is going on in my index - the most important 'drivers' of change over time, the most volatile components, and so on. If I'm not wrong, a standard regression analysis is not very useful since the weight of each item in the index is already defined. What else can I do here? Thank you!
916f7e4ce83be3421fe27ac205be8536070125bc95bd10c03d0c40adeaa85911
['abec8ab8f83e441fb202c8ca204c8b7d']
We need to integrate into an existing java web application, a new feature that allows the user to compare 2 pdf documents and see the differences. So, I started to search for some already exiting library or tool (open source or commercial) that could help me solve this request. Does anyone know if exists this kind of application? That would take 2 pdf, compare them and display the differences? Thanks in advance, <PERSON>
8b50c2fe2ce4e73039867053a3697f2bd0b257f647799016b227d07f794b1328
['ac060246b0784cb194eaf9c5c06dc539']
Whenever our tests give us unexpected trouble, it's important to take a step back and re-evaluate our approach. Usually, this is an indication of some design problem, either with the code we're testing or with tests themselves. While it sounds like using a truncation strategy has fixed this particular problem (see more on that below), i would suggest that there is more to learn from the situation. Consider the two examples from your spec above. The only difference between them comes down to whether the code parameter is valid or not. I would argue that these examples are really testing the Group model, not the controller. Now, if we're confident in our model test coverage, then we can take a different approach to the controller spec. From the controller's perspective, the model is a collaborator and in general, we always want to avoid indirectly testing collaborators. In this case, we can use a mock to simulate the behavior of the Group model and only test the controller behavior in isolation. Something like this (please note the code below is incomplete and untested): # spec/controllers/groups_controller_spec.rb describe "#create" do before do # use a Test Double instead of a real model @new_group = double(Group) @params = { :cdb_group => 'stub_cdb_group_param', :service_id => service } # using should_receive ensures the controller calls new correctly Group.should_receive(:new).with(@params[:cdb_group]).and_return(@new_group) end context "when cancelled responding to js" do it "renders hide_new" do post :create, @params.merge({:button => "cancel", :format => "js"}) expect(response).to render_template('hide_new') end end context "with valid params" do before do @new_group.should_receive(:save).and_return(true) end context "responding to json" # ... context "responding to html" # ... context "responding to xml" #... end context "with invalid params" do before do @new_group.should_receive(:save).and_return(false) end # ... end end While the above doesn't specifically address the problem with record counts you were having, i suspect the problem may go away once you isolate your test targets correctly. If you choose to stick with database truncation, consider using it selectively as described here. I hope at least some of that helps :).
865591b351cf0a2b74b63226fb85f3e5f444b76eb33216449192b404469dd273
['ac060246b0784cb194eaf9c5c06dc539']
There are a number of ways to do this and it's hard to recommend one without more context. Here's one way using a forked process and a pipe: # When given '-' as the first param, IO#popen forks a new ruby interpreter. # Both parent and child processes continue after the return to the #popen # call which returns an IO object to the parent process and nil to the child. pipe = IO.popen('-', 'w+') if pipe # in the parent process %w(please upcase these words).each do |s| STDERR.puts "sending: #{s}" pipe.puts s # pipe communicates with the child process STDERR.puts "received: #{pipe.gets}" end pipe.puts '!quit' # a custom signal to end the child process else # in the child process until (str = gets.chomp) == '!quit' # std in/out here are connected to the parent's pipe puts str.upcase end end Some documentation for IO#popen here. Note that this may not work on all platforms. Other possible ways to approach this include Named Pipes, drb, and message queues.
7a069aedfec0f572390f0a82f65ebe7a757ab80ee309867639c1071abf546988
['ac069573675f4a7db6a1ff50d646de45']
I am experimenting with an Android Beacon Listening App. To simplify my question lets assume that I just want to have a local database with a list of Beacons and be able to identify which Beacons of these are currently being scanned. I have several ideas regarding possible approaches, however, I would like your advice on how could I do that as fast as possible. Please also consider the following: 1) Part of the UUID (6 last Bytes) is common to all Beacons (so maybe I should avoid comparing that part) 2) I do not mind if your recommendation demands having stored my Beacons in a specific way (to fasten the comparisons). PS. I was thinking of getting a byte array of the first 10 bytes and trying to convert them into a long and search for that as a key within my Beacon's HashMap. Dunno Thx for your time!
50d707c8fdfd50d0a8baa858c634e823ff377633ed496cba9b263c9ca096f040
['ac069573675f4a7db6a1ff50d646de45']
Is it practically possible for a developer right now (or at least theoretically in the future) to develop an App that can measure via UWB, the distance towards other Iphones? UWB technology can take different forms in terms of ranging techniques. How does (or will) ranging work in these iPhones?
8004d5ef310ce6408bc44aeddb764cbde3976cc55b022863224764fe9dd973b5
['ac10e44b970c41ef996dee1d62870e02']
I need to create different application properties for a spring boot project and include the proper one in the generated war. I'm able to generate a war, but no to include the proper file in it. I have different profiles created, and different application.properties following the pattern application-env.properties where env is (dev, cert...), all of then placed in src/main/resources but I'm not able to pick the proper one and include in the generated war, even including "-Dspring.profiles.active=cert" to define the profile active. The war is generated with all of them. Any idea? <profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <build.profile.id>dev</build.profile.id> <packaging.type>jar</packaging.type> <spring.profiles.active>dev</spring.profiles.active> </properties> </profile> <profile> <id>cert</id> <properties> <build.profile.id>cert</build.profile.id> <spring.profiles.active>cert</spring.profiles.active> <packaging.type>war</packaging.type> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> </dependencies> </profile> </profiles>
cf13b049473d56a153c1838d615a3355a5dc9d06e442160df7cfb0570b1b756a
['ac10e44b970c41ef996dee1d62870e02']
I'm triying to format the number on my report with Apache poi but it is not working, I tried : c.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("#.##0,00")); and c.getCellStyle().setDataFormat((short)BuiltinFormats.getBuiltinFormat("#.##0,00")); But they are not working, I'd like to show it as 1.000,99 but it is showwing 1000,99 I've only found the custom option but not the numeric, is it possible to use it ?do you know how to do it work? Thanks
d17dff905a5875fe719e208a8af69deee068873b18561c0be401840da08e6d5a
['ac15ca26681f47fe8d05f7ddd205b4d4']
"client-server, когда есть централизованный сервер и все общение идет через него, пример Skype, ICQ". Скайп реализован не за клиент-сервер в плане обмена временными данными (сообщения, поток аудио/видео). На сервере скайпа реализовано хранение только данных самого пользователя. Берите во внимание, когда в звонке 3 участника, то объявляется лидер звонка и все данные идут через него. Он становится сервером. Чат - если написать человеку в оффлайне и выйти, то тот человек не получит этого сообщения, пока первый не будет в онлайне.
a91d311628a5972ebbd704307e8b42e18c0564161fbf04a9c4bbaacdf327d76a
['ac15ca26681f47fe8d05f7ddd205b4d4']
In this case it looks as though the problem was that the condition of having a score of 2 or more was not met. Seems silly that the person offerring the bounty accepting an answer shortly after the bounty expired would not reward at least half bounty to the user. Thanks for your clarification as it does answer my question.
e11d5cec82b723576a1441474dcc8cd990388df0072b1d920e68e09e0b0acc14
['ac48ebaba31a4f678465a0b8529b427f']
It sure would be nice if someone answered @Qwerty. As it stands, this is a useless answer. Ok, it's possible. Now how do you do it? I had to create an account on this community (which I'm sure no one wants a bunch of inactive members) just to comment here. You can't even click edit to hopefully see what markup it is. It would have been decent to at least add a section below your cutesy response for a real answer.
f0cb2e102e0c6caea3bc9f32ee7eea85e0832e7403f31ab3aaeb672ae733ff25
['ac48ebaba31a4f678465a0b8529b427f']
@TheCleaner I started out with the scripts in a share on the domain controller. I placed the files on the C drive to troubleshoot some suspicions I had about network connectivity. It's a poor practice, I know. I'll change it back to referencing the shared location once I find the problem.
f284a9b30f7d41b077cd9775b512d73ee1b92efe697ce05eda4aaa92f7e45d47
['ac4c0eaf2852404abbe77b085774a870']
How can I deserialize the following JSON into a custom object using C# and Json.NET: [ { 'data': [ [ '100473','<PHONE_NUMBER>.0' ], [ '100472','<PHONE_NUMBER>.0' ], [ '100471','<PHONE_NUMBER>.0' ], [ '100470','<PHONE_NUMBER>.0' ], [ '100469','<PHONE_NUMBER>.0' ] ], 'error': '', 'statement_time': 0.00440700000000000030, 'total_time': 0.00475200000000000010 } ] It is an array containing a single object. To make things more interesting the object contains an array of arrays. (I have no control over the format, unfortunately.) I am relatively new to JSON and thought I'd try Json.NET. I am open to other JSON frameworks if it would make things easier.
4d5e2c84c7561d6903eafc36dd5f532a1e4c2fe0abefd7cc967a1fa4866423c5
['ac4c0eaf2852404abbe77b085774a870']
I'm trying to make a VERY simple graph with the chart control in SSRS 2008 and, of course, Microsoft wants to make things as difficult as possible. The x-axis contains stations on an assembly line and the y-axis contains some numerical value that is irrelevant to the issue. I'm returning a dataset with the scanning stations in the order that they exist on the assembly line. However, when I bind the dataset to a chart control the stations are put in alphabetical order! I don't want the categories on the x-axis to be in alphabetical order. I want them to display in the order that they are returned in the dataset. I suppose I could number the stations in the order that I want but I would rather not do that. Thanks in advance.
bfc50d032b9b61f3d32dbc0dc6af7a206373671f228da5cf9d61a952fd61ab16
['ac5a0071e75f4547883a275824465cfa']
I am trying to run a C++ program developed on Ubuntu 18.04. It uses JSON-C shared library. It compiles and runs without any problem on my Ubuntu 18.04 system. However it compiles on a Ubuntu 14.04 system but crash upon running, Reporting following message - *** Error in `./main.out': corrupted size vs. prev_size: 0x00007fdd54f49e30 ***Aborted (core dumped) After some digging I have found that something wrong with JSON-C library. I have checked the linked JSON-C libraries using ldd command. It gave me following output in Ubuntu 18.04 - libjson-c.so.3 => /lib/x86_64-linux-gnu/libjson-c.so.3 (0x00007ff16a88c000) And following in Ubuntu 14.04 - libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f0848838000) I guess something wrong with JSON-C versions. I couldn't found any useful information on google. Any ideas what sort of problem this is?
f9cb9cb7f661966feed9c89a5e1f8e50e228a7c83e6bfaa1a3908a7dd1f0b797
['ac5a0071e75f4547883a275824465cfa']
My question is related to a question I asked earlier. Forward packets between SR-IOV Virtual Function (VF) NICs Basically what I want to do is use 4 SR-IOV functions of Intel 82599ES and direct traffic between VFs as I need. The setup is something like this (don't mind the X710, I use 82599ES now) For the sake of simplicity at testing I'm only using one VM running warp17 to generate traffic, send it though VF1 and receive it back from VF3. Since the new dpdk versions have a switching function as described in https://doc.dpdk.org/guides-18.11/prog_guide/switch_representation.html?highlight=switch , I'm trying to use 'testpmd' to configure switching. But it seems to be test pmd doesn't work with any flow commands I enter. All I get is "Bad argument". For example it doesn't work with this command, flow create 1 ingress pattern / end actions port_id id 3 / end My procedure is like this, Bind my PF(82599ES) with igb_uio driver Create 4 VFs using following command, echo "4" | sudo tee /sys/bus/pci/devices/0000:65:00.0/max_vfs Bind 2 VFs to vfio_pci driver using, echo "8086 10ed" | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id sudo ./usertools/dpdk-devbind.py -b vfio-pci 0000:65:10.0 0000:65:10.2 Use PCI passthough to bind VFs to VM and start the VM sudo qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -hda WARP17-disk1.qcow2 -m 6144 \ -display vnc=:0 -redir tcp:<IP_ADDRESS>22 -net nic,model=e1000 -net user,name=mynet0 -device pci-assign,romfile=,host=0000:65:10.0 -device pci-assign,romfile=,host=0000:65:10.2 Run testpmd with PF and 2 port representators of VFs sudo ./testpmd --lcores 1,2 -n 4 -w 65:00.0,representor=0-1 --socket-mem 1024 --socket-mem 1024--proc-type auto --file-prefix testpmd-pf -- -i --port-topology=chained Am I doing something wrong or is this the nature of testpmd? My dpdk version is 18.11.9
948d3a496fc95fb5f116aa92d3e0d92937893fc3afb61762982e90c013c263a6
['ac5f8582da414fd2b2a7248286a656f4']
You can achieve it, its not hard. for instance I assume that 0..4=LOW (0) 5..9=HIGH (1) I start calculating π using chudnovski algorithm... and so i start π=3.1415.... (π=0.0001....) At the same time as I calculate the infinite tail of π, I compare the data that I wish to send to somebody else, until I find a 100% match of length. So after I find a match, I am telling my remote friend "the data that I wish to send you starts at the 9.876.543 digit of pi and its size is 1MB after the starting point. Convert it accordingly (0-4=0; 5-9=1;) This way you could transmit data just by providing starting point and size. Also , there will be thousands of ways to optimise the algorithm. Inside the π lies ANYTHING ! From my dna to the farest multiverse.
804c23a07d766f2b81d60e6ae2d29c590803bc79b0508de8a9c3f4774f850dda
['ac5f8582da414fd2b2a7248286a656f4']
The answer to this question may vary depending on the opinions regarding the various so-called "good practices". If we take into account the dependency inversion principle (In SOLID principles), then we should always aim for our classes to depend on abstractions and not on implementations. However we could also take into account the "KISS" principle (Keep it stupidly simple) and in this way I could tell you that if your application is not very large or complex, then do not use an interface. Answering your question: "what is better to use interface with one implementation and inject interface or just create a class without interface and inject class?" I recommend using an interface even if it has only one implementation, so in the future if the implementation changes, the class that depends on said interface will not be affected by said change, unless the interface signature changes as well.
4716d5d8a6938d49762557f8e597137a876c3e44898ac663b585ab0372a413b7
['ac6738319d264374992959b959bd89bd']
What is the best way to make my tar log more informative? Cat'ing the log shows what was backed up, but tells nothing about the files last update or size. Eg: tar cvf /dev/st0 foo* > backup.log cat backup.log foo1 foo2 ... I changed it to tar cvf /dev/st0 foo* | xargs ls -lah > backup.log cat backup.log -rw----- root root 2k June 6 foo1 -rw----- root root 2k June 2 foo2 ... Is it a good approach or do you know a better solution?
cbb3b881cc9f449a1422842454d1448de97ba2d4a9ac824178fcfb4cab08aa1c
['ac6738319d264374992959b959bd89bd']
This also works, cdf name_of_file_or_directory ..given that you set up a custom cdf.sh script (below) sourced in the shell. For a directory as the parameter, this script only gets to the parent directory for the found directory. Add following line into your .bashrc or .zshrc, whatever.. source ~/bin/cdf.sh And add this code into ~/bin/cdf.sh file that you need to create from scratch. #!/bin/bash function cdf() { THEFILE=$1 echo "cd into directory of ${THEFILE}" # For Mac, replace find with mdfind to get it a lot faster. And it does not need args ". -name" part. THEDIR=$(find . -name ${THEFILE} |head -1 |grep -Eo "/[ /._A-Za-z0-9\-]+/") cd ${THEDIR} }
8a64742fdc93c9b0a816996bf3ac5acc84657f88b38faf6d02c83672f2c43cd4
['ac71209ebb92408da6738db85dcfc0ac']
Do a search of "Make Money While You Sleep" and you will find that this idiom is quite popular. (I have not read nor do I endorse this book, but it's the first one that popped up on Amazon.) This phrase would be understood by most Americans as a passive investment that may have taken some effort to get started but continues to pay out, even if one is asleep.
2256598db53c549afbc69d772105014f801b7fa1b0a483a4be3dcff3f1fea520
['ac71209ebb92408da6738db85dcfc0ac']
No! You simply cannot fight space battles like that, except solely fictitious ones. Any type of real-space ranging and detection systems are going to use electromagnetic carrier waves, which can't exceed the speed of light. If the fleets are at such vast distances from each other, the target will have moved a significant distance before your phaser fire can reach it. All your shots will therefore miss. The ships will have to be quite close before opening fire, to overcome this drawback.
c52a68747873d6a7d173179a9430715cd398611e0c23db0ab1016492a171ae7f
['ac78e68a6d274db8b4dac8ce80609a81']
I tried to build a QR Code scanner, when I installed on apk, the buttton didn't appear to the place that supposed to be. Here's my code for the button: <Button android:id="@+id/scan_btn" android:layout_width="127dp" android:layout_height="0dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:layout_marginBottom="359dp" android:layout_marginStart="117dp" android:text="@string/scan" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView2" android:layout_marginLeft="117dp" /> Can someone help me with this?
e3ab71007be27f9ba258fe0b2ae0f04f0ab3ba94b7ff0f88ff6b7429b5213899
['ac78e68a6d274db8b4dac8ce80609a81']
I just follow this tutorial video: https://www.youtube.com/watch?v=Fe7F4Jx7rwo And in the end after we scanned the QR Code, it only show a text even if its a link. How can I change it to clickable link from url that I put from my QR Code? Here's my code that I use in MainActivity: private Button scan_btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); scan_btn = (Button) findViewById(R.id.scan_btn); final Activity activity = this; scan_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { IntentIntegrator Integrator = new IntentIntegrator(activity); Integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES); Integrator.setPrompt("SCAN NOW"); Integrator.setCameraId(0); Integrator.setBeepEnabled(false); Integrator.setBarcodeImageEnabled(false); Integrator.initiateScan(); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if(result != null){ if(result.getContents()==null) { Toast.makeText(this, "You cancelled the scanning", Toast.LENGTH_LONG).show(); } else{ Toast.makeText(this, result.getContents(), Toast.LENGTH_LONG).show(); super.onActivityResult(requestCode, resultCode, data); } }}}
1e8da22b1eeb83675114e741cad00600bed3f58540951be0572afd9decf0759a
['ac7dcee87f904dbdb46aa9b9ba43d2b5']
I created an Aqueduct project using aqueduct create -t db_and_auth but I did not understand how registration and authentication with OAuth 2.0 works. Can someone explain how to register from OAuth2.0 and DB template auto-created by aqueduct and what steps I have to do to register and then authenticate?
a392b47c4bb4f915b809ed336c71558b337f04d09a876ed1a9adc5892ec23358
['ac7dcee87f904dbdb46aa9b9ba43d2b5']
I'm developing an application using Python, Flask and serving with gunicorn and eventlet (worker) but i can't deploy it on Heroku. Locally the application is working fine and in gunicorn too. I tested it using heroku local web and honcho start (foreman for python) and its also working. My Procfile is web: gunicorn --worker-class eventlet -w 1 run:app. When i run it using the 'heroku local web' testing tool, it works fine. I'm using Flask-SocketIO in my project: var socket = io.connect('http://' + document.domain + ':' + location.port) Here's the logs from 'heroku logs --source app': File "/app/.heroku/python/lib/python3.6/site- packages/gunicorn/arbiter.py", line 473, in spawn_worker Traceback (most recent call last): worker.init_process() File "/app/.heroku/python/lib/python3.6/site- packages/gunicorn/workers/geventlet.py", line 30, in init_process super(EventletWorker, self).init_process() File "/app/.heroku/python/lib/python3.6/site- packages/gunicorn/workers/base.py", line 106, in init_process self.run() File "/app/.heroku/python/lib/python3.6/site- packages/gunicorn/workers/geventlet.py", line 49, in run s = GreenSocket(family_or_realsock=sock) File "/app/.heroku/python/lib/python3.6/site- packages/eventlet/greenio/base.py", line 135, in __init__ fd = _original_socket(family, *args, **kwargs) TypeError: __init__() got an unexpected keyword argument 'family_or_realsock'
f408402a9a47c4abdb4c967f743cdd7a2675328216b1c79c69f063180152f7b5
['ac7ec90013b6460bb4dc4a4865b7f3e3']
I want to use HIPS autograd (https://github.com/HIPS/autograd) in Python 2.7 (in Jupyter notebook) to find a parameter x. My forward model (observations at given time points t as a function of the parameter x) is a piecewise function of t. Therefore, I elected to use the autograd.numpy.piecewise function. My loss (or objective) function is a straight-forward mean squared error. I am having trouble computing the automatic gradient using autograd.grad. Simple code example below: import autograd.numpy as anp from autograd import grad def forward_model(x, t): # it's a rectangular box of width x and height 1/x centered at the origin y = anp.piecewise(t, [t < -x/2., (t >= -x/2.) & (t < x/2.), t >= x/2.], [0., 1/x, 0.]) return y def loss(x, t, y): y_hat = forward_model(x, t) return anp.mean( (y_hat - y)**2 ) # mean squared error loss x_star = 1. # ground truth parameter x t = anp.linspace(-1., 1., 1001) # time points to evaluate function y = forward_model(x_star, t) x_init = 0.5 loss_init = loss(x_init, t, y) grad_loss = grad(loss) grad_init = grad_loss(x_init, t, y) The full error I get is: ValueErrorTraceback (most recent call last) <ipython-input-507-e643ed94813b> in <module>() 16 loss_init = loss(x_init, t, y) 17 grad_loss = grad(loss) ---> 18 grad_init = grad_loss(x_init, t, y) C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\wrap_util.pyc in nary_f(*args, **kwargs) 18 else: 19 x = tuple(args[i] for i in argnum) ---> 20 return unary_operator(unary_f, x, *nary_op_args, **nary_op_kwargs) 21 return nary_f 22 return nary_operator C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\differential_operators.pyc in grad(fun, x) 22 arguments as `fun`, but returns the gradient instead. The function `fun` 23 should be scalar-valued. The gradient has the same type as the argument.""" ---> 24 vjp, ans = _make_vjp(fun, x) 25 if not vspace(ans).size == 1: 26 raise TypeError("Grad only applies to real scalar-output functions. " C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\core.pyc in make_vjp(fun, x) 8 def make_vjp(fun, x): 9 start_node = VJPNode.new_root(x) ---> 10 end_value, end_node = trace(start_node, fun, x) 11 if end_node is None: 12 def vjp(g): return vspace(x).zeros() C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\tracer.pyc in trace(start_node, fun, x) 8 with trace_stack.new_trace() as t: 9 start_box = new_box(x, t, start_node) ---> 10 end_box = fun(start_box) 11 if isbox(end_box) and end_box._trace == start_box._trace: 12 return end_box._value, end_box._node C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\wrap_util.pyc in unary_f(x) 13 else: 14 subargs = subvals(args, zip(argnum, x)) ---> 15 return fun(*subargs, **kwargs) 16 if isinstance(argnum, int): 17 x = args[argnum] <ipython-input-507-e643ed94813b> in loss(x, t, y) 6 7 def loss(x, t, y): ----> 8 y_hat = forward_model(x, t) 9 return anp.mean( (y_hat - y)**2 ) # mean squared error loss 10 <ipython-input-507-e643ed94813b> in forward_model(x, t) 2 3 def forward_model(x, t): # it's a rectangular box of width x and height 1/x centered at the origin ----> 4 y = anp.piecewise(t, [t < -x/2., (t >= -x/2.) & (t < x/2.), t >= x/2.], [0., 1/x, 0.]) 5 return y 6 C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\autograd\tracer.pyc in f_wrapped(*args, **kwargs) 46 return new_box(ans, trace, node) 47 else: ---> 48 return f_raw(*args, **kwargs) 49 f_wrapped.fun = f_raw 50 f_wrapped._is_autograd_primitive = True C:\Users\alan_dong\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\lib\function_base.pyc in piecewise(x, condlist, funclist, *args, **kw) 1347 item = funclist[k] 1348 if not isinstance(item, collections.Callable): -> 1349 y[condlist[k]] = item 1350 else: 1351 vals = x[condlist[k]] ValueError: setting an array element with a sequence. I believe it has to do with the funclist argument of numpy.piecewise. When I change the forward model (so that none of the functions depend on x) to y = anp.piecewise(t, [t < -x/2., (t >= -x/2.) & (t < x/2.), t >= x/2.], [0., 1., 0.]) the error goes away. Any ideas? Thanks!
67c61f1ce26c8ea0ff4b431d51c528435016786290ee1f359d209c8ca1a44550
['ac7ec90013b6460bb4dc4a4865b7f3e3']
It seems numpy.piecewise is not supported by autograd. I ended up changing it to an implementation that uses numpy.select, which is computing every function over the entire time window instead of just the region where its condition is active. It seems inefficient, but I suppose the alternative is to write a custom autograd primitive...
efe2c9abac93d0b11e570db2915bd835bfe4fbf9742c4e37d76a8c20a1d7f2b3
['ac805a46f446401694676f141a641ba6']
I get error messages, when compiling my code. The output is next: debug/display.o: In function `ZN7Display5clearEffff': D:\Qt_Projects\TestProj\build-SomeOpenGLTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug/../SomeOpenGLTest/display.cpp:37: undefined reference to `glClearColor@16' D:\Qt_Projects\TestProj\build-SomeOpenGLTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug/../SomeOpenGLTest/display.cpp:38: undefined reference to `glClear@4' D:/Qt_Projects/TestProj/SomeOpenGLTest/lib/SDL2main.lib(./Release/SDL_windows_main.obj):(.text[_main]+0x5): undefined reference to `SDL_SetMainReady' D:/Qt_Projects/TestProj/SomeOpenGLTest/lib/SDL2main.lib(./Release/SDL_windows_main.obj):(.text[_main]+0x12): undefined reference to `SDL_main' D:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: D:/Qt_Projects/TestProj/SomeOpenGLTest/lib/SDL2main.lib(./Release/SDL_windows_main.obj): bad reloc address 0x8 in section `.text[_WinMain@16]' collect2.exe: error: ld returned 1 exit status All I'm trying to do is to connect SDL2 and glew libraries to project and draw some window. My .pro file looks like this: TEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt SOURCES += main.cpp \ display.cpp INCLUDEPATH += $$PWD/include LIBS += -L$$PWD/lib \ -lglew32 \ -lglew32s \ -lSDL2 \ -lSDL2main \ -lSDL2test HEADERS += \ display.h I've got include folder with all .hpp files from libraries and also got lib folder with all .lib files from libraries. I'm pretty sure, that problem is in linking libraries, but just in case give you my class code: display.h #ifndef DISPLAY_H #define DISPLAY_H #include <string> #include <SDL2/SDL.h> class Display { public: Display(int width = 360, int height = 360, const std<IP_ADDRESS>string &title = "Title"); ~Display(); void clear(float r, float g, float b, float a); void update(); bool isClosed() const; private: SDL_Window *mWindow; SDL_GLContext mGLContext; bool mIsClosed; }; #endif // DISPLAY_H display.cpp #include "display.h" #include <GL/glew.h> #include <iostream> Display<IP_ADDRESS>Display(int width, int height, const std<IP_ADDRESS>string &title) { SDL_Init(SDL_INIT_EVERYTHING); SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); mWindow = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL); // Context need in order to OpenGL take control of window from OS mGLContext = SDL_GL_CreateContext(mWindow); GLenum status = glewInit(); if (status != GLEW_OK) { std<IP_ADDRESS>cerr << "Glew failed to initialize!" << std<IP_ADDRESS>endl; } } Display::~Display() { SDL_GL_DeleteContext(mGLContext); SDL_DestroyWindow(mWindow); SDL_Quit(); } void Display<IP_ADDRESS>clear(float r, float g, float b, float a) { glClearColor(r, g, b, a); glClear(GL_COLOR_BUFFER_BIT); } void Display<IP_ADDRESS>update() { SDL_GL_SwapWindow(mWindow); SDL_Event e; while (SDL_PollEvent(&e)) { if (e.type == SDL_QUIT) { mIsClosed = true; } } } bool Display<IP_ADDRESS><IP_ADDRESS>~Display() { SDL_GL_DeleteContext(mGLContext); SDL_DestroyWindow(mWindow); SDL_Quit(); } void Display::clear(float r, float g, float b, float a) { glClearColor(r, g, b, a); glClear(GL_COLOR_BUFFER_BIT); } void Display::update() { SDL_GL_SwapWindow(mWindow); SDL_Event e; while (SDL_PollEvent(&e)) { if (e.type == SDL_QUIT) { mIsClosed = true; } } } bool Display::isClosed() const { return mIsClosed; } Thanks in advance.
356fbb992b5785544395a0dc15f839168751f13b698a8a6e23b051224f26cd9d
['ac805a46f446401694676f141a641ba6']
Considering your response to my question, you should add checking if the tag from the payload isn't already in the database. So it should be something like this: new_one = Article(**payload.article) tags = [] for tag_name in payload.tags: tag = session.query(Tag).filter_by(name=tag_name).first() # tag will be None if it does not exist in the database tags.append(tag if tag else Tag(name=tag_name)) new_one.tags = tags sesion.add(new_one) session.flush() So now you'll be using the existing tag if it's already in the database or create a new one if it's not.
17c18a08bf6b5550b26520f3111ba6d5f1beff661b01204184b4b1019c841dd0
['ac9bf71ec5324ce189336d082b2a8c9f']
The below is my Generator structure. As you see, if I remove the batch normalization, GAN extremely works well. But if I add Batch Normalization at the commented place, it shows only noise. I don't know why. I have tried add BN to generator only or discriminator only or both too. Even when I add only one BN layer into anywhere, it never works. I am trying to fix the source at git https://github.com/rickiepark/deep-learning-with-python-notebooks/blob/master/8.5-introduction-to-gans.ipynb I know it is explained with KOREAN that you guys are not easy to understand but it's very simple source for keras text book. Dense(128 * 16 * 16) LeakyReLU Reshape((16, 16, 128)) Conv2D(256, 5, padding='same') LeakyReLU Conv2DTranspose(256, 4, strides=2, padding='same') # BatchNormalization(momentum=0.8) LeakyReLU Conv2D(256, 5, padding='same') # BatchNormalization(momentum=0.8) LeakyReLU Conv2D(256, 5, padding='same') layers.LeakyReLU layers.Conv2D(3, 7, activation='tanh', padding='same')
319f37b77cbe34bc93814c9e1defa2f81a2ddd841b0f7f2b4825c67841a0d420
['ac9bf71ec5324ce189336d082b2a8c9f']
Hello currently I am working on android and I am stuck to implement the structure picture above. I need to add and delete the CardView in the list. I have tried it with RecyclerView and also used NestedScrollView to avoid double scroll, but I faced a problem that the animation is not available anymore when deletion because when deleting an item, the size of the recyclerView is forcibly reduced by NestedScrollView, so the animation cannot be operated normally. So what I want to know is if there is any way to implement it without NestedScrollView If not, how can I restore the animation working?
61a8ecbb0af9c6cc8a3fc4bc22168721e243c5aa97748a7d27650e19050b93cc
['ac9eddd2d0494cf899d0aa38ada1bab0']
I have a table with just one row and I want to add the other rows dynamicly so obviesley I am using the function clone() so here is the code <table> <th>New SL</th> <th>condition</th> <th>Sl donne</th> <div id="conditions" numTypes="0"> <div class="condition clone" id="lol"> <tr> <td align="center"> <select id="cond[0][new]" class="select-attribut"> <% @attribut.each do |att| %> <option id="<%= att.id %>"><%= att.nom %></option> <% end %> </select> </td> <td align="center"> <select id="cond[0][operation]" class="select-operation"> <% @operation_attribut.each do |op| %> <option id="<%= op.id %>"><%= op.nom %></option> <% end %> </select> </td> <td align="center"> <select id="cond[0][old]" class="select-attribut"> <% @attribut.each do |att| %> <option id="<%= att.id %>"><%= att.nom %></option> <% end %> </select> </td> </tr> <tr id="cond[0][tr_condition]" class="tr_condition"> <td> <select id="cond[0][op_condition]" class="select-operation"> <% @operation_condition.each do |att| %> <option id="<%= att.id %>"><%= att.nom %></option> <% end %> </select> </td> </tr> </div> <tr id="add"> <td align="left"> <button class="btn green plus-cond"><i class="icon-plus"></i></button> </td> </tr> </div> </table> just ignore the <%%> its ruby on rails it is just to fill the option and here is the Jquery code $(".plus-cond").bind("click",function(){ group = $(".clone").clone(); $("#add").before(group); }); but when I am testing it the variable group it contains only the parent div without its children
541c5031efe1aaf5d8c9f307fd4054d4bf8c3d4d8eed6e99c20715bf23f8c420
['ac9eddd2d0494cf899d0aa38ada1bab0']
I have a problem with tomcat every thing works fine when I try to access to tomcat from my pc but when I try using mobile or an other PC from the same LAN I can't get any response here is my connector <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" address="<IP_ADDRESS>" /> I tried also without the attribute adress but it does not work also
c5f91fe2cc403dca5625492deefedd782ead36bde04dba92af68488ef509368c
['acad7ea8bfdd436b97c44ab71a5fa51e']
I was going through HiveMetastoreBridge code in Apache Atlas and encountered few doubts.Pardon me if these questions are very naive. HiveMetastoreBridge code Why are we clearing relationships in findEntity method? What does add referred entity does exactly in the background ? To be clear in toTableEntity method we are adding ObjectId of related entites as attributes as well calling addReferredEntity method of AtlasEntity. In registerInstance method why are we creating references from first entity to other referred entities in else if statement. When will multiple entities be created and why will the first have reference to others? In importTable method why after creating AtlasEntity processInst we are again creating AtlasEntitiesWithExtInfo createTableProcess and adding process entity and path entity to it? Why not Table entity too?
ecf6d596c6b1a6eacdb5f62f9df7fff8014578b193964e826d78ee7dd3c7851f
['acad7ea8bfdd436b97c44ab71a5fa51e']
http://www.spoj.com/problems/LSORT/ It is a problem on spoj It states that You are given a permutation of n numbers that are between 1 to n and having no duplicates. Task is to sort that permutation in ascending order.There is another array Q in which we are inserting elements from given permutation P. You have to implement N steps to sort P. In the i-th step, P has N-i+1 remaining elements, Q has i-1 elements and you have to choose some x-th element (from the N-i+1 available elements) of P and put it to the left or to the right of Q. The cost of this step is equal to x * i. The total cost is the sum of costs of individual steps. After N steps, Q must be an ascending sequence. Your task is to minimize the total cost. Input The first line of the input file is T (T ≤ 10), the number of test cases. Then descriptions of T test cases follow. The description of each test case consists of two lines. The first line contains a single integer N (1 ≤ N ≤ 1000). The second line contains N distinct integers from the set {1, 2, .., N}, the N-element permutation P. Output For each test case your program should write one line, containing a single integer - the minimum total cost of sorting. Now i have figured out the dp My recurrence relation states that for getting most optimal values from elements having value i to j i will have to insert either $i$ at front or $j$ at back. Cost of inserting i at front = dp[i+1][j]+cost of adding element i at front Cost of inserting j at back = dp[i][j-1] +cost of adding element j at back and i have to take minimum of these.answer would be dp[1][n] for(l=1;l<=n;l++) //length of current permutation Q { for(i=1;i<=n-l+1;i++) //starting value of permutation Q { j=i+l-1; //ending value of permutation Q dp[i][j]=min(dp[i+1][j]+l*xi,dp[i][j-1]+l*xj);//chosing wether to insert i at start or j at end } } here xi=index of element i from start of permutation P. and yi=index of element j from start of permutation P. ans would be dp[1][n] But am unable to figure out xi and xj Please help
069d19620590a9ee8d80efae995471048ff185f084c1ced066e3b59bac4c6090
['acb905b9814544cfbfa52f3bdf9071c5']
I have configured all things by going System->Webservices menu, submenus that start with REST.And then I test in myDomainname/api/rest/, but it shows a 404 error like "Request does not match any route". It is shown the guide tutorial in http://www.magentocommerce.com/api/rest/introduction.html here, not fully. I need to show all product list/details, customer details. But I can't understand what is next procedure after configuring/setting up as I am new in Web Service.Will I have to create a custom module or page for Magento1.8 Webservice REST or not. I need total step by step procedure after configuring in System->Webservice->REST.
56aacb92d92f81a10b1f3d52cba78512ead3c5f6da268d6615cae6247be3eb95
['acb905b9814544cfbfa52f3bdf9071c5']
I have downloaded composer and magento2 from git hub. I have also Executed the command “composer install”. And then I am installing magento 2 on my localhost in windows 7 system using Xampp, but unable to install getting error in Step 1 : Readiness Check Error Getting "File Permission Check Server Failed to respond. Please try again". I have googled a lot.After long search, I have found a link https://github.com/magento/magento2/issues/1891, but here,there is no exact solution for Magento2 Installation on Xampp in Windows 7. If any one knows about this issue, Please reply back.
fb56d27c7cf40d50aa985ba6479281eb449fdb0092a5aed5533d4d54764d3a06
['acbcd5759d2e49b4b629afbe765b8b3a']
I have a code here, I want to change font in listview and display it,in listadapter. however, it doesn't help but only show a default number rather than real data. Is this the correct way of change font of my data? ListAdapter adapter = new SimpleAdapter( AllProductsActivity3.this, productsList, R.layout.list_item3, new String[] { TAG_PID, TAG_NAME, TAG_PRICE, TAG_DESCRIPTION}, new int[] { R.id.pid, R.id.username,R.id.p_title, R.id.approval }){ @Override public View getView(int pos, View convertView, ViewGroup parent){ View v = convertView; if(v== null){ LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); v=vi.inflate(R.layout.list_item3, null); } TextView tv = (TextView)v.findViewById(R.id.username); Typeface custom_fontG = Typeface.createFromAsset(getAssets(), "fonts/orange juice 2.0.ttf"); tv.setTypeface(custom_fontG); TextView tv2 = (TextView)v.findViewById(R.id.p_title); Typeface custom_fontH = Typeface.createFromAsset(getAssets(), "fonts/orange juice 2.0.ttf"); tv2.setTypeface(custom_fontH); TextView tv3 = (TextView)v.findViewById(R.id.approval); Typeface custom_fontI = Typeface.createFromAsset(getAssets(), "fonts/orange juice 2.0.ttf"); tv3.setTypeface(custom_fontI); return v; }
231ff5abeda2c6b5376a2dd04630ebd6264e1b808a289cf9708d814cf616a13d
['acbcd5759d2e49b4b629afbe765b8b3a']
I have this function, and I have tried to use toFixed(4) to make the result into 4 decimal points but it's not working. function fncSum() { ParseFloat(document.frmMain.percentage.value).toFixed(4) = (parseFloat(document.frmMain.received.value) + parseFloat(document.frmMain.wronglyc.value))/ parseFloat(document.frmMain.wronglyfiled.value); } Can anyone help me with this one? Change the frmMain value to 4 decimal points.
dc128af15a0246816b3c0f9e63978c339e3a0a8429d31883d34b5f158167eedc
['acccd45144a346de8bb491ba74b9f6ac']
pre-installation: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list sudo apt-get update The error comes from the -y flag: sudo apt-get install -y mongodb-org Instead, you can use: sudo apt-get install mongodb-org and than manualy accept, or to allow unauthenticated by: sudo apt-get install -y --allow-unauthenticated mongodb-org
20050f5febfd953d5b33c0ac43cf6a1490a2dce56781ac009cd3f4d6d65aba38
['acccd45144a346de8bb491ba74b9f6ac']
Finally, I used this solution. The condition to detect if you are authenticated is tal:condition="not: here/portal_membership/isAnonymousUser". So, you can use a stylesheet only for visitors and other stylesheet for authenticated users. Something like that: < style type="text/css" tal:content="string:@import url($portal_url/visitors.css);" media="all" tal:condition="here/portal_membership/isAnonymousUser" /> < style type="text/css" tal:content="string:@import url($portal_url/admin.css);" media="all" tal:condition="not: here/portal_membership/isAnonymousUser" /> Maybe this is not the optimal solution, but it works for me
0bd8e3fcbc71d372e77b1afd9a9d8328bd93d8b2721fc991220fc1a559f96de6
['acd308bcc85e4b5b8e062e5a4c757468']
I think there is a mistake, this line is defined twice (line 28): self.check_box2.stateChanged.connect(self.onStateChange) Therefore the event onStateChange is triggered twice when you check check_box2, which is logical. I think you did a copy paste and the last should be check_box3. But your naming conventions are not intuitive, give your objects some more meaningful names, otherwise how are you going to tell the difference from your code. If what you want is mutually exclusive checkboxes the implementation could be more straightforward. Personally I prefer to use radio buttons like in plain HTML because this is more intuitive (it is immediately obvious that only one answer is allowed). First approach: a generic method that loops on the checkboxes in your form and unchecks all of them except the sender. Then you can simplify code and get rid of if/elif Second approach: use QT built-in features. You could wrap your checkboxes in a QButtonGroup container. A rectangular box before the text label appears when a QCheckBox object is added to the parent window. Just as QRadioButton, it is also a selectable button. Its common use is in a scenario when the user is asked to choose one or more of the available options. Unlike Radio buttons, check boxes are not mutually exclusive by default. In order to restrict the choice to one of the available items, the check boxes must be added to QButtonGroup. and: As mentioned earlier, checkBox buttons can be made mutually exclusive by adding them in the QButtonGroup object. self.bg = QButtonGroup() self.bg.addButton(self.b1,1) self.bg.addButton(self.b2,2) QButtonGroup object, provides abstract container for buttons and doesn’t have a visual representation. It emits buttonCliked() signal and sends Button object’s reference to the slot function btngroup(). Source: PyQt - QCheckBox Widget
5516957e7a16efd52ad5b190216052d94995c8d29e90cb72f14825a9508595ed
['acd308bcc85e4b5b8e062e5a4c757468']
Regarding the possible attack vectors, fair point. I was thinking about **null byte injection**. I am not sure that the `empty` function will always be safe enough. If you provide a null character it seems to return false. POC: `` Output: `bool(false)`. There are quite a few pitfalls with this function, `0` or `'0'` will also return true which is probably not what the coder had in mind in and may cause problems in some edge cases. What seems evident is that it is possible to insert garbage into the database and that is a warning sign.
e1198451b799d73bc272758d1d8b84c54b74896cf57aa7a79a7a967f35698b66
['acd3fa51f2214afaaa35045ce888ffee']
The application has a CPU intensive long process that currently runs on one server (an EJB method) serially when the client requests it. It’s theoretically possible (from a conceptual point of view) to split that process in N chunks and execute them in parallel, as long as the output of all parallel jobs can be collected and joined together before sending it back to the client that initiated the process. I’d like to use this parallelization to optimize performance. How can I implement this parallelization with EJBs? I know that we should not create threads in a EJB method. Instead, we should publish messages (one per job) to be consumed by message driven beans (MDBs). But then it would not be a synchronous call anymore. And being synchronous seems to be a requirement in this case since I need to collect the output of all jobs before sending it back to the client. Is there a solution for this?
6c38d7191aafa570e492c8ac347e046e19228ac108bc43f919437ce930b2d10e
['acd3fa51f2214afaaa35045ce888ffee']
It's not possible. (not from the FileInputStream in the Java API). The FileInputStream constructor does not store this information in any field: public FileInputStream(File file) throws FileNotFoundException { String name = (file != null ? file.getPath() : null); SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(name); } if (name == null) { throw new NullPointerException(); } fd = new FileDescriptor(); open(name); }
6264c3b8af27685ce8d68b2d71018c9c16ddcff639e8e06bbdb4b9e0a82fd6cf
['ace5dd1ab497478f8c1299247cd9a793']
Finally I sort out this situation with the following code : import os import webapp2 import logging import json from google.appengine.api import mail class MainPage(webapp2.RequestHandler): def get(self): #If request comes from the App if self.request.referer == 'Your request.referer' : message = self.request.get('message') #If there is no message or message is empty if not message and len(message) == 0: self.response.headers.add_header('content-type', 'text/plain', charset='utf-8') self.response.out.write('An empty message cannot be submitted') return #Print message logging.info('Message : ' + message) #Set email properties user_address = 'user_address' sender_address = 'sender_address' subject = 'Subject' body = message #Send Email mail.send_mail(sender_address, user_address, subject, body) #If request comes from unknow sources else : self.response.headers.add_header('content-type', 'text/plain', charset='utf-8') self.response.out.write('This operation is not allowed') return app = webapp2.WSGIApplication([('/', MainPage)])
2bb10d2f66bbaf939bc52917d03954ab099b7e76d60a235424d05ab27d2c2370
['ace5dd1ab497478f8c1299247cd9a793']
Need some help please with this error : TypeError: 'unicode' object does not support item assignment Ligne : menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)] = {} def getDishOfTheWeek(): menuDic = Ddict(dict) for menu in Menus.select().where(state = True): menuDic[str(menu.id)]={} menuDic[str(menu.id)]['menuId']=menu.id menuDic[str(menu.id)]['menuName']=menu.name menuDic[str(menu.id)]['menuCountry']=menu.country.name menuDic[str(menu.id)]['menuDishes']={} for d in DishMenuRels.select().where(menu = menu.id).join(Dishes).join(DishTypes).order_by('name') menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)] = {} menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'] = d.dish.dishType.name menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)] = {} menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)]['dishId'] = d.dish.id menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)]['dishState'] = d.dish.name menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)]['dishType'] = d.dish.price menuDic[str(menu.id)]['menuDishes'][str(d.dish.dishType.name)]['dishTypeName'][str(d.dish.id)]['dishName'] = d.dish.country.name print json.dumps(menuDic, indent=5, sort_keys=True) Thanks
584b44f032319543f41cb94b46d9004994c72bb9018843d47ffe0d098298cadc
['ad1509a8b0ee4f219dbc29b788b70285']
I have a read only db that I don't have the ability to change. I know that it is extremely inefficient to store images in a database. However I don't have control over this one. I need to display the image from the field in the database. How can you do this in Django?
eddb2282101d0765ef4ba8a2ac044b231980f400547de3474e31178d7ddaf87b
['ad1509a8b0ee4f219dbc29b788b70285']
I have a obscure database in Django. The database is read only and created by my property managements software. Basically in my view I need to write this query to get a specific record. SELECT * FROM propuserdefinedvalues WHERE propid = propid and userdefinedid = 49 Is there a Django way to execute this instead of having raw SQL? I am looping through the "property" table. These records are in the "userdefinedcalues" table. Here are my models. class Property(models.Model): propid = models.IntegerField(primary_key=True) name = models.CharField(max_length=35L, blank=True) shortname = models.CharField(max_length=6L, blank=True) street1 = models.CharField(max_length=50L, blank=True) street2 = models.CharField(max_length=50L, blank=True) city = models.CharField(max_length=50L, blank=True) state = models.CharField(max_length=2L, blank=True) zip = models.CharField(max_length=50L, blank=True) phone = models.CharField(max_length=21L, blank=True) fax = models.CharField(max_length=50L, blank=True) email = models.CharField(max_length=255L, blank=True) manager = models.CharField(max_length=25L, blank=True) billname1 = models.CharField(max_length=35L, blank=True) billname2 = models.CharField(max_length=35L, blank=True) billstreet1 = models.CharField(max_length=50L, blank=True) billstreet2 = models.CharField(max_length=50L, blank=True) billcity = models.CharField(max_length=50L, blank=True) billstate = models.CharField(max_length=2L, blank=True) billzip = models.CharField(max_length=50L, blank=True) proptaxid = models.CharField(max_length=35L, blank=True) rentchargetype = models.CharField(max_length=20L, blank=True) lastpostdate = models.DateField(null=True, blank=True) lastweeklypostdate = models.DateField(null=True, blank=True) comments = models.CharField(max_length=25L, blank=True) enablespeciallatecharge = models.IntegerField(null=True, blank=True) fixedlatecharge = models.IntegerField(null=True, blank=True) fixedlateamount = models.FloatField(null=True, blank=True) fixedlaterentonly = models.IntegerField(null=True, blank=True) percentlate = models.IntegerField(null=True, blank=True) percentlateamount = models.FloatField(null=True, blank=True) percentlatefullcharge = models.IntegerField(null=True, blank=True) percentlaterentonly = models.IntegerField(null=True, blank=True) perdaylate = models.IntegerField(null=True, blank=True) perdaylateamount = models.FloatField(null=True, blank=True) perdaylategrace = models.IntegerField(null=True, blank=True) perdaylategracenum = models.IntegerField(null=True, blank=True) perdatelatelimitamount = models.FloatField() perdaylategracenonretro = models.IntegerField() perdaylategraceexclweekends = models.IntegerField() perdaylategraceexclholidays = models.IntegerField() datecreated = models.DateTimeField(null=True, blank=True) updated = models.DateTimeField(null=True, blank=True) userid = models.IntegerField(null=True, blank=True) logofile = models.CharField(max_length=255L, blank=True) merchantid = models.CharField(max_length=255L, blank=True) epaybankid = models.IntegerField() epaylimit = models.FloatField() epayenabled = models.IntegerField() achconveniencefeeenabled = models.IntegerField() ccconveniencefeeenabled = models.IntegerField() rwaachconvenciencefeeenabled = models.IntegerField() rwaccconveniencefeeenabled = models.IntegerField() epayislimited = models.IntegerField() epayusedefaults = models.IntegerField() achconveniencefee = models.FloatField(null=True, blank=True) ccconveniencefee = models.FloatField(null=True, blank=True) rwaachconveniencefee = models.FloatField(null=True, blank=True) rwaccconveniencefee = models.FloatField(null=True, blank=True) epaychargetype = models.IntegerField() epayamounttype = models.IntegerField() epaysetamount = models.FloatField() epaycustlimit = models.FloatField() sqft = models.IntegerField() lateminbalance = models.FloatField(null=True, blank=True) defaultbank = models.IntegerField() postday = models.IntegerField(null=True, blank=True) active = models.IntegerField(null=True, blank=True) iscommercial = models.IntegerField(null=True, blank=True) assignedissueuserid = models.IntegerField(null=True, blank=True) class Meta: db_table = 'property' class Propuserdefined(models.Model): id = models.IntegerField(primary_key=True) userdefinedid = models.IntegerField(primary_key=True) name = models.CharField(max_length=50L, blank=True) type = models.IntegerField() userid = models.IntegerField(null=True, blank=True) updated = models.DateTimeField(null=True, blank=True) datecreated = models.DateTimeField(null=True, blank=True) combolist = models.TextField(blank=True) class Meta: db_table = 'propuserdefined' class Propuserdefinedvalues(models.Model): userdefinedid = models.ForeignKey(Propuserdefined) propid = models.ForeignKey(Property) value = models.TextField(blank=True) userid = models.IntegerField(null=True, blank=True) updated = models.DateTimeField(null=True, blank=True) datecreated = models.DateTimeField(null=True, blank=True) class Meta: db_table = 'propuserdefinedvalues' Here is my view def properties(request): properties = Property.objects.all().order_by('state') altname = SELECT * FROM propuserdefinedvalues WHERE propid = 73 and userdefinedid = 49 return render_to_response('properties/index.html', {'properties':properties, }, context_instance=RequestContext(request)) Here is my template {% for property in properties %} {{ altname }}<br><br> {% endfor %} Thanks in advance for your help. <PERSON>
ac157a16aa6aa6f3de1adceff4fa8394192f457fbe48af74735624fa9bbf5f0d
['ad176a8b2d5c452d8af0a3f7f3bfe659']
But we don't know how the quality of medieval mail would compare to the mail which was used in the test, which was the finest modern day mail available. The historical evidence shows that throughout medieval times, knights and men-at-arms wearing mail and/or plate armor were killed in large numbers by archers with longbows
71638cfd9623eadb7d3bf78ae90d80f3901a71306231c30f8f49783a8ae638e2
['ad176a8b2d5c452d8af0a3f7f3bfe659']
That is a good point. A whole diocese could almost go under because the local bishop's blessed water "doesn't, uhm.. work anymore." It wouldn't be quite the same as in the Middle Ages until the world had a good handle on the Vamp problem. The government would have a hard time appointing its own favorite, corrupt bishops too. It could be very chaotic for the Church too as things could change very rapidly. An interesting though: Someone could attempt to remove a good bishop by replacing the water he blessed (which is then distributed to the diocese) with regular water..
9afc391021ac7b7d2ebc5d810870de176be7942287f2da3898f76bf631f89eff
['ad1a01c36b3747c789db98cb36adb4c4']
I apologize in advance if this is not the correct place to ask this question (please kindly inform me if this is the case) but I'm wondering what the easiest way to save SO favorites to Evernote would be (both old ones and new ones). So there are really two questions here: (1) How do I most easily save all existing SO favorites to Evernote? (this is perhaps the trickier of the two) (2) Is there a clean way to automatically save new SO favorites to Evernote (IFTTT style), or would it be easiest to simple favorite the item AND webclip it each time (not ideal but one potential solution that comes to mind). Would love to hear your input.
02141327a309727cffa532d547191e500637f84744aaf8cf444032c7a85a5e84
['ad1a01c36b3747c789db98cb36adb4c4']
I understand that it needs to be clear, but I disagree wholeheartedly that it is not already so. For anyone with subject matter expertise, it is obvious that Heroku + clockwork is a no-brainer. So asking "How do I do the same thing, but with AWS", does not require additional detail. The first commenter on the post certainly didn't have any trouble interpreting the "realness" of the question...
ffd5d46993d82f43922140f0173010996722e541790009da8e4872883c125ea6
['ad3810e72c694c1f9239934ca243cb42']
@ElectronSurf it may be that <PERSON> is redirecting you if you're not in the same country as me? That's not the whole schematic, just the regulator section. The plot thickens.. it appears that the additional current is further down the line somewhere, but only when this regulator is used. The only other significant component I have down the line is a CP2102. RDTSC - Scoping the power lines doesn't show anything unruly. I wonder if the CP2102 isn't going into suspend properly.
913edb657c1680ac29a9f24b232447278fa7123b496a2b416f1f0855aa7cce3c
['ad3810e72c694c1f9239934ca243cb42']
<PERSON> I don't but it's very similar to a 540; it's in a small submersible motorhome water pump. The problem appears to be with a few different pumps of a similar size. I would have thought a large starting current would be worse when I hard-started the motor rather than soft start with a voltage ramp?
b38593631d38fe5f8aa69513e875a965d7c06e0595fb9740d756e94176171340
['ad3d8855a01343009e1187237314c40d']
Spring's aim was to ease programming complexities in the java world. As a JAVA programmer your wish is not surprising :) Spring provides wrapper around standard specifications in JAVA like JTA, JDO, JDBC, etc. Whereas JCo is just a connector API provided by SAP to transact with SAP internal objects and interfaces. Currently, to my knowledge Spring does not provide any support for JCo. JCo3 supports JCoContext for stateful connections, which is of little help but not to the extent what you may need. You may actually need to implement JCoServerTIDHandler and one more interface from the same package (I don't exactly remember) for effective control over transaction management. Eventually, it will mean implementing Java Connector Architecture (JCA). This will be the right solution for your problem. Hope, this helps.
040ab486895548e841d2b68d797f7c2a9d4edcfa8212b3f3bd88810bef7f76d4
['ad3d8855a01343009e1187237314c40d']
If it is a regular development approach, you should ideally look at the API of the component class. If you are using metadata driven approach for development and you might generate the required code then you should fetch details from metadata information provided by the class or read it from .js file. ".js" will be helpful if you are not using SAPUI5 runtime. Hope, this helps. ......... Good Luck
cba77b9bf2c05ec78c87e7dd20bcd1be0fd4d47942ec5dda598ae0feba188212
['ad4f38e8eb744bc794b2c1d14795d6b2']
Is there an R package with a function that can: (1) simulate the different values of an interaction variable, (2) plot a graph that demonstrates the effect of the interaction on Y for different values of the terms in interaction, and (3) works well with the models fitted with the lmer() function of the lme4 package? I have looked in arm, ez, coefplot2, and fanovaGraph packages, but could not find what I was looking for.
0e0e6e0d1e4c45d9becbe802efd15b0e0e67d64fae908e53a28332a43ee274bf
['ad4f38e8eb744bc794b2c1d14795d6b2']
Imagine a small data set like the one below, composed of three variables: v1 <- c(0, 1, NA, 1, NA, 0) v2 <- c(0, 0, NA, 1, NA, NA) v3 <- c(1, NA, 0, 0, NA, 0) df <- data.frame(v1, v2, v3) df v1 v2 v3 1 0 0 1 2 1 0 NA 3 NA NA 0 4 1 1 0 5 NA NA NA 6 0 NA 0 One can use the is.na command as follows to calculate the number of rows with at least one missing value - and R would return 4: sum(is.na(df$v1) | is.na(df$v2) | is.na(df$v3)) Or the number of rows with all three values missing - and R would return 1: sum(is.na(df$v1) & is.na(df$v2) & is.na(df$v3)) Two questions at this point: (1) How can I calculate the number of rows where "exactly one" or "exactly two" values are missing? (2) If I am to do the above in a large data set, how can I limit the scope of the calculation to v1, v2 and v3 (that is, without having to create a subset)? I tried variations of is.na, nrow and df, but could not get any of them to work. Thanks!
0eb0afedf033c0fc36843e8204ac7c2adffede85cb78a851dd60670340ed4937
['ad6c3129b75a44cf857802a8d2d3c1cb']
The Motor does have a wire for speed feedback which will be used when I start implementing my control system. I just wanted to make sure that I can actually control the motor's speed, and when I got this weird behaviour I though that I was doing something wrong!
aa87357034973c1a07bd81d329c33bf8d694df3c82d22aa9015dd69b3d0323be
['ad6c3129b75a44cf857802a8d2d3c1cb']
So I have been given a circuit which supposedly works. The circuit was the the one shown but with a 10k resistor where the scribbles are. Q17 is an IRLM6344TRPbF N-chanel MOSFET and Q16 is a ZXMP6A17G P-channel MOSFET This didn't work at first until I removed the scribbled out resistor. After I managed to get it to actually change the output voltage dependant on the PWM signal that is applied, I encountered a weird problem. The problem was that there was a weird correlation between the PWM duty cycle and the output voltage. When the duty cycle is between 0-30% the output voltage is ranging from 0-11 V and then increasing the duty cycle from 30% to 100% slightly increases the voltage until an output voltage of 11.8 V is achieved. Can anyone explain why that is the case or what I am misunderstanding/doing wrong?
9aae577ae054114c391e85a4d98b531a9daeb239f041e50fcfb4c161ecda0e12
['ad7b3c61e7414a96819ff24e0ebfcaa3']
I am doing some detection work using OpenCV, and I need to use the distance transform. Except the distance transform function in opencv gives me an image that is exactly the same as the image I use as source. Anyone know what I am doing wrong? Here is the portion of my code: cvSetData(depthImage, m_rgbWk, depthImage->widthStep); //gotten openCV image in "depthImage" IplImage *single_channel_depthImage = cvCreateImage(cvSize(320, 240), 8, 1); cvSplit(depthImage, single_channel_depthImage, NULL, NULL, NULL); //smoothing IplImage *smoothed_image = cvCreateImage(cvSize(320, 240), 8, 1); cvSmooth(single_channel_depthImage, smoothed_image, CV_MEDIAN, 9, 9, 0, 0); //do canny edge detector IplImage *edges_image = cvCreateImage(cvSize(320, 240), 8, 1); cvCanny(smoothed_image, edges_image, 100, 200); //invert values IplImage *inverted_edges_image = cvCreateImage(cvSize(320, 240), 8, 1); cvNot(edges_image, inverted_edges_image); //calculate the distance transform IplImage *distance_image = cvCreateImage(cvSize(320, 240), IPL_DEPTH_32F, 1); cvZero(distance_image); cvDistTransform(inverted_edges_image, distance_image, CV_DIST_L2, CV_DIST_MASK_PRECISE, NULL, NULL); In a nutshell, I grad the image from the kinect, turn it into a one channel image, smooth it, run the canny edge detector, invert the values, and then I do the distance transform. But the transformed image looks exactly the same as the input image. What's wrong? Thanks!
bc7afbf55be088fd9e6647c79e439594e7c78ee01924b9acfebea9e79ca684f2
['ad7b3c61e7414a96819ff24e0ebfcaa3']
okay.. I have had a lot of trouble in this myself. You need to look int the opencv folder structure that you installed for these header files yourself. Sometimes they're not in the place the install guide tells you they are. In my computer for example, most of the header files I needed are in: [INSTALL DIRECTORY]/include/opencv [INSTALL DIRECTORY]/include/opencv2 but SOME were in: [INSTALL DIRECTORY]/modules/core/include/opencv2 [INSTALL DIRECTORY]/modules/highgui/include/opencv2 etc you need to find those include files. Then go to your IDE (eclipse). In eclopse there should be a setting for the "include directories" Set your IDE to look for include files in the directories where you know the include files are. Then make sure you add the libraries. Ask if you need help with that.
e32a7d4f54a84bee5e4068cef48d064730b4ff1dac0eedd8eac9e2f333ddc87a
['ad8e4ebb92344fabaa5f545afa2829d0']
@psaxton That one's really common, and makes a lot of sense if you think about it. When you point to yourself and say "me" and point to the child and say "you", they treat the words "me" and "you" the same as they think of names. From my perspective, I am "me", and you are "you", but from your perspective, you are "me" and I am "you". It takes a bit to learn that concept. (And I am the walrus?)
56fd364ba70e37e90299f7c712c1498eb2d6f7029957b5508e0955fdc141d480
['ad8e4ebb92344fabaa5f545afa2829d0']
Dropbox uses https://github.com/rentzsch/mach_inject to inject code into the Finder process to change the overlay. This is TRICKY BUSINESS. Finder in 10.6 can be hacked with a [SIMBL](https://code.google.com/p/simbl/wiki/Tutorial) plugin , you just have to use the swizzling method to reimplement the drawWithFrame method in the Finder.
ffc5571b0de9074c7b7a7cd73e0917ddfc4e83e0422f224792958660eb0ff969
['ad9429ae6e2240fe92548d8b1caed940']
I'm not 100% sure, how the trailing slash affects cp, mv, rm, though it my experience it doesn't have any practical effect. e.g. running cp -r dir1 dir2 will give you the same result as cp -r dir1/ dir2 It definitely matters for rsync. In rsync the difference between including and omitting the trailing slash is the difference between syncing the contents of the directory or the directory itself and the contents. e.g. rsync -a dir1 dir2 will create a dir1 under dir2 while rsync -a dir1/ dir2 will create copies of any files in dir1 directly in dir2
41c6137ff286a0c3307720f00530134cffab605e924196cf97af0e59c8f141fe
['ad9429ae6e2240fe92548d8b1caed940']
The solution was pretty simple, actually. I just needed to specify the path of the php-cli that I wanted to use and where the composer.phar file was located. So I added the following to my depoly.rb script for Capistrano: SSHKit.config.command_map[:composer] = "/usr/local/php56/bin/php-cli ~/composer.phar"
41f097029b6126a0f018eaecf4516869065da4a900eacecbd5bc85ad85186bc1
['ad99b1d6e3fc41d089827893e55556e1']
i have strange errors got from my flutter pages do some math computation with null value. or i assume it was makes errors happening. in my case i do computation such as (120 * null) inside stateful widget init section. when i build in release mode. I have debug view which means it read background in my apps and shows: NoSuchMethodError: The method '_mulFromInteger' was called on null. Receiver: null Tried Calling:_mulFromInteger(134) is multiply operations (*) have method behind of it? or can anyone explain what is _mulFromInteger?
ca6905efc572c89b02e3921c7b8fd31e20af2c75253a1dda3be1c2f3748a35e5
['ad99b1d6e3fc41d089827893e55556e1']
i try to get FragmentManager in my android flutter plugin. In my case i need v4.app.FragmentManager. but in PluginRegistry Registrar. i just get app.FragmentManager from Registrar.activity().fragmentManager Since i use FlutterFragmentActivity which extend v4.app.FragmentActivity, you can see the code in here. So i think it's possible to get v4.app.FragmentManager(). anyone have idea how to reach that ?
49d9d7287508b591c1a3e5491215c4a81d195684c89086054e1de51da3ca93a0
['ada4eb11c97944b3a6fa53d7135d494d']
now i know that its not posible. I found an answer in some docu then i add this code to my Module.php public function onBootstrap(MvcEvent $e) { $this->initAcl($e); $e->getApplication()->getEventManager()->attach('route', array($this, 'checkAcl')); } public function initAcl(MvcEvent $e) { $acl = new \Zend\Permissions\Acl\Acl(); $roles = array( 'guest'=> array( //functions that the user can access 'registration', 'home', ), 'admin'=> array( 'registration', ), ); $allResources = array(); foreach ($roles as $role => $resources) { $role = new \Zend\Permissions\Acl\Role\GenericRole($role); $acl->addRole($role); $allResources = array_merge($resources, $allResources); //adding resources foreach ($resources as $resource) { if(!$acl->hasResource($resource)) $acl->addResource(new \Zend\Permissions\Acl\Resource\GenericResource($resource)); } //adding restrictions foreach ($resources as $resource) { $acl->allow($role, $resource); } } $e->getViewModel()->acl = $acl; } public function checkAcl(MvcEvent $e) { $route = $e -> getRouteMatch() -> getMatchedRouteName(); //you set your role $userRole = 'guest'; //if (!$e -> getViewModel() -> acl -> isAllowed($userRole, $route)) { if ($e -> getViewModel()->acl->hasResource($route) && !$e->getViewModel()->acl->isAllowed($userRole, $route)) { $response = $e -> getResponse(); //location to page or what ever $response -> getHeaders()->addHeaderLine('Location', $e -> getRequest() -> getBaseUrl() . '/404'); $response -> setStatusCode(404); } }
c3caa6d6b66eb93c4060ee17947005021d3ee68fabbf24d6107818fe70e3f94a
['ada4eb11c97944b3a6fa53d7135d494d']
I need to rename the file on file upload and inserting to the database. I search for ways but i can't find the right code. I tried to use callback but it did not work. Here's my code: public function home() { $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('blog_post'); $crud->set_field_upload('post_image',UPLOAD_PATH); $crud->callback_before_upload(array($this,'_before_upload')) $crud->callback_before_insert(array($this,'rename_img_db')); $output = $crud->render(); $this->_example_output($output); } function rename_img_db($post_array) { if (!empty($post_array['post_image'])) { $ext = end(explode(".",$post_array['post_image'])); $img_name = $post_array['post_image'] = mktime().".".$ext; $post_array['post_image'] = $img_name; } return $post_array; } function _before_upload($files_to_upload,$field_info) { foreach($files_to_upload as $value) { $ext = pathinfo($value['name'], PATHINFO_EXTENSION); $rename = $value['name']; } $allowed_formats = array("jpg","gif","png","doc","docx","pdf"); if(in_array($ext,$allowed_formats)) { return true; } else { return 'Wrong file format'; } if ($rename) { $ext1 = end(explode(".",$rename)); $img_name = $rename = mktime().".".$ext1; $rename = $img_name; return $rename; } }
b9569c08b134d1d5bd97f9b880ee924d2b2ee59b04035fd4c2a3ca97f20b1d5f
['adce39e9a1a947589a7020cb647d2d81']
There is complicated MySql SELECT query: SELECT id, login, date... FROM tab1 LEFT JOIN tab2 LEFT JOIN tab3 LEFT JOIN tab4 ... WHERE condition1 = value condition2 = value ... ORDER ... LIMIT ... I need to get the number of results from same select but without condition1 and limit. What is the best solution? Is there better solution than just make 2 SELECT query?
856ce684e4fc8fc839ca3cee230335ee8c81cf04b12080a3e8efe92463ed4f1e
['adce39e9a1a947589a7020cb647d2d81']
I have a qTip tooltip where I'm loading its content via ajax. After the content is loaded I need to call a function someFunction() $('.element').qtip( { content: { text: function(event, api) { api.elements.content.text('Loading...'); var content = $.ajax( { url: 'loadcontent.php', dataType: 'json' }) .then(function(result) { // Some code for changing result html return result.html; }, function(xhr, status, error) { api.set('content.text', 'Error'); }); // Calling a function, but it's too early (content is still not in the tooltip) someFunction(); return content; } } }); To be honest I'm not sure where to put someFunction() so it's called after the content is added into the tooltip. There is no event which is fired after the content is changed.
6dc8b98addafdfdc898a73500e36e0b9c98c4f26a4e7164d9759a66f5d15a3e1
['adcfe949bb544efbbf961fc62975c154']
in order to get started with <PERSON> I am trying to construct a very simple function that gets me the a posterior distribution: grid_length = 20 k_successes = 6 n_trials = 9 prior = ones(grid_length) function plot_posterior(grid_length<IP_ADDRESS>Int64 , k_successes<IP_ADDRESS>Int64 , n_trials<IP_ADDRESS>Int64 , prior<IP_ADDRESS>Any = nothing ) # define grid, possible parameter values ( our paremeter is the probability of success vs failure) p_grid = collect(range(0, 1, length = grid_length)) # define uninformative prior if it is not specified if isnothing(prior) prior = ones(grid_length) end # compute likelihood at each value in grid likelihood = [prob_binomial(k_successes , n_trials , prob) for prob in p_grid] # compute product of likelihood and prior unstd_posterior = likelihood .* prior # standardize the posterior, so it sums to 1 posterior = unstd_posterior ./ sum(unstd_posterior) x = p_grid; y = posterior Plots.plot(x, y) end when I try plot_posterior(grid_length=20 , k_successes=6 , n_trials=10 , prior = nothing ) I get the following error : MethodError: no method matching plot_posterior(; grid_length=20, k_successes=6, n_trials=10, prior=nothing) Closest candidates are: plot_posterior(!Matched<IP_ADDRESS>Int64, !Matched<IP_ADDRESS>Int64, !Matched<IP_ADDRESS>Int64) at In[6]:9 got unsupported keyword arguments "grid_length", "k_successes", "n_trials", "prior" plot_posterior(!Matched<IP_ADDRESS>Int64, !Matched<IP_ADDRESS>Int64, !Matched<IP_ADDRESS>Int64, !Matched<IP_ADDRESS>Any) at In[6]:9 got unsupported keyword arguments "grid_length", "k_successes", "n_trials", "prior" plot_posterior(!Matched<IP_ADDRESS>Any, !Matched<IP_ADDRESS>Any, !Matched<IP_ADDRESS>Any) at In[3]:9 got unsupported keyword arguments "grid_length", "k_successes", "n_trials", "prior" ... Any help on what may be happening ? Thanks in advance
6d6d2d14f21cc05678d94864c1ca3b71143a841e9504bba682ed64288b511c78
['adcfe949bb544efbbf961fc62975c154']
I am trying to count the number of rows by group in a DataFrame. The following code generates a new column, called x1, which which has the intended information: by(df, [:grouping_var_1, :grouping_var_2], nrow) However, I am not aware on how to generate such column in a way I can define a name other than x1. The solution I have found so far is: @pipe df |> by(_, [:grouping_var_1, :grouping_var_2], nrow) |> rename(_, :x1 => :my_desired_name); Is there anyway I could do this directly without having to use rename ? Thanks in advance.
375392d830d1df4861f9fee590a61394c4011c497976f2f32dd9bf6b7eab63a6
['ade140ddbfa5445a8d421735293f4db5']
Unfortunately you cannot define an anonymous struct and then initialize it un-anonymously. If you want to do that, you have to type out the entire struct all over again. This way is easier. package main import ( "fmt" ) type Circuit struct { RemedyCircuitID string `json:"RemedyCircuitId"` Status string `json:"Status"` VendorName string `json:"VendorName"` VendorCommunityID int `json:"VendorCommunityId"` CommunityID int `json:"CommunityId"` ZLocCommunityID int `json:"ZLocCommunityId"` CircuitType string `json:"CircuitType"` InstalledSpeed string `json:"InstalledSpeed"` CircuitID string `json:"CircuitId"` CircuitSpeed string `json:"CircuitSpeed"` CircuitFunction string `json:"CircuitFunction"` ContractID string `json:"ContractId"` ALocName string `json:"ALocName"` ZLocName string `json:"ZLocName"` ExpectedMonthlyCircuitCost string `json:"ExpectedMonthlyCircuitCost"` ExpectedOneTimeCircuitCost string `json:"ExpectedOneTimeCircuitCost"` TotalCost string `json:"TotalCost"` CustomerMakeReadyComplete string `json:"CustomerMakeReadyComplete"` CarrierOriginalDueDate string `json:"CarrierOriginalDueDate"` CarrierCurrentDueDate string `json:"CarrierCurrentDueDate"` CarrierCompletion string `json:"CarrierCompletion"` EnaTurnUpDate string `json:"EnaTurnUpDate"` SiteVisit string `json:"SiteVisit"` DisconnectRequested string `json:"DisconnectRequested"` DisconnectEffective string `json:"DisconnectEffective"` } type Error struct { ErrorCode string `json:"ErrorCode"` FieldName string `json:"FieldName"` Message string `json:"Message"` } type ResponseStatus struct { ErrorCode string `json:"ErrorCode"` Message string `json:"Message"` StackTrace string `json:"StackTrace"` Errors []Error `json:"Errors"` } type RemedyCircuitsResp struct { Circuits []Circuit `json:"Circuits"` ResponseStatus ResponseStatus `json:"ResponseStatus"` } func main() { fmt.Printf("%#v\n", RemedyCircuitsResp{ Circuits: []Circuit{{}, {}, {}, {}}, }) } Alternatively you have to do something like this: package main import ( "fmt" ) type RemedyCircuitsResp struct { Circuits []struct { RemedyCircuitID string `json:"RemedyCircuitId"` Status string `json:"Status"` VendorName string `json:"VendorName"` VendorCommunityID int `json:"VendorCommunityId"` CommunityID int `json:"CommunityId"` ZLocCommunityID int `json:"ZLocCommunityId"` CircuitType string `json:"CircuitType"` InstalledSpeed string `json:"InstalledSpeed"` CircuitID string `json:"CircuitId"` CircuitSpeed string `json:"CircuitSpeed"` CircuitFunction string `json:"CircuitFunction"` ContractID string `json:"ContractId"` ALocName string `json:"ALocName"` ZLocName string `json:"ZLocName"` ExpectedMonthlyCircuitCost string `json:"ExpectedMonthlyCircuitCost"` ExpectedOneTimeCircuitCost string `json:"ExpectedOneTimeCircuitCost"` TotalCost string `json:"TotalCost"` CustomerMakeReadyComplete string `json:"CustomerMakeReadyComplete"` CarrierOriginalDueDate string `json:"CarrierOriginalDueDate"` CarrierCurrentDueDate string `json:"CarrierCurrentDueDate"` CarrierCompletion string `json:"CarrierCompletion"` EnaTurnUpDate string `json:"EnaTurnUpDate"` SiteVisit string `json:"SiteVisit"` DisconnectRequested string `json:"DisconnectRequested"` DisconnectEffective string `json:"DisconnectEffective"` } `json:"Circuits"` ResponseStatus struct { ErrorCode string `json:"ErrorCode"` Message string `json:"Message"` StackTrace string `json:"StackTrace"` Errors []struct { ErrorCode string `json:"ErrorCode"` FieldName string `json:"FieldName"` Message string `json:"Message"` } `json:"Errors"` } `json:"ResponseStatus"` } func main() { value := RemedyCircuitsResp{ Circuits: []struct { RemedyCircuitID string `json:"RemedyCircuitId"` Status string `json:"Status"` VendorName string `json:"VendorName"` VendorCommunityID int `json:"VendorCommunityId"` CommunityID int `json:"CommunityId"` ZLocCommunityID int `json:"ZLocCommunityId"` CircuitType string `json:"CircuitType"` InstalledSpeed string `json:"InstalledSpeed"` CircuitID string `json:"CircuitId"` CircuitSpeed string `json:"CircuitSpeed"` CircuitFunction string `json:"CircuitFunction"` ContractID string `json:"ContractId"` ALocName string `json:"ALocName"` ZLocName string `json:"ZLocName"` ExpectedMonthlyCircuitCost string `json:"ExpectedMonthlyCircuitCost"` ExpectedOneTimeCircuitCost string `json:"ExpectedOneTimeCircuitCost"` TotalCost string `json:"TotalCost"` CustomerMakeReadyComplete string `json:"CustomerMakeReadyComplete"` CarrierOriginalDueDate string `json:"CarrierOriginalDueDate"` CarrierCurrentDueDate string `json:"CarrierCurrentDueDate"` CarrierCompletion string `json:"CarrierCompletion"` EnaTurnUpDate string `json:"EnaTurnUpDate"` SiteVisit string `json:"SiteVisit"` DisconnectRequested string `json:"DisconnectRequested"` DisconnectEffective string `json:"DisconnectEffective"` }{{}, {}, {}, {}}, } fmt.Printf("%#v\n", value) }
9ecb27735f2e757ddf554260322933a7184db8a94759e04fb00efc22596d3651
['ade140ddbfa5445a8d421735293f4db5']
For full disclosure I don't know google analytics internals so if someone does, they may know something I don't. However, I do know browser mechanics pretty well and what you are doing is impossible due to security restrictions. One way of doing this, assuming both of the domains (windows) are going to be running within the same browser session, is using message passing window.postMessage(). This is however slightly restrictive because the second window must be open and listening to incoming messages before you post the message. window.addEventListener('message', function _handler(event) { // Code for handling the message // This will automatically remove the listener after receiving one message. // Good for when you send only one message and don't want the listener lingering and eating up memory. window.removeEventListener('message', _handler); }); If you are dealing with a situation where this is not going to be running within the same browser you will have setup some kind of "shared memory" in the form of a simple backend server/service.
8ffb30bd89920cb62b5fc8b726daaef3bf76e039427dfb03319ee87a730b6acd
['ade343e772e14e0e84779ab4be23c721']
What is the proper way for where condition if i need to get rows in range for today and e.g. for yesterday? I mean something like this: Model.where("created_at ? OR created_at ?", Time.now - 3.hours..Time.now + 3.hours, Time.now - 1.day - 3.hours..Time.now - 1.day + 3.hours)
9f724c399cf75ab7d123ed040d3d0cd6d81a41987140a41506048976010cb709
['ade343e772e14e0e84779ab4be23c721']
This could be possible if you have another gem in Gemfile which have dependency on activerecord. In your case it's rails so you can just leave it here. GEM remote: https://rubygems.org/ specs: ... rails (<IP_ADDRESS>) actionmailer (= <IP_ADDRESS>) actionpack (= <IP_ADDRESS>) actionview (= <IP_ADDRESS>) activejob (= <IP_ADDRESS>) activemodel (= <IP_ADDRESS>) activerecord (= <IP_ADDRESS>)
6de7470e74f5588c252f764c9edd78eb452be70a69c4938f1e1762562fee4ac4
['adefb12089b342e8b91c7449cefec10b']
I wonder if writing a check representation function for an object and calling it while testing is enough to check the object's internal state corectness or should I also put assertions inside methods? Or maybe I should only use assertions inside methods and just don't include them in production version to not slow my app down?
c45601e602f6855a361983dae81928c427539c68b166008696fc1679d0dfba53
['adefb12089b342e8b91c7449cefec10b']
I'm using swiftmailer to send emails. User is able to pick an attachment. The problem is that even with 1KB attachment, the script is running for more than 30 seconds which causes fatal error. I'm using XAMPP and smtp.gmail.com to send messages. tmp_path seems correct. Here's my code: require_once '../mailer/lib/swift_required.php'; sendMessage(); function validate($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } function sendMessage() { $SEND_MAIL_TO = "<EMAIL_ADDRESS>"; $MAILER_FROM = "<EMAIL_ADDRESS>"; $MAILER_USERNAME = "<EMAIL_ADDRESS>"; $MAILER_PASSWORD = "***"; $MAILER_SMTP = "smtp.gmail.com"; $MAILER_SMTP_PORT = 465; $MAILER_SMTP_USE_SSL = true; if (!isset($_POST["sent"])) return; $name = validate($_POST["name_text"]); $email = validate($_POST["email_text"]); $phone = validate($_POST["phone_text"]); $interest = validate($_POST["interest_text"]); $language = validate($_POST["language_text"]); $message = validate($_POST["message_text"]); if (empty($name) || empty($email)) { echo "<p><strong style=\"color: red\">Please fill in the required fields!</strong></p>"; return; } if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "<p><strong style=\"color: red\">Please fill in a correct email address!</strong></p>"; return; } $message = Swift_Message<IP_ADDRESS>newInstance() ->setSubject("Contact by form: ".$name." ".$interest." ".$language) ->setFrom(array($MAILER_FROM)) ->setTo(array($SEND_MAIL_TO)) ->setBody($message); echo "Path: ".$_FILES["attachment_text"]["tmp_name"]; $attachement = Swift_Attachment<IP_ADDRESS>fromPath($_FILES["attachment_text"]["tmp_name"], $_FILES["attachment_text"]["type"]); $attachement->setFilename($_FILES["attachment_text"]["name"]); $message->attach($attachement); if (!$MAILER_SMTP_USE_SSL) $transport = Swift_SmtpTransport<IP_ADDRESS>newInstance($MAILER_SMTP, $MAILER_SMTP_PORT); else $transport = Swift_SmtpTransport<IP_ADDRESS>newInstance($MAILER_SMTP, $MAILER_SMTP_PORT, 'ssl'); $transport->setUsername($MAILER_USERNAME); $transport->setPassword($MAILER_PASSWORD); $mailer = Swift_Mailer<IP_ADDRESS>newInstance($transport); $result = $mailer->send($message); if ($result == 1) echo "<p><strong style=\"color: green\">Your message is sent!</strong></p>"; else echo "<p><strong style=\"color: green\">Your message wasn't successfully sent...</strong></p>"; }
17a898580332bc41bbf7a656fc626f4b18c176c66a467a607674eae6ee0f1266
['adfdea01dd124d6ab65c5806686937f0']
This seems to be an issue related with .NET COM interop through DLR (dynamic language runtime) in association with the COM bridge that the COM-Server (Java program wrapped through JNI utilizes). I suspect the latter to be ComfyJ from Teamdev. You can work around the issue by providing an implementation of IDynamicMetaObjectProvider and DynamicMetaObject. For a start see the code below: using System; using System.Collections.Generic; using System.Text; using System.Dynamic; using System.IO; using System.Linq.Expressions; using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Win32; using System.Diagnostics; class DynamicCOMObject : IDynamicMetaObjectProvider, IDisposable { private Type m_comType = null; private object m_comHolder = null; public DynamicCOMObject(string progId) { m_comType = Type.GetTypeFromProgID(progId); m_comHolder = Activator.CreateInstance(m_comType); } public void Dispose() { if (m_comHolder != null) { Marshal.ReleaseComObject(m_comHolder); m_comHolder = null; } } #region IDynamicMetaObjectProvider Members DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject( System.Linq.Expressions.Expression parameter) { return new DynamicCOMObjectMetaObject(parameter, this); } #endregion private class DynamicCOMObjectMetaObject : DynamicMetaObject { internal DynamicCOMObjectMetaObject( System.Linq.Expressions.Expression parameter, DynamicCOMObject value) : base(parameter, BindingRestrictions.Empty, value) { } public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { // Method to call in the containing class: string methodName = "SetValue"; // setup the binding restrictions. BindingRestrictions restrictions = BindingRestrictions.GetTypeRestriction(Expression, LimitType); // setup the parameters: Expression[] args = new Expression[2]; // First parameter is the name of the property to Set args[0] = Expression.Constant(binder.Name); // Second parameter is the value args[1] = Expression.Convert(value.Expression, typeof(object)); // Setup the 'this' reference Expression self = Expression.Convert(Expression, LimitType); // Setup the method call expression Expression methodCall = Expression.Call(self, typeof(DynamicCOMObject).GetMethod(methodName), args); // Create a meta object to invoke Set later: DynamicMetaObject setDictionaryEntry = new DynamicMetaObject( methodCall, restrictions); // return that dynamic object return setDictionaryEntry; } public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { // Method call in the containing class: string methodName = "GetValue"; // One parameter Expression[] parameters = new Expression[] { Expression.Constant(binder.Name) }; DynamicMetaObject getDictionaryEntry = new DynamicMetaObject( Expression.Call( Expression.Convert(Expression, LimitType), typeof(DynamicCOMObject).GetMethod(methodName), parameters), BindingRestrictions.GetTypeRestriction(Expression, LimitType)); return getDictionaryEntry; } public override DynamicMetaObject BindInvokeMember( InvokeMemberBinder binder, DynamicMetaObject[] args) { Expression[] parameters = new Expression[2]; Expression[] subs = new Expression[args.Length]; parameters[0] = Expression.Constant(binder.Name); for (int i = 0; i < args.Length; i++) subs[i] = args[i].Expression; parameters[1] = Expression.NewArrayInit(typeof(object), subs); DynamicMetaObject methodInfo = new DynamicMetaObject( Expression.Call( Expression.Convert(Expression, LimitType), typeof(DynamicCOMObject).GetMethod("CallMethod"), parameters), BindingRestrictions.GetTypeRestriction(Expression, LimitType)); return methodInfo; } } public object SetValue(string key, object value) { return m_comType.InvokeMember(key, BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.Public, null, m_comHolder, new object[] { value }); } public object GetValue(string key) { return m_comType.InvokeMember(key, BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.Public, null, m_comHolder, null); } public object CallMethod(string methodName, params object[] parameters) { return m_comType.InvokeMember(methodName, BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, m_comHolder, parameters); } } Usage: using (dynamic client = new DynamicCOMObject("jniwrapper.elocomserver")) { client.refreshIntray(); }
c1e9d6080e3578baf8703a2baeee9cef2d6e2a3ab5cf98d2e94b881fb0c5a1bc
['adfdea01dd124d6ab65c5806686937f0']
I know that this question is older, but I have run into the same issue today in combination with Eclipse Neon. So here goes a possible explanation for your issue. PDFbox has some class initializers that are using the logic "<Class>.class.getClassLoader()" to get an instance of the class loader that is being associated with the class. I expect that line 1852 of your PDFTextStripper.java file being used as source for the version you have been using will contain a reference to this call. If you decide to mark your Eclipse libraries as "system libraries" then getClassLoader will return "null" as they are being mounted into the bootstrap loader, therefore you are getting a NullPointerException. The subsequent getResourceAsStream call is being tried against a null value and therefore it fails, obviously. This also will be applicable for Apache XML-Beans 2.6, or Apache POI and other implementations. Possible easy resolution: remove the flag "system library" from the Eclipse library definitions and getClassLoader will return an instance to the class loader. Thus you won't run into the exception anymore. Harder resolution: patch the code base for PDFBox and check for null value. If applicable use ClassLoader.getSystemClassLoader() instaead. Re-compile with Maven.
bbbd444cb8ee9a6bc7f0bbc9e8080b213e60f5207bb80704e3b35d7a71ab8bce
['ae14ed10309347b6a6af6ac45edb09bb']
i'm using typescipt in react project. but i don't know why type errors. show me my code. how refactoring this code plz help me i think expression tha useTabs function args code than useTabs return 2 values. making how return value. i want one type that "useTabsProps" in all useTabs args and return value Page import React from 'react'; import useTabs from '../hooks/useTabs'; const contents = [ { tab: 'tab1', section: 'section1' }, { tab: 'tab2', section: 'section2' }, ] function UseTabsPage() { const { currentItem, changeItem } = useTabs(0, contents); // <-- contents error (Expected 1 arguments, but got 2.) return ( <> {contents.map((content, index) => <button onClick={() => changeItem(index)}>{content.tab}</button>)} <div> {currentItem.section} </div> </> ) } export default UseTabsPage; Hooks import { useState } from 'react'; type useTabsProps = { initialTab: number, allTabs: { tab: string section: string, }[] } function useTabs({initialTab, allTabs}:useTabsProps) { const [ currentIndex, setCurrentIndex ] = useState(initialTab); return { currentItem: allTabs[currentIndex], changeItem: setCurrentIndex } } export default useTabs;
d04bcc1198818c15d8186b020099ca143055678a243e641879267cca9d92f865
['ae14ed10309347b6a6af6ac45edb09bb']
some body help me~~ My Issue is this IOS is Normal operation. but upgrade ios11 a bug broke out. Scroll down quickly, My header menu hide, and scroll end than menu show. My header is 'position:fixed;top:0;left:0;width:100%;height:50px;' had property. Why does this happen? i tried css edit and meta tag change...
dac30d9f1c57f68a3701eac45b08e63072df1b24c15dc324562a0a59585854c7
['ae1775a402fa4757bea6cbb22509acf7']
I ended up not using SageMaker for this, but for anybody else having similar problems, I solved this by opening the file using s3fs and writing it to a tempfile.NamedTemporaryFile. This gave me a file path that I could pass into either torchaudio.load or librosa.core.load. This was also important because I wanted the extra resampling functionality of librosa.core.load, but it doesn't accept file-like objects for loading mp3s.
fd406a07fdc72d94bf6eb0d3a092e9e732ddb4e036d040e151e217adff513bef
['ae1775a402fa4757bea6cbb22509acf7']
I stored like 300 GB of audio data (mp3/wav mostly) on Amazon S3 and am trying to access it in a SageMaker notebook instance to do some data transformations. I'm trying to use either torchaudio or librosa to load a file as a waveform. torchaudio expects the file path as the input, librosa can either use a file path or file-like object. I tried using s3fs to get the url to the file but torchaudio doesn't recognize it as a file. And apparently SageMaker has problems installing librosa so I can't use that. What should I do?
04a083b5fc49a7ae0b19a8a741a33680c340fd6506402c4f22914150f1b62aae
['ae21d7e743364b979d56b95782f3148a']
Is there any way by which we can set "Build Automatically" option to true via a configuration file so that this option would be checked as soon as eclipse gets started. This is just because the workspace is made ready with the help of a batch file which compiles the code and then opens the eclipse also.
63207a39f0842c0ebad859dfc76c8a7377311e6cd40b2c8ad4e46f69e783183a
['ae21d7e743364b979d56b95782f3148a']
I have a web project which has the same as in a typical web project, say web, dto, service, dao. Now I'm working with the service layer. Now, I want to read an xls file and each row should be pushed to the db via dao. I have created a separate utility class to read the xls file. To which layer, the logic of reading should go? Should it be kept in the web itself and after reading it from the web, a list should be created and passed on to the service layer? Is this approach correct? Any advice?
65cf3c632ce5b57f36e90a2bd7cfbaa6d902a73e3063a927d0ec5f1f9b4ff40e
['ae28dc44629d437da28c184736dbafa8']
<div ng-if="true"class="items"> <ul ng-repeat='entry in list1'> <li ng-click='clickMe(entry.name)'>{{entry.name}}</li> </ul> <ul ng-repeat='entry1 in list2' ng-if="secondList"> <li ng-click='sendToserver(entry1.name)'>{{entry1.name}}</li> </ul> </div> contorller.js $scope.optionsSelected = {}; $scope.clickMe = function(text){ $scope.optionsSelected['first'] = text; $scope.secondList = true; // show second list // you can initialize second list here OR reset values before it is sent to sever } $scope.sendToserver = function(text){ $scope.optionsSelected['second'] =text; $scope.textSelected = $scope.optionsSelected; // $scope.textSelected contains both options you just selected. }
8dd8425c26913d7f81c680a575f9309010f5ddd3f6ebb12dcaccdd51d0cf75fb
['ae28dc44629d437da28c184736dbafa8']
setup: Nodejs server gets data from pc com port While reading data on pc serial com port i received following text stream: [13;27HF [13;27H [1mF [22m [27m [13;31H44 [13;31H [1m44 [22m [27m [13;37H [22m [27m [13;37H [13;46HPTORDR [13;46H [1mPTORDR [22m [27m [13;55HCR [13;55H [1mCR [22m [27m [13;62HF419152 [13;62H [1mF419152 [22m [27m [13;75HSL [13;75H [1mSL [22m [27m [24;00H [2K%CHANGE_CLASS, Change of class - Endorsement required [22m [27m Is it possible to encode/decode this message?
ae765b1b6811a706858e820ee2813dabb8f9c54c581eb8511ab9abe8b51e785d
['ae399388ed1b46c1ba1f33eca7ac7030']
I have been looking through quite a few functions in order to find a function that will work, but I have had no luck. I need to create a program that will have an input/preset string variable with a sentence already there. I have listed the sentence, so it already has values for each word. sentence = "ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT CAN YOU DO FOR YOUR COUNTRY" listSentence = sentence.split(" ") Ask would have the value 0, Not would have the value 1, What would have the value 2, Your would have the value 3. And so on... Ask then is repeated in the 9th position, so I'm wondering how I could make all of the repeated words have the 1st value of them. So the 9th ask, should have the value 0. The 10th word, what would have the value 3, and so on.
26e6ad34f25f6e8afd67a921f1e42140df42ce90a9a018cfb529da0670623408
['ae399388ed1b46c1ba1f33eca7ac7030']
I'm trying to find a way to output an array in alphabetical order as well as the length by a window alert, or alternatively any way for the user to be able to see it, when they're in the browser. Here is the little bit of code:- var vehicles = ["Car", "Bus", "Train", "Boat","Plane"]; vehicles.sort(); As well as:- vehicles.length();
fc0aacdf855294dd755bf66a53ad681e02e889147f6f808a60a44864baf63f55
['ae3fa441145a441a95b11484ef32422e']
copy your m.3gp file to sdcard and then set the path accordingly like private String path = "/sdcard/m.3gp"; else for quick testing on emulator push m.3gp file to data folder like adb push m.3gp /data and then set the path like private String path = "/data/m.3gp"; hope this will resolve your problem.
d9932ebc2d725d88cb28e171a831a465fbe0cc614919549177b612f051b44f02
['ae3fa441145a441a95b11484ef32422e']
Command-t in one of my favorite vim plugins, it's ruby based plugin above integration with FZF. By using Comamnd-T and FZF you can do the search with an extremely fast "fuzzy" mechanism for: Opening files and buffers Jumping to tags and help Running commands, or previous searches and commands with a minimal number of keystrokes. As you can see I always search in command history by opening a new terminal and hit: CTRL+R In addition to searching in all folders recursively by writing in any terminal tab: fzf Then start your file name ABC Also, you can write inside vim :CommandT Really helpful especially in large folders.
ca8bdca595c19a8b8206c35d6c2a12f50ef048be5eec948f164ef6e5426a9c95
['ae54881bd0574cdc9457582a45c0b761']
My working solution is a "dirty" trick to hide the table without using "display:none". The ordinary "display:none" style causes initialization problem for jQuery Data Tables. First of all, place your data table in a wrapper div: <div id="dataTableWrapper" style="width:100%" class="dataTableParentHidden"> ...data table html as described in jQuery Data Table documentation... </div> In CSS: .dataTableParentHidden {overflow:hidden;height:0px;width:100%;} This solution hides the data table without using "display:none". After the data table initialization you have to remove class from wrapper to reveal the table: $('#yourDataTable').DataTable(...); $('#dataTableWrapper').removeClass('dataTableParentHidden');
a37f581468e4be3a3880e2a9f4a41403a73999b34fac2ac1bd95e71e8e80ef55
['ae54881bd0574cdc9457582a45c0b761']
When I call Graph API as https://graph.facebook.com/comments/?access_token={TOKEN}&filter=stream&fields=parent.fields(id),message,from&ids={PAGE_CONTAINING_EMBEDDED_FB_COMMENT_BOX} the results displays the replies as well with "parent" field. Trying the same for page feeds like: https://graph.facebook.com/{PAGE_ID}/feed?access_token={TOKEN}&limit=100&fields=parent.fields(id) I get the "Subfields are not supported by parent" error message. What is the correct syntax of "fields=" parameter to retrieve all comments with replies for page posts? Thank you in advance.
42754574d1beb52df943187575ad147cbc76e05a01ddb7fbd18a7c4b8e27c6ab
['ae554ce33ab940d6a68dc8f772df4abb']
The monitor may not be able to handle that high a resolution and goes out of synch. Do you hear any high-pitched whistling and clicking as it tries to synch up to the signal? That's usually a sign that the monitor doesn't work at that resolution, and why it can only display a much lower resolution. You don't say the vintage of the display, but my hunch it probably can't go much more than 1024 x 768 which was high-resolution way back when except on expensive CAD/CAM and graphics systems which used special video cards and monitors capable of the resolutions we use every day now.
cf14402be580b881bcb803fc2dd88a76b018cca44a538176ce751c92cf8090cc
['ae554ce33ab940d6a68dc8f772df4abb']
Sure it will work and I've used it before, however, it has to be the same hardware, otherwise the user is going to have a mess. This is a new laptop. The user will receive a new license and should use that to setup the machine. It's also cleaner that way too.
7b3e02d9acdc1cd649d04d4fd75dbe554bf8a619c38b3c32638b186604c285e6
['ae5dbdc4a1d34098ad320ee5f9286210']
I am writing a code in Android to print a value process in background thread using Async task. I am displaying the value in the background thread on onPostExecute function. But i want to display the value in the MainActivity after completing the background process. Java Code package com.example.mydoinbackground; import android.os.AsyncTask; import android.os.Bundle; import android.widget.TextView; import android.app.Activity; public class MainActivity extends Activity { TextView tt; String x , y ,z; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tt = (TextView)findViewById(R.id.txt); x = "Android"; y = "Apple"; z = "Microsoft"; MyTest mt = new MyTest(); mt.execute(); /// I want to display the result here /// } private class MyTest extends AsyncTask<String,Void,String> { @Override protected String doInBackground(String... arg0) { String z1 = x+" "+y+" "+z; return z1; } protected void onPostExecute(String result) { tt.setText(result); } }} So , this is above code. I am getting the proper result in onPostExecute and it displaying correctly but I want to display the result in onCreate MainActivity. Please suggest me some good solution.
13bb0ff9ba4b7be9e33d36bf8a410849fcd20eaebbf66653dd826442d66c118d
['ae5dbdc4a1d34098ad320ee5f9286210']
I am trying to write a code in Android to display 5 Custom Switch button in the layout. I got a code from Internet to develop Custom Switch button. So , i run the code and i got a fancy Switch button in the Layout. So , now i am trying to display 5 such fancy button from the code , but i don't find any technique to do it. Java Code package com.example.newcustomswitch; import android.os.Bundle; import android.app.Activity; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }} XML Code <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:mySwitch="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.example.newcustomswitch.MySwitch style="@style/mySwitchStyle" android:id="@+id/pickup4" android:layout_gravity="center" android:layout_marginTop="4dp" android:layout_marginBottom="2dp" android:layout_marginRight="4dp" android:gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" mySwitch:pushStyle="true" mySwitch:textOnThumb="false" mySwitch:thumbExtraMovement="9dp" mySwitch:trackTextPadding="1dp" mySwitch:thumb="@drawable/stoggle_copy_sm" mySwitch:track="@drawable/sgroove_copy_sm" mySwitch:textOn="Planned" mySwitch:textOff="Un-Planned" mySwitch:leftBackground="@drawable/sleft_background_copy_sm" mySwitch:rightBackground="@drawable/sright_background_copy_sm" mySwitch:backgroundMask="@drawable/smask_background_copy_sm" /> </ScrollView> This is the above static XML code and it display only one switch button in the layout , and i want to display 5 such button from this layout without creating any more child. Please help me out , suggest me some good solution !!!
14698a90c97daa1d6fcdd123595d12f8e4e3d18c862d6866c79d0c4da1a18d3a
['ae63300658834ff59428f4979e0064a6']
My csv file is, https://github.com/camenergydatalab/EnergyDataSimulationChallenge/blob/master/challenge2/data/total_watt.csv I want to visualize this csv file as clusters. My ideal result would be the following image.(Higher points (red zone) would be higher energy consumption and lower points (blue zone) would be lower energy consumption.) I want to set x-axis as dates (e.g. 2011-04-18), y-axis as time (e.g. 13:22:00), and z-axis as energy consumption (e.g. 925.840613752523). I successfully visualized the csv data file as values per 30mins with the following program. from matplotlib import style from matplotlib import pylab as plt import numpy as np style.use('ggplot') filename='total_watt.csv' date=[] number=[] import csv with open(filename, 'rb') as csvfile: csvreader = csv.reader(csvfile, delimiter=',', quotechar='|') for row in csvreader: if len(row) ==2 : date.append(row[0]) number.append(row[1]) number=np.array(number) import datetime for ii in range(len(date)): date[ii]=datetime.datetime.strptime(date[ii], '%Y-%m-%d %H:%M:%S') plt.plot(date,number) plt.title('Example') plt.ylabel('Y axis') plt.xlabel('X axis') plt.show() I also succeeded to visualize the csv data file as values per day with the following program. from matplotlib import style from matplotlib import pylab as plt import numpy as np import pandas as pd style.use('ggplot') filename='total_watt.csv' date=[] number=[] import csv with open(filename, 'rb') as csvfile: df = pd.read_csv('total_watt.csv', parse_dates=[0], index_col=[0]) df = df.resample('1D', how='sum') import datetime for ii in range(len(date)): date[ii]=datetime.datetime.strptime(date[ii], '%Y-%m-%d %H:%M:%S') plt.plot(date,number) plt.title('Example') plt.ylabel('Y axis') plt.xlabel('X axis') df.plot() plt.show() Although I could visualize the csv file as values per 30mins and per days, I do not have any idea to visualize the csv data as clusters in 3D.. How can I program it...?
42f8b90d17366118e130e05518c10d00330c00a9269c3c54ca6a23a605b70413
['ae63300658834ff59428f4979e0064a6']
I am trying to make a model for predicting energy production, by using VARMA(or VAR) model. (If you have any recommendations other than VARMA or VAR, please let me know.)   The data I can use for training is as following; (https://github.com/soma11soma11/EnergyDataSimulationChallenge/blob/master/challenge1/data/training_dataset_500.csv) ID Label House Year Month Temperature Daylight EnergyProduction 0 0 1 2011 7 26.2 178.9 740 1 1 1 2011 8 25.8 <PHONE_NUMBER> 731 2 2 1 2011 9 22.8 170.2 694 3 3 1 2011 10 16.4 <PHONE_NUMBER> 688 4 4 1 2011 11 11.4 <PHONE_NUMBER> 650 5 5 1 2011 12 4.2 199.5 763 ............... 11995 19 500 2013 2 4.2 201.8 638 11996 20 500 2013 3 11.2 234 778 11997 21 500 2013 4 13.6 237.1 758 11998 22 500 2013 5 19.2 258.4 838 11999 23 500 2013 6 22.7 122.9 586 As shown above, I can use data from July 2011 to May 2013 for training. Using the training, I want to predict energy production on June 2013 for each 500 house. By using statsmodels.api.tsa.filters.hpfilter, I succeeded to get rid of trend component from "Daylight". import csv import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm df = pd.read_csv('../../data/training_dataset_500.csv') x = df.loc[df.House==1, 'Daylight'] x_smoothed, x_trend = sm.tsa.filters.hpfilter(x, lamb=129600) fig, axes = plt.subplots(figsize=(12,4), ncols=3) axes[0].plot(x) axes[0].set_title('raw x') axes[1].plot(x_trend) axes[1].set_title('trend') axes[2].plot(x_smoothed) axes[2].set_title('smoothed x') plt.show() I have 2 questions(stack) here. Stack1 I can not remove seasonal component. Although I can get rid of the trend component, I cannot remove seasonal component to make the time series data stationary. (I need to make the time series data stationary in order to get a good prediction.) Stack2 I want to implement VARMA(or VAR) model to get the prediction. But writing the models are difficult for me and cannot write a proper code... Again, If you have any recommendations other than VARMA or VAR, please let me know. Following are my code.(I tryed to implement VAR model) import csv import numpy as np import statsmodels.tsa.stattools as st import pandas as pd import matplotlib.pyplot as plt import statsmodels.tsa.vector_ar as var import statsmodels.api as sm data_train = pd.read_csv('../../data/training_dataset_500.csv') data_test = pd.read_csv('../../data/test_dataset_500.csv') data_set = pd.read_csv('../../data/dataset_500.csv') rng=pd.date_range('7/1/2011', '6/1/2013', freq='M') def mape_of_var(house, predfile, mapefile): sum0 = 0 f_pred = open(predfile, 'w') f_mape = open(mapefile, 'w') pred_writer = csv.writer(f_pred) pred_writer.writerow(['House','EnergyProduction']) for i in house: data = data_train[data_train.House==i][['EnergyProduction','Daylight','Temperature']].set_index(rng) data_diff = data.diff().dropna() model = var.var_model.VAR(data_diff) results = model.fit(4, trend='nc') lag_order = results.k_ar data_pred = results.forecast(data_diff.values[-lag_order:],1)[0,0]+data.EnergyProduction[-1] sum0 = sum0 + abs(data_pred-data_test.EnergyProduction[i-1])/data_test.EnergyProduction[i-1] pred_writer.writerow([i,data_pred]) mape = round(sum0/len(house),3) f_mape.write(str(mape)) f_pred.close() f_mape.close() #return mape print 'MAPE(500 houses): ' + str(mape_of_var(range(1,501), 'pred_all.csv','mape_all.txt')) and when I implemented this code, I got a following error; (DataVizProj)Soma-Suzuki:Soma Suzuki$ python examine.py Traceback (most recent call last): File "examine.py", line 41, in <module> print 'MAPE(500 houses): ' + str(mape_of_var(range(1,501), 'pred_all.csv','mape_all.txt')) File "examine.py", line 24, in mape_of_var data = data_smoothed[data_smoothed.House==i][['EnergyProduction','Daylight','Temperature']].set_index(rng) File "/Users/Suzuki/Envs/DataVizProj/lib/python2.7/site-packages/pandas/core/frame.py", line 2625, in set_index frame.index = index File "/Users/Suzuki/Envs/DataVizProj/lib/python2.7/site-packages/pandas/core/generic.py", line 2161, in __setattr__ return object.__setattr__(self, name, value) File "pandas/src/properties.pyx", line 65, in pandas.lib.AxisProperty.__set__ (pandas/lib.c:42548) File "/Users/Suzuki/Envs/DataVizProj/lib/python2.7/site-packages/pandas/core/generic.py", line 413, in _set_axis self._data.set_axis(axis, labels) File "/Users/Suzuki/Envs/DataVizProj/lib/python2.7/site-packages/pandas/core/internals.py", line 2219, in set_axis 'new values have %d elements' % (old_len, new_len)) ValueError: Length mismatch: Expected axis has 0 elements, new values have 23 elements Any infomation would be helphul.
df7eca27220870ef06764e81cd1816cc7b33cd519aa1f0883e73f1940be29763
['ae6437e85d4e42bea74d533810f13baa']
I have an issue in Excel where I need to find if two adjacent cells are both equal to 100. I need some way to change a cells value to true or false based on this condition. Here is an example data set A1: 100 A2: 95 A3: 84 A4: 100 A5: 100 A6: 86 A7: 92 In this case, I would want the result to be true because A4 and A5 are adjacent and both contain 100. The only helpful thing I have found online is this function but it doesn't get me all the way there. =IF(COUNTIF(B:B,B5)>1,1,0) Would I be better off coming up with a macro? Thanks for any help.
2a0a5d37bf571f89cd9aaac870933d1fb4833c110f8e25d2b8d4e247497eb2ef
['ae6437e85d4e42bea74d533810f13baa']
I am trying to create a connection string which contains SQL login information for use in Excel The connection string I have been using is: Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=vw-AdventureWorks;Extended Properties="" Which works fine, but when adding user/password fields, like this Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=vw-AdventureWorks;User ID=[Id]@[server];Password=[password];Extended Properties="" It throws an error stating the initialization of the database has failed, but the database is verified to be up and the string connects perfectly fine without the user/password fields
f59c45b8278d5f7f112837df14521579f64869f33914bbf0d7da3f3bc2692d01
['ae730707e1a44b93a70822cef398bba4']
Doing a question on codility and was Asked to take two numbers and get the product. Then get the binary repesentation of that number and count the number of one's that are in the binary number. My code is return method(int a, int b) { int count=0; int num; num = a* b; while(num>0) { if(num %2 ==1) { count++; } num = num >> 1; } return count; } Yet it only gives 50% correctness. Can anyone explain this. Is there something i missed that i should be aware off.
5c72bb84888989900319bf7957e8182b6940bcdf74ee0e2c88d0a921e6b462a9
['ae730707e1a44b93a70822cef398bba4']
I'm creating a Java UI for a school project. I have 4 buttons and an image in the JFrame, I want to be able to perform a task on the Image with each button. Each time I press the button it will overwrite the Image using the buttons function. I have the buttons and functions working but I'm clueless at how to add the Image to the JFrame. Do I use a Jpanel or a canvas to put the image onto the frame. I used the netbeans GUI builder. Here is my code in a compressed form //import static NewJFrame.plotWidth; import ij.IJ; import ij.ImagePlus; import ij.WindowManager; import ij.gui.GenericDialog; import ij.process.ByteProcessor; import ij.process.ColorProcessor; import ij.process.ImageConverter; import ij.process.ImageProcessor; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.Polygon; public class my_JframePlugin extends javax.swing.JFrame { static int plotWidth =400; static double angleInDegrees = 40; static double angle = (angleInDegrees/360.0)*2.0*Math.PI; static int polygonMultiplier = 100; static boolean oneToOne; double picsize; ImagePlus img = IJ.openImage(); ImageProcessor imgP = img.getProcessor(); int[] x,y; /** * Creates new form NewJFrame */ public my_JframePlugin() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { <PERSON> = new javax.swing.JFileChooser(); <PERSON> = new java.awt.Canvas(); <PERSON> = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); <PERSON> = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 477, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 310, Short.MAX_VALUE) ); jButton1.setText("FFT"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Inverse FFT"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("3D Plot"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("Crop"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton5.setText("Add Image"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(36, 36, 36) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(108, 108, 108)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(45, 45, 45) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(33, 33, 33) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(38, 38, 38) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(56, 56, 56)) .addGroup(layout.createSequentialGroup() .addGap(35, 35, 35) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: IJ.log("FFT clicked"); } private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: //ImagePlus myimage = img; img = WindowManager.getCurrentImage(); if (img==null) { //IJ.noImage(); IJ.log("No Image selected"); return; } if (!showDialog()) return; if (img.getType()!=ImagePlus.GRAY8) { ImageProcessor ip = img.getProcessor(); ip = ip.crop(); // duplicate img = new ImagePlus("temp", ip); new ImageConverter(img).convertToGray8(); } ImageProcessor plot = makeSurfacePlot(img.getProcessor()); new ImagePlus("Surface Plot", plot).show(); IJ.register(Surface_Plotter.class); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: IJ.log("Inverse FFT clicked"); } boolean showDialog() { GenericDialog gd = new GenericDialog("Surface Plotter"); gd.addNumericField("Width (pixels):", plotWidth, 0); gd.addNumericField("Angle (-90-90 degrees):", angleInDegrees, 0); gd.addNumericField("Polygon Multiplier (10-200%):", polygonMultiplier, 0); gd.addCheckbox("One Polygon Per Line", oneToOne); gd.showDialog(); if (gd.wasCanceled()) return false; plotWidth = (int) gd.getNextNumber(); angleInDegrees = gd.getNextNumber(); polygonMultiplier = (int)gd.getNextNumber(); oneToOne = gd.getNextBoolean(); if (polygonMultiplier>400) polygonMultiplier = 400; if (polygonMultiplier<10) polygonMultiplier = 10; return true; } public ImageProcessor makeSurfacePlot(ImageProcessor ip) { double angle = (angleInDegrees/360.0)*2.0*Math.PI; int polygons = (int)(plotWidth*(polygonMultiplier/100.0)/4); if (oneToOne) polygons = ip.getHeight(); double xinc = 0.8*plotWidth*Math.sin(angle)/polygons; double yinc = 0.8*plotWidth*Math.cos(angle)/polygons; boolean smooth = true; IJ.showProgress(0.01); ip.setInterpolate(true); ip = ip.resize(plotWidth, polygons); int width = ip.getWidth(); int height = ip.getHeight(); double min = ip.getMin(); double max = ip.getMax(); if (smooth) ip.smooth(); //new ImagePlus("Image", ip).show(); int windowWidth =(int)(plotWidth+polygons*Math.abs(xinc) + 20.0); int windowHeight = (int)(255+polygons*yinc + 10.0); Image plot =IJ.getInstance().createImage(windowWidth, windowHeight); Graphics g = plot.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, windowWidth, windowHeight); x = new int[width+2]; y = new int[width+2]; double xstart = 10.0; if (xinc<0.0) xstart += Math.abs(xinc)*polygons; double ystart = 0.0; for (int row=0; row<height; row++) { double[] profile = ip.getLine(0, row, width-1, row); Polygon p = makePolygon(profile, xstart, ystart); g.setColor(Color.white); g.fillPolygon(p); g.setColor(Color.black); g.drawPolygon(p); xstart += xinc; ystart += yinc; if ((row%5)==0) IJ.showProgress((double)row/height); } IJ.showProgress(1.0); ip = new ColorProcessor(plot); byte[] bytes = new byte[windowWidth*windowHeight]; int[] ints =(int[]) ip.getPixels(); for (int i=0; i<windowWidth*windowHeight; i++) bytes[i] = (byte)ints[i]; ip = new ByteProcessor(windowWidth,windowHeight, bytes, null); return ip; } Polygon makePolygon(double[] profile, double xstart, double ystart) { int width = profile.length; for (int i=0; i<width; i++) x[i] =(int)( xstart+i); for (int i=0; i<width; i++) y[i] =(int)(ystart+255.0-profile[i]); x[width] =(int)xstart+width-1; y[width] = (int)ystart+255; x[width+1] =(int)xstart; y[width+1] = (int)ystart+255; //for (int i=0; i<width; i++) // IJ.write("dbg: "+i+" "+profile[i]+" "+x[i]+" "+y[i]); return new Polygon(x, y, width+2); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(my_JframePlugin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(my_JframePlugin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(my_JframePlugin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(my_JframePlugin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { //new NewJFrame().setVisible(true); } }); } // Variables declaration - do not modify private java.awt.Canvas canvas1; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JFileChooser jFileChooser1; private javax.swing.JPanel jPanel1; // End of variables declaration } I just have no idea how to approach loading the image onto the frame
e1a0ade7b68447cd2279a02c43bfffa7e6db3793a752cf5b1eae8f098ab0e935
['ae95b889de294fa792473440cbc1d4bf']
<script> var map = ''; function showmap(){ if(!map){ var mapOptions = { zoom: 4, center: new google.maps.LatLng(23.6459, 81.9217), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); ^^^^ Remove var from here and it works fine var marker = new google.maps.Marker({ position: map.getCenter(), map: map }); google.maps.event.addListener(map, "click", function(){ document.getElementById("latitude").value = map.getCenter().lat(); document.getElementById("longitude").value = map.getCenter().lng(); marker.setPosition(map.getCenter()); }); } } </script> in function when assigning map variable again in modal is creating problem so to remove conflict just remove var map when assingin it to google.maps
5b97ec1ec7389d015a00649f47eaec5f4b9cc05755b9bf322973c64f15ace6bf
['ae95b889de294fa792473440cbc1d4bf']
i am having a table emp like ____________________________ ID | Name | Address ____________________________ 1 | <PERSON> | Street On Road 2 | <PERSON> | Park Side Lane I want to create a table at SELECT runtime that will create a new table on the basis of address spilited with every space. Something Like ID | WORD | EMP_ID 1 | Street | 1 2 | On | 1 3 | Road | 1 4 | Park | 2 5 | Side | 2 6 | Lane | 2
8cba8b108ed2f952c5c77a4ff2c262dfe92879942de47cfa3e0f9ea9dcd52c98
['aeaa688611294269a9b231776b8e8f0c']
i have a inherited from QGraphicsScene and QGraphicsItem to create my own classes. I use Qt 4.6. I want to set a specific opacity on each items of my scene. I use setOpacity : setOpacity method, but its not the result i hope. I want to have for example one item opaque and an other transparent (to see the desktop, or the other application). But if i dont set the opacity of the QGraphicsView to 0.5, i have not the transparancy. And if the QGraphicsView is set to 0.5, the item is not real opaque. What should i do ? Thanks you.
2150b0717047fe4eaeabe971beb0847f6485978c3291f3620d9276fbc1ec7d29
['aeaa688611294269a9b231776b8e8f0c']
i have an application where is use Qt 4.6 and Microsoft SDKs (the Psapi.Lib). I use cmake or qmake to build. For qmake and cmake i specify in hard the path of the Psapi.lib. qmake : win32 { LIBS += "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\Psapi.Lib" } cmake : SET(PSAPI "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/Psapi.Lib") But i want to avoid the hard path, is there is any way to search the SDK lib ? For linux, there is no problem to search : qmake : unix { CONFIG += link_pkgconfig PKGCONFIG += xmu } cmake : IF(UNIX) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(XMU xmu REQUIRED) INCLUDE_DIRECTORIES(${XMU_INCLUDE_DIR}) LINK_DIRECTORIES(${XMU_LIBRARY_DIRS}) ENDIF() It's possible to make the same ? Thanks you.
cb6067cf7a4ed55e41d9df7003a3b7f63de0b8a7eb463a4e409b7c370a87d71d
['aeacbb0f9edd47a7a74f043381ae4785']
Using: Vue CLI 3.0.0-rc.3 How can I config my app, that it is loading the A) css itself, B) the fonts loaded in css and C) the images from a relative path depending to the parent-folder the app is located? My complete vue app is currently running without extra webpack config file. I already know, I would need to create a webpack.config.js, but I don't know what plugins or configuration is necessary. The app is full functional under absolute path http:whatever.local/ of course. But I need to deliver the app complete independent from absolute path, so customer can use it under folder structure he wants and I don't know jet. http:customerssite.com/i-dont-know-his-structure/vue-app/ (I just don't know). Thank you very much.
8ec9538924969b259935d2c5d8dcc18f466577b1abd0fa18e7176b5b19a0e148
['aeacbb0f9edd47a7a74f043381ae4785']
The described situation contains two different problems: 1) Relative Path to assets at all. To have the web-app functional in every nested folder, you need to load all assets from relative starting point. Solution: baseUrl = './' (the folder itself, were the html starts loading the vue app.) Documented here: https://cli.vuejs.org/config/#baseurl module.exports = { baseUrl: './', } 2) ignore url paths in css-loader To be able to use relative paths in the urls used in css for images and fonts, you need to avoid that the css-loader (webpack) is trying to manipulate/controll your used urls. Solution: Configure this css-loader with option url: false. And just use the relative url, that starts from the folder were the html starts loading. Documented here: https://cli.vuejs.org/guide/css.html#css-modules module.exports = { baseUrl: './', css: { loaderOptions: { css: { url: false, } } } }
50858c03f3294628665205bf5e2520749c9ad4c03d787df7074e9dd1b9f40249
['aeb623be2eca4bdab96444e615335c7a']
**Uncomment** mod_rewrite.so in httpd.conf #LoadModule rewrite_module modules/mod_rewrite.so to LoadModule rewrite_module modules/mod_rewrite.so **create** .htaccess file on root app folder with my example script <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /hrd/ RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule> **codeigniter** config.php set --- $config['index_page'] = 'index.php'; to --- $config['index_page'] = '';
21020d0150927a487b6b496a9f3d430aa6a9125c15483e68a60dc24fe13d05e1
['aeb623be2eca4bdab96444e615335c7a']
<?php $data = Array ( 'user_id' => 1,'username' => 'phillip', 'password' => 12345, 'email' => '<EMAIL_ADDRESS>','account_balance' => 100 ); $keys = array_keys($data); ?> <table border=1> <tr> <?php foreach($keys as $key=>$value): ?> <td><?php echo $value;?></td> <?php endforeach; ?> </tr> <tr> <?php foreach($data as $key=>$value): ?> <td><?php echo $value;?></td> <?php endforeach; ?> </tr> </table>
42665d405ae7502e3780cf7930d6bf816b46bd126e0885beec15d231b08be6a9
['aec03aeb9ef84bbeae2193774ba7b218']
eof() does not look into the future. So, when you are right before EOF, you will read it also into your vector and probably corrupt it. A better way to read all lines into a vector is: string line; while(getline(inFile, line) text_list.push_back(line); Your loop will break once you've read an EOF or when any other error has occured. Another method is using iterators and the algorithm library: copy(istream_iterator<string>(inFile), istream_iterator<string>(), back_inserter(text_list)); It's up to you which one you prefer.
dcd6251ca891c2afa82d07ac3501a66f9d6a8abd75ba15b492d212e2cd8d5af0
['aec03aeb9ef84bbeae2193774ba7b218']
You can also use std<IP_ADDRESS>sort with a lambda expression: std<IP_ADDRESS>sort(value.begin(), value.end(), [](const FooMember &lhs, const FooMember &rhs) { std<IP_ADDRESS>string str1 = i.first, str2 = j.first; boost<IP_ADDRESS>algorithm<IP_ADDRESS>to_lower(str1); boost<IP_ADDRESS>algorithm<IP_ADDRESS>to_lower(str2); return str1 < str2; }); Or use the version provided by erelender. It's up to you.
516e988e7456741b61f497caa1a55d696039e2cdbb6153ff8cccbc331e51cd39
['aec38a7652cc49e2b69f3019602b752d']
Please use col-xs-offset-x Instead of x you can write number between 1 to 12. Move columns to the right using .col-md-offset-* classes. These classes increase the left margin of a column by * columns: Your code will be. <div class="container-fluid main-container"> <div class="col-md-10 content col-xs-offset-2"> <div class="panel panel-default"> <div class="panel-heading"> Edit existing questions </div> <div class="panel-body"> </div> </div> </div> </div> Reference link https://www.w3schools.com/bootstrap/bootstrap_grid_examples.asp
f6d7ddc10924612c7701d6146648bea2dd0671715caedab932137b41e763aa0e
['aec38a7652cc49e2b69f3019602b752d']
I have created one custom form (Wordpress Woo-commerce) for purchasing products. I need to insert data into ORDER tab OR After Orders I would like to create one more tab called Subscription Orders same like Orders, but inside this post type data is only for subscription orders. Can you please guide and help me, How I can achieve this. I have also put screenshots so you can get better idea. Thank you in advance.
ce9dfea396991a8228a551d5ed8343edd0496d9af3581c7ef1767b5bb394f30e
['aec8f306d95b43f783cb264080be1930']
I'm in the middle of creating a website that basically hands out codes. Each code is 8 digits long. Each digit can be any of the following: 0-9 numbers 26 lower case alpha 26 upper case alpha Total 62 choices per. If I've done the math right 62^8 (and I could be completely wrong, which is why I'm asking the brains) being 8 digits long that could generate: 218,340,105,584,896 codes. Once a code is generated it cannot be generated again. What I'm curious in is let's say over x time the amount of generated codes ramp up into the millions and continues climbing at a steady pace. Now let's say a third party enters and writes a program that can generate my rudimentary 8 digit code. They can also check to see if its a valid code. Given that there are approximately a million codes already generated which keeps gaining everyday. Is there a formula to see the approximate time it would take somebody to generate a valid code? Say they can generate and check about 10 per second or so. I know I can simply add more digits to my code but the idea is the shorter the better in this scenario. I'm curious if this is secure enough. We're not talking about the keys to the castle here.
f1a9dce8e1e2b942b887e97cb76d26df9d41cac7c066ba5d8296668d9ee7f09a
['aec8f306d95b43f783cb264080be1930']
Interesting, it actually gets passed to the end of a url. It's essentially a shortened url code that forwards to a much longer link. My thought now is to add link expiration which would mean I could probably drop down to 62^6 or 62^4. Thanks for the thoughts.
037019a99c1895480da2f720f250ed881b903960d6e8ad9fe7de41605bc97737
['aed2a9b180f2463582044124139dbf62']
How do I code a share button into my SpriteKit Scene? I've seen tutorials on how to make it however this is in the Main.storyboard and ViewController.swift, I'm coding it in my MenuScene.swift (Cocoa Touch Class) and displaying it in MenuScene.sks (SpriteKit Scene). I am using Swift 4 and the latest version of Xcode (9.4.1), my application is for iOS 9 and above. Thanks in advance!
5de065d84a0f1503c615e8eac1546131bc7e0033907f1a0565c09066d6a710b5
['aed2a9b180f2463582044124139dbf62']
How would I make a Time/Date Picker that allows a selection of minutes and seconds and set that as a countdown time (I only need to know how to make the Time/Date Picker). I've found many tutorials but they are made in the Main.storyboard. I want to add it to my GameScene.swift (file type is Cocoa Touch Class). I am working with Swift 4 in Xcode 9.3 in a Game type application. Thanks in advance!
7820b23b1fce8caecd358efae07d4eafe81d48a6c1adc5a1f2abe0a9f58d4a5e
['aed3d8a8ea694e7fa63e87ec21ede271']
You can bind the class "active" to an element like this <button {{bind-attr class="isActive:active"}}>Test</button> Even static classes are possible: <button {{bind-attr class=":btn isActive:active"}}>Test</button> But how to get a button like this <button {{bind-attr class=":btn :facet%id%"}}>Test</button> to have the value of "id" bound to the static-value? <button class="btn facet384"></button>
862ccf12de7c6616de9f5a0674575f9f165e69df902ab865643b6f5e4bb6cad6
['aed3d8a8ea694e7fa63e87ec21ede271']
I'm using PHP's exec function to execute the command convert on my server. For a 6,7 kB SVG-File (converted file: 5,2 kB PNG-File) the following command: /usr/bin/convert -density 72 -resize 270 80 -background transparent /var/www/app/img/logo.svg PNG32:/tmp/svg2png/20140105- a86b2ed2c38ed310020d201db8042d71.png Takes about 0,0001s on my MBP but about ~15 sec on my six-core Server. How is this possible? Are there any settings for ImageMagick that could be the issue? I already decreased density with no effect. Thanks for your help!
ccc39f1240eda1a69dd9bd56445b091c8be652e5f08d31250e66533651d70092
['aedb392151814f00bbd80b619f09fe55']
I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons. Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried. This setting is located under: Preferences Profiles [select a profile] Keys
24f0395d5418f963732a87b6554c19ac0a0d4258c1aec1c6e29a975fc63d27fb
['aedb392151814f00bbd80b619f09fe55']
Unless I'm missing something: You run the script, the main function runs when you call it, it does what it does; after everything is done with the functions, the last line which unsets is run. Unless you exit the `return` or `break` the script in one of the functions, the unset will unset them
df7b225ce9e4031d5871573b4ec1bb10cbc6d19699bd5e491dcb7ae3b3d5ef1d
['aee1fe2b44134ab5acd7e12362d7fa73']
I had the same problem and I am also running 4.19.1-1-MANJARO and postgresql 10.5-3, but most answers are for Ubuntu and refers to directories that don't exist on Manjaro. You have to run systemctl to check the service to see what is wrong sudo systemctl status postgresql It gives something like this systemd[1]: Starting PostgreSQL database server... postgres[3902]: "/var/lib/postgres/data" is missing > postgres[3902]: su - postgres -c "initdb --locale > and it tells you to run the su command listed above. But this requires the password of the user postgres. To go around this we sudo the command instead. sudo su - postgres -c "initdb --locale en_US.UTF-8 -D /var/lib/postgres/data'" When this command is finished it tells you to run pg_ctl -D /var/lib/postgres/data start, but instead just start it via systemctl. sudo systemctl enable postgresql sudo systemctl start postgresql
99b5a34fffb904126537cd0aaef6e68f6928014dbe3286d445106523b70ce52c
['aee1fe2b44134ab5acd7e12362d7fa73']
I am using an array of strings inside my function declared like this char (*array)[PATH_MAX] = malloc (1000 * sizeof *array); Allocating 1000 char pointers of size PATH_MAX (1024). I want the function to return that specific data structure, i.e. return the pointer array. But I can't manage to choose the correct return type. warning: returning 'char (*)[1024]' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion] I get that I can't have int as return type, but char** doesn't work either. warning: returning 'char (*)[1024]' from a function with incompatible return type 'char **' [-Wincompatible-pointer-types] I've tried using char (*)[1024] as return type, but it gives me generic C error messages, leading me to believe that I am not using the correct syntax. error: expected identifier or '(' before ')' token 38 | char (*)[1024] read_dir (char *path) { | ^ Is there a correct syntax for achieving this or am I just doing it wrong?
98415400699acdbf67f0d2a329a516155510e34940a4224136c22fd499fbe1de
['aee7a2b2f7aa4ee69d15786cebe79483']
I am entering a string to the quill editor. The quill editor convert the string to a delta and saving it to the database. So I want to trim the string when I am retrieving it from the database but because it's a delta is trim the delta and all my styling is not working and it return an uncompleted delta
c9ccd7296542eceabf36b954755ec028af8c527e9d65380598ffdf31515a6667
['aee7a2b2f7aa4ee69d15786cebe79483']
Because I grid view is a Table you can use CSS <html> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="RegNo" DataSourceID="SqlDataSource1" Width="931px" CellPadding="4" ForeColor="#<PHONE_NUMBER>" GridLines="None" Height="170px" AutoGenerateDeleteButton="True"> </asp:GridView> <style> td > a { /*button*/ display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 4px 8px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; /*button color*/ color: #ffffff; background-color: #c71c22; border-color: #c71c22; } td > a:hover { color: #555555; text-decoration: none; background-color: #9a161a; border-color: #911419; }
62a2510a67723b7acabf443e2a4ad3e33bc0dd345f40db36cba4f1cce7826ae9
['aee9311941cf402797199f00644713dc']
I'm working with processing, and I was wondering what the best (most efficient) way of ordering an array was. I basically want to be able to write a function that could take an array with, say, the ints 3,2,7,29,5,1 and order it like: 1,2,3,5,7,29. I could figure out some inefficient way of doing, but i'm working with 100,000+ numbers and I don't know how to do this efficiently. Sorry if this is a stupid question!
c0dfa721eaeca32dbdc81ad1a52b442158886d5040679d2fe1b93cb0ecb364ec
['aee9311941cf402797199f00644713dc']
The ACM (http://jtf.acm.org/index.html) library is good for basics. Java has some native graphics, but libraries are far better. Java is good for games (far better than python even with PYGame). If your game is complex, then you definitely want to use C(++). There are libraries that allow animations, although you could just program it yourself. As previously mentioned, Processing is good for non-serious applications. But if you want a full-fledged IDE then you definitely want Eclipse.
d5cf663cc990297c5f79b01aedb30c4ab74c6485bc927709f5b0c9d0836ae8f7
['aef7650e91dd400090cb919ecabf2b07']
When we are about to write some code in the .aspx.cs file , we are able to access Response object. How we are getting that object, and where it is presented, and how its working as a object as we haven't created that Is it a property? Is it a class? Tell me all variations about Response object
3ef4fb72934209f00bc0d12b17e9cb1b045dee0e7001f181fd65bd6c84c6d38e
['aef7650e91dd400090cb919ecabf2b07']
The request message must be protected. This is required by an operation of the contract ('IMyNumericService','http://tempuri.org/'). The protection must be provided by the binding ('BasicHttpBinding','http://tempuri.org/'). when i am trying to connect to the host where i have registered my service , i am getting the above exception. But Host was working ,when i try to connect from client app it was showing above exception
296f27c9225a7ce178c7a0426e9fc9ffdaf9f25605bc0fa890389f4e96067163
['aefebbeb2a54404ab49da9cc70ad27aa']
Спасибо!! посмотрю, но правильно ли я понимаю, что этот класс обязательно используется если мы делаем какие-либо манипуляции с линкедлистом? Меня смущало следующее : есть метод add ``` LinkedList list = new LinkedList(); list.add("Geeks"); list.add("for"); System.out.println("The list is:" + list); ``` и здесь мы не используем нод, а просто добавляем, а в другой версии add мы уже используем ссылки и нам необходим класс node
b2e827b295f143a6e1bcb7978c08580b463f2d341c406979995296f2eb24c811
['aefebbeb2a54404ab49da9cc70ad27aa']
Есть ли возможность пройтись по массиву циклом и при создании объекта занести значения элементов массива в конструктор. Например, у нас есть строка: String result = "1 2 3 4 5 6"; // делаем массив строк String list[] = result1.split(""); // затем я хочу сделать следующее: BigInteger a1 = new BigInteger (l1); // String l1 = "1"; String l2 = "2"; BigInteger a2 = new BigInteger (l2); BigInteger result = a1.add(a2); // etc В итоге должно быть 21. Спасибо!
b4264433418d12855a06669af94c54e89378cebf1d1bdc6e372dc55e98667809
['af08842a68734b1c87b01a999c50fe2b']
I would like to figure out the difference between two things: transformation matrix and coordinate transformations between the Cartesian system and spherical coordinate system. It is absolutely clear how to transform Cartesian system to Shperical, simply by: enter image description here but the thing that is not clear to me - how to transform (x,y,z) to (theta, lambda, r) using matrix? I assume that it should be something like this: a = (x,y,z), b = (theta, lambda, r), where a and b is column vector and there is some matrix M such as: a = M b. Then I found in the web such matrix, the view is: enter image description here but when I start multiplying I do not get the equations on the first image... So how does transformation matrix look and what am I confusing..? Thank you in advance.
9d6237898bf51d06ac384d2a6caacbdce5ebce80234ff2542b20f203be693dd2
['af08842a68734b1c87b01a999c50fe2b']
I probably confuse you here, but $\tau$ and $t$ are different time. The first one is "fast" pulsating time, the second one is "slow" meantime. This concept comes from perturbation theory, where you can define different time scales. And as far as I understand, if we average by $\tau$ over a period and we average periodic functions, so it must be zero
8da6c974df032c0f586de1e3c2061e2f7aa3944ac1ac4c48b7d4304ff193a424
['af2328a6491d42ea88f78a21fafed051']
I am new to hdf5 files. Trying to read some sample files from the below URL.. https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/ while trying to reading one of the .h5 files in R environment library(rhdf5) h5ls("h5ex_d_sofloat.h5") I am getting the below error Error in H5Fopen(file, "H5F_ACC_RDONLY") : HDF5. File accessability. Unable to open file. help is appreciated.
ce6efe863eb084ce2831997ff6093b899c42d3157edae6efa8653a43783c9d60
['af2328a6491d42ea88f78a21fafed051']
ERROR: type should be string, got "https://community.plot.ly/t/how-to-plot-multiple-x-axis-in-plotly-in-r/3014/3?u=him4u324\nI have posted my question on Plotly community as well\nI am trying to display two x-axis with common Y-axis on plotly for R. I was able to do so as well but starting point for each x-axis is separated from each other Whereas I wish them to be represented a common y-axis.\n\nf1 <- list(\n family = \"Arial, sans-serif\",\n size = 18,\n color = \"grey\"\n)\nf2 <- list(\n family = \"Old Standard TT, serif\",\n size = 14,\n color = \"#4477AA\"\n)\n\n# bottom x-axis\nax <- list(\n title = \"Number of PBIs\",\n titlefont = f1,\n anchor = \"y\",\n side = \"bottom\",\n showticklabels = TRUE,\n tickangle = 0,\n tickfont = f2\n\n)\n\n# top x-axis\nax2 <- list(\n title = \" \",\n overlaying = \"x\",\n anchor = \"y\",\n side = \"top\",\n titlefont = f1,\n showticklabels = TRUE,\n tickangle = 0,\n tickfont = f2\n\n)\n\n# common y-axis\nay <- list(\n title = \"Process & Sub-Process Areas\",\n titlefont = f1,\n showticklabels = TRUE,\n tickangle = 0,\n tickfont = f2\n\n)\n\nplot_ly(data = scrum %>%\n group_by(Master.Project) %>%\n summarise(Total_PBIs_Planned=sum(PBIs.Planned.in.Sprint, na.rm = TRUE),\n Total_PBIs_Delivered = sum(Actual.PBI.Delivery,na.rm = TRUE)) %>% inner_join(scrum %>% count(Master.Project)), # creating the desired data frame\n color = I(\"#149EF7\")) %>% \n # for bottom x-axis\n add_segments(x = ~Total_PBIs_Planned, xend = ~Total_PBIs_Delivered, \n y = ~Master.Project, yend = ~Master.Project, showlegend = FALSE) %>%\n add_trace(x = ~Total_PBIs_Planned, y = ~Master.Project, \n name = \"Total_PBIs_Planned\", type = 'scatter',mode = \"markers\",\n marker = list(color = \"#149EF7\", size = 15, \n line = list(color = '#FFFFFF', width = 1))) %>%\n add_trace(x = ~Total_PBIs_Delivered, y = ~Master.Project, \n name = \"Total_PBIs_Delivered\",type = 'scatter',mode = \"markers\",\n marker = list(symbol =\"circle-dot\",color = \"#F71430\", size = 10, \n line = list(color = '#FFFFFF', width = 1))) %>%\n # for top x-axis\n add_trace(x = ~n, y = ~Master.Project, xaxis = \"x2\",\n name = \"No._of_Sub_projects\",type = 'bar', \n marker = list(color = \"#149EF7\"),\n opacity = 0.1,\n hoverinfo = 'text',\n text = ~paste(\n Master.Project,\n '<br> Total Sub Projects: ',n,\n '<br> PBIs Planned: ',Total_PBIs_Planned,\n '<br> PBIs Delivered: ',Total_PBIs_Delivered\n )\n ) %>% \n plotly<IP_ADDRESS>layout(\n title = \"Product Backlog Items - Planned Vs Delivered\", titlefont = f1,\n xaxis = ax, \n yaxis = ay,\n xaxis2 = ax2,\n margin = list(l = 250)\n ) \n\n"
6b13c099008adb4502befe3c7b493ab48f48acaf9cee3cffc7bdbc641f9aeaa7
['af23328496e341e286b5c338dc0f9fd8']
If your object has a fixed length you can received specified amount of bytes on the other end and then create your object. Otherwise you can send delimiters (symbol or sequence of symbols that you are not using in your object) between your objects and keep reading received data byte by byte until you see the delimiter.
fcb713659f5089e36fce68cdc721b3931e1bbe11bba09b2156dd64e2397aea41
['af23328496e341e286b5c338dc0f9fd8']
<PERSON> did warn about using <PERSON>'s (0.2) as small (0.5) as medium and (0.8) as large. <PERSON> never meant for these to be used as rigid interpretations. All effect sizes must be interpreted based on the context of the related literature. If you are analyzing the related effect sizes reported on your topic and they are (0.1) (0.3) (0.24) and you produce an effect of (0.4) then that may be "large". Conversely, if all the related literature has effects of (0.5) (0.6) (0.7) and you have the effect of (0.4) it may be considered small. I know this is a trivial example but imperatively important. I believe <PERSON> once stated in a paper, "We would merely be stupid in a different metric" when comparing interpretations of effect sizes to how social scientists were interpreting p values at the time.
095545e6580c94bd4e3c66b8dd60fa7b46c29551b4cc1c924fb270baf856f47a
['af284c4a5d9d4a7cbcfe0acada4fbc25']
You could use the Txtfmt plugin for this. To make it work, you simply need to set the filetype to something like tex.txtfmt (instead of the customary tex). :help txtfmt-nesting With Txtfmt highlighting enabled, you could add arbitrary fg/bg colors and formats to your document. Caveat: Txtfmt accomplishes its formatting through the use of invisible tokens inserted in the buffer, but these could be stripped easily with a pre-processing step when you generate your final document.
87304801bdc18913c8c278edf95a0e7ebe6c471ec8a39d4fb448d4b7ee819d34
['af284c4a5d9d4a7cbcfe0acada4fbc25']
The Wine App database has good information on how to set these things up just go to the page linked and look through the listing and comments below to see if there are problems/workarounds. http://appdb.winehq.org/objectManager.php?sClass=version&iId=21127 Also, you might try to check if it is supported under PlayOnLinux (a program which will try to implement workarounds automatically) by seeing if it is under one of the categories in this page: http://www.playonlinux.com/repository/ Hope I could help.
88b9543a8cf944e38d8aa74bca26faa6d42c50c6d0f9e202075f3af9e4384665
['af2d576bf0c748b78e597d67503aca99']
i am making a mail client and i have made an option in which user can save his/her profile and i saving all details in an xml file using SXML lib in python . now i want that file to be encrypted otherwise any one can see the details...How do i Do dat?
c065855024f8913eac8cbd499b34b81422c182982fdd78593fb9922b753ca3e9
['af2d576bf0c748b78e597d67503aca99']
why I can bypass deep Freeze by logging in windows partition from Ubuntu and edit what I want is it freeze. I just go to the windows partition file system, then I go to desktop and edit any file I want, then I reboot in windows 7 and I found my file that I edit from Ubuntu. so what is advantage of deep freeze it's useless?
68009d288b161470090379867068a9126d5002b7dee18b0b74f970a999f8c827
['af315417536140d4a91f3c4880314a39']
Environment : Hortonworks Sandbox HDP 2.2.4 Issue : Unable to run the hadoop commands present in the shell scripts as a root user. The oozie job is getting triggered as a root user, but when the hadoop fs or any mapreduce command is executed, then it runs as yarn user. As yarn, doesn’t have access to some of the file system , so the shell script is failing to execute. Let me know what changes I need to do , for making it run the hadoop commands as root user.
7285163afee1cbcf9b5b394e793020049f07368a61e819babb89450e68f04959
['af315417536140d4a91f3c4880314a39']
As documents don't have the url field therefore the id of the documents empty, so its throwing a null pointer exception when it runs the below method. Below is the code of SolrDeleteDuplicate class from nutch 1.7 trunk where the solr record is deleted by id field. updateRequest.deleteById(solrRecord.id); updateRequest => instance of org.apache.solr.client.solrj.request.UpdateRequest solrRecord => the solr Document which needs to be deleted. id => the id of the solr document which is read from the solrindex-mapping.xml present in the conf folder of the nutch distribution. (if this is null then it will throw an exception )
42d44773f0e92c7b516e53850e3052d2da1196fff2312a25a380b47f39ae8b54
['af3bbcbcf6e441a6b14d41693054cb90']
Because many have written $('selector').attr("readonly", false); I want to mention that this will not work. When readonly present, it specifies that an input field is read-only, either is =true, =false, =whatever. So proper way to go with JQuery is .removeAttr("readonly"); https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly.
9849d1fad75d6e3ee4588d1f26b29a7eb9794c668df496df942e7d74d1d7e590
['af3bbcbcf6e441a6b14d41693054cb90']
For me rails new "first_app" produced these files: create create README.md create Rakefile create .ruby-version create config.ru create .gitignore create Gemfile run git init from "." and it seems that git wasn't installed so it didn't proceed with the creation of the rest of the files
dfc64bfa19351eaf8f1eb6c0f17aecd773b21e5b75f78f69bc73451247da07a6
['af402ab6b5ca40aa8aa051c8a8587080']
I have landing page where you can select the country to change language. It has a link where you can request a demo. This link is an anchor tag with a mailto url. I need to change the mailto url based on the language i selected before. This is my index.html: <div class="c-navigation__language"> <div class="c-language__trigger" onclick="languageOptions($(this))"> <i id="languageSelected" class="flag flag-16 flag-ar"></i>AR<i class="fa fa-caret-down"></i> </div> <div class="c-language"> <a href="#ar" class="c-language__option is-select" title="Argentina" alt="Argentina" data-iso="ar"><i class="flag flag-16 flag-ar"></i> AR</a> <a href="/pt#br" class="c-language__option" title="Brasil" alt="Brasil" data-iso="br"><i class="flag flag-16 flag-br"></i> BR</a> <a href="/en#us" class="c-language__option" title="E.E.U.U." alt="E.E.U.U." data-iso="us"><i class="flag flag-16 flag-us"></i> US</a> </div> </div> <div class="c-navigation__menu"> <a href="mailto:<EMAIL_ADDRESS>" onclick="changeEmailAdress(); return false;" target="_blank" class="cta cta--accent">Solicitar Demo</a> </div> So I create a JavaScript function "changeEmailAdress()": function changeEmailAdress(){ var languageSelected = document.getElementById("languageSelected"); if (languageSelected.value == "AR") languageSelected.setAttribute('href',"mailto:<EMAIL_ADDRESS>"); else if(languageSelected.value == "US"){ languageSelected.setAttribute('href',"mailto:<EMAIL_ADDRESS>"); } } This function does not work, but I am not able to realize why. The language selected, for example "AR" "US", is also displayed on the url of the website: "www.site.com/es/#AR", so I also thought about getting those character from the website url and make the conditional from there. Is it possible?
ef6ccd2ac8415df0d1773acbc02e336c651977fb834ec51f6816f1262c136891
['af402ab6b5ca40aa8aa051c8a8587080']
I am building an Express app and having some issues with routing. This is my routes.js const EDIT_VIDEO = "/edit"; const routes = { editVideo: (id) => { if (id) { return `videos/${id}/edit`; } else { return EDIT_VIDEO; } }, deleteVideo: DELETE_VIDEO, }; export default routes; This is my videoController: import Video from "../models/Video"; import routes from "../routes"; export const getEditVideo = async (req, res) => { const { params: { id }, } = req; try const video = await Video.findById(id); res.render("editVideo", { pageTitle: `Edit ${video.title}`, video }); } catch (error) { console.log(error); res.redirect(routes.home); } }; export const postEditVideo = (req, res) => {}; This is my videoRouter: import express from "express"; import routes from "../routes"; import { getEditVideo, postEditVideo, } from "../controllers/videoController"; const videoRouter = express.Router(); /*------Video Routes------*/ //Edit videoRouter.get(routes.editVideo(), getEditVideo); videoRouter.post(routes.editVideo(), postEditVideo); export default videoRouter; When I go to 'videos/"id"/edit' I see this error in the browser - Cannot GET /videos/5ed2a169eb370432c01f5ebd/edit I have a pug template named "editVideo.pug" in views directory and I have not idea why it is not working.
f4a52c08e02ee7e7c6538c2eb4cf078526fb42f7e8d94d2cf19f22ee7dec1249
['af42ce94a71d4b67939884420baee21b']
In my case, I followed the full trace 'til reach sth related to my code, in my case I had a trouble with one namedQuery: Grave: Excepción al desplegar la aplicación [segeca_restful] : Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Deployment of PersistenceUnit [segeca_restfulPU] failed. Close all factories for this PersistenceUnit. Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.JPQLException Exception Description: Syntax error parsing [SELECT p FROM Peticion p WHERE p.usuarioIdusuario.idusuario := idusuario]. [31, 73] The expression is not a valid conditional expression. Maybe in your case the root cause could be another one, but I think that if you examine the glassfish's logs, you'll find it. Good luck, Regards, <PERSON>.
8b258e2fd06ee29b5f052cee201c42c9254f506b0ad955f1254b0dae334bb7e1
['af42ce94a71d4b67939884420baee21b']
i want to redefine an event, i mean, i have this: boton.Click += infoApp; //i think thats similar to: boton.Click = new System.EventHandler(infoApp). when button 'boton' is clicked, the function/method 'infoApp' triggers, this method its something like this: private void infoApp(object sender, EventArgs e) { /* my code*/ } Until here, evetithing goes well; but I NEED to send another parameter to that method: boton.Click += infoApp(string par) so i thought that this could work: private void infoApp(object sender, EventArgs e, string par) { /*My code*/ } but it doesn't. I've readen things like delegates but i don't understand; and i dont know what to do in order to solve my problem; any ideas? Thanks in advance pd: sorry by my terrible english, i'm not english speaker. Try to be simple explaining. I'm using VS2008.
bbf6665a4b70e1c61e3aa933994338163054ee2a176008e9843a2b886e7a6079
['af4c263b2f9e4f9e962bd90f478e5690']
This is not the most elegant solution, but since no one is posting a better one (so far), here's the best I've come up with. Just execute a script to do what you need. In my case I'm using jQuery: page.execute_script('$("[name=FieldName][value=Other]").trigger("click");')
83749c443adebba3fb3fe65b20a4a620916b964a65427016085c321f1fef536a
['af4c263b2f9e4f9e962bd90f478e5690']
This code is virtually verbatim from egghead.io, but it is not working at all unless I remove ="app" and remove the ng-controller attribute from the <body> element. (And of course the last <script> element gets ignored in the process—the code that would normally be in app.js.) Of course removing those bits prevents anything else from working or being added. <!doctype html> <html ng-app="app"> <head> <script src="http://code.angularjs.org/angular-1.0.0.min.js"></script> <script src="http://code.angularjs.org/angular-ui-router-1.0.0.min.js"></script> <script> angular.module('app', ['ui.router']) .controller("FirstCtrl", function FirstCtrl() { var first = this; first.greeting = "First"; }); </script> </head> <body ng-controller="FirstCtrl as first"> <div> <input type="text" ng-model="first.greeting" placeholder="First Name"> <hr> <h1>{{ first.greeting }} World!</h1> </div> </body> </html> Here's similar code on JSFiddle. (It's only similar because JSFiddle imposes constraints that make it impossible to post identical code. It has the same problem, so I assume the differences are insignificant for tracking down the source of the bug.) Where is the bug? Why is this not working?
670af27aab72212908b334e0eefe8d379b6bbed54c3b370fe3a3ca46ea6b8563
['af51582087fb43b3b0a09ea706be68fc']
I have created a form in PHP where i am inserting data and saving in .csv file now i want to show .csv data into HTML page using page but i don't know how to do. this is my form code in PHP. <?php $error = ''; $name = ''; $email = ''; $number = ''; $gender = ''; $country = ''; $birthdate=''; $address = ''; $education = ''; function clean_text($string) { $string = trim($string); $string = stripslashes($string); $string = htmlspecialchars($string); return $string; } if(isset($_POST["submit"])) { if(empty($_POST["name"])) { $error .= '<p><label class="text-danger">Please Enter your Name</label></p>'; } else { $name = clean_text($_POST["name"]); if(!preg_match("/^[a-zA-Z ]*$/",$name)) { $error .= '<p><label class="text-danger">Only letters and white space allowed</label></p>'; } } if(empty($_POST["email"])) { $error .= '<p><label class="text-danger">Please Enter your Email</label></p>'; } else { $email = clean_text($_POST["email"]); if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { $error .= '<p><label class="text-danger">Invalid email format</label></p>'; } } if(empty($_POST["number"])) { $error .= '<p><label class="text-danger">Number is required</label></p>'; } else { $number = clean_text($_POST["number"]); } if(empty($_POST["gender"])) { $error .= '<p><label class="text-danger">Gender is required</label></p>'; } else { $gender = clean_text($_POST["gender"]); } if(empty($_POST["country"])) { $error .= '<p><label class="text-danger">Country is required</label></p>'; } else { $country = clean_text($_POST["country"]); } if(empty($_POST["birthdate"])) { $error .= '<p><label class="text-danger">Date of birth is required</label></p>'; } else { $birthdate = clean_text($_POST["birthdate"]); } if(empty($_POST["address"])) { $error .= '<p><label class="text-danger">Address is required</label></p>'; } else { $address = clean_text($_POST["address"]); } if(empty($_POST["education"])) { $error .= '<p><label class="text-danger">Educational Background is required</label></p>'; } else { $education = implode(' ',$_POST['education'] ); // $education = clean_text($_POST["education"]); } if($error == '') { $file_open = fopen("test.csv", "a"); $no_rows = count(file("test.csv")); if($no_rows > 1) { $no_rows = ($no_rows - 1) + 1; } $form_data = array( 'sr_no' => $no_rows, 'name' => $name, 'email' => $email, 'number' => $number, 'gender' => $gender, 'country' => $country, 'birthdate' => $birthdate, 'address' => $address, 'education' => $education ); fputcsv($file_open, $form_data); header('location:index_load.php'); } } ?> <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <br /> <div class="container"> <br /> <div class="col-md-6" style="margin:0 auto; float:none;"> <form method="post"> <h3 align="center">Please fill the Form</h3> <br /> <?php echo $error; ?> <div class="form-group"> <label>Enter Name:</label> <input type="text" name="name" placeholder="Enter Name" class="form-control" value="<?php echo $name; ?>" /> </div> <div class="form-group"> <label>Enter Email:</label> <input type="text" name="email" class="form-control" placeholder="Enter Email" value="<?php echo $email; ?>" /> </div> <div class="form-group"> <label>Mobile Number:</label> <input type="text" name="number" class="form-control" placeholder="Enter number" maxlength="255" value="<?php echo $number ?>"/><br> <div class="form-group"> <label>Gender:</label>&nbsp&nbsp <span> <input type="radio" name="gender" value="male"/> <label class="choice">Male</label>&nbsp <input type="radio" name="gender" value="female"/> <label class="choice">Female</label> </span> <div class="form-group"> <label for="country">Country:</label> <select class="form-control" id="country" name="country"> <option value="" selected="selected"></option> <option value="Canada">Canada</option> <option value="France">France</option> <option value="Germany">Germany</option> <option value="India">India</option> </select> </div> <div class="form-group"> <label>Date of birth:</label> <input type="date" id="birthdate" name="birthdate" value="<?php echo $birthdate ?>"> </div> </div> <div class="form-group"> <label>Enter Address:</label> <textarea name="address" class="form-control" placeholder="Enter address"><?php echo $address; ?></textarea> </div> <div class="form-group"> <label>Education Background:</label><br> <input type="checkbox" name="education[]" value="10th">10th<br> <input type="checkbox" name="education[]" value="12th">12th<br> <input type="checkbox" name="education[]" value="B.COM">B.COM<br> <input type="checkbox" name="education[]" value="B.A">B.A<br> <input type="checkbox" name="education[]" value="BSC">BSC </div> <div class="form-group" align="center"> <input type="submit" name="submit" class="btn btn-info" value="Submit" /> <a href="index.php" class="btn btn-default">Cancel</a> </div> </div> </form> </div> </div> </body> </html> The above code is storing the data in .csv format now i want to show .csv file data into the html page using php. Can anyone help me how to do?
3238e082c7834d569316db6bff0afe80c6ee14a728c580a6b09884b87f90ed71
['af51582087fb43b3b0a09ea706be68fc']
I am new in the CA API policy manager and I want to create an API in policy manager. Which assertion is used in the API policy manager? Make an API If I passed <PERSON> in the JSON format it should return me ur Surname Request - {"name":"Mayank"} Response - {"surname":"Agarwal"} Likewise Request - {"name":"Yash"} Response - {"surname":"Dhoni"} If the name is not <PERSON> or <PERSON> then send a response {"error":"name not found"}
4aec05acc219f0150d3da628a698248dbff23fba7de3488f0076461e528a8300
['af81755336dc4be2beb669c71f03c863']
i'm working on JEE application on netBeans with Tomcat. when adding "applicationContext.xml" , then build and run i have this error: The module has not been deployed. See the server log for details. at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:238) at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:205) at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:123) at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:235) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
a4e4955d7f7797b1756581a74ace4403ad8b2a3328b3ba8ec5f42678e690d3d8
['af81755336dc4be2beb669c71f03c863']
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.main, menu); super.onCreateOptionsMenu(menu,inflater); } is it like this or like this @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //Here you can inflate the icons that you want... getMenuInflater().inflate(R.menu.main, menu); return true; }
47c886bf9cfd4dd1e19ee398f2e0d9a3e422e324864cdaf31d64ba3b50a5b9d4
['af86aacea17e4e379dc83861249c2f60']
// Unimportant stuff const $ = document; $.get = $.getElementById; $.get('theOptions').addEventListener('change', function(event) { // Get the value from the select-element $.get('out').innerHTML = 'You selected ' + event.target.value; // Or $.get('theOptions').value }); <select id="theOptions"> <option value="o1">Option 1</option> <option value="o2">Option 2</option> <option value="o3">Option 3</option> </select> <span id="out">Nothing selected</span>
a83c08a8431460bce7286dda145eff0987c1c0a9986610796416c7b4bb13c897
['af86aacea17e4e379dc83861249c2f60']
Do you mean something like this? // Some shorthands const $ = document; $.get = $.getElementById; const log = console.log; const warn = console.warn; const error = console.error; $.body.addEventListener('click', function() { $.get('trigger').addEventListener('click', function() { $.get('overlay').style.display = 'block'; $.get('modal').style.display = 'block'; playSound('https://intern.globallabs.de/message.mp3'); }); }); function playSound(url) { const audio = document.createElement('audio'); audio.src = url; // Your audio settings audio.play(); } #overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: #0008; z-index: 50; } #modal { display: none; width: 50%; margin: 2rem auto; padding: .5rem; border: 1px solid; border-radius: 4px; z-index: 1000; } <html> <body> Click the button to <button id="trigger">open</button> the Modal and play the sound. <div id="overlay"></div> <div id="modal"> This is the Modal </div> </body> </html>