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
91e4a9a855a3574569453e4fbd56e82d8a10f81e1a7f147ca65c4b2523f0c85f
['802ee5986360475ea2d4811e62b2a6d6']
Some background information: I have a data acquisition system consisting of multiple channels. Some of these channels are not functioning properly. Therefore, the features which I calculate out of the incorrectly working channels have no significance. If I compute W_optimal with the useful and useless features and calculate with W_optimal and unseen data new prediction values, the regression error (prediction to target) is nearly equivalent if I redo this procedure only with the valuable features. I wonder if this is always the case or if it was just luck.
8c5a9315ffbd34867b0b6f623fb42699cc8ddd7ccd3e40844081d88cb89652ce
['802ee5986360475ea2d4811e62b2a6d6']
Since some weeks, I pursue the question "Under which circumstances will LDA achieve a higher classification accuracy than QDA using the same training and test set as well as the same prior probabilities?". I have found these links to this issue: link1 link2 link3 link4 link5 Unfortunately, the answers do not satisfy me completely. Therefore, I would like to ask this question again in the hope of comprehensive responses consisting of descriptive examples.
b8f66168005e46fcc141649db5dd61cb422d4cd4c2a120f11ba41ec6fe211554
['8030a96583c247ffb73664b246a7300f']
I have written a program that i want to input for example "11:12" to and then get "11" and "12" back. This is my code: #include<stdio.h> #include <string.h> #include <conio.h> int main(void) { char s[] = ""; char seperator[] = ":"; char *ch; while (1) { scanf("%s", &s); //scanf("%s", &s); if (s == -1) break; char *result = NULL; result = strtok(s, seperator); while( result != NULL ) { printf( "result is \"%s\"\n", result ); result = strtok( NULL, seperator ); } fflush(stdout); } return 0; } but when i input "11:12", this is my output: result is "11" result is "12→ (" How can i get rid of the last "→ ("?
b188d2a588ebeaf8847de945c87ac267d52182cbb1d4ec1dbd3e05968cd7b04b
['8030a96583c247ffb73664b246a7300f']
i'm trying to get two div's to float right against eachother, like this: __________ |.menutop| | | ---------- |.menu | | | ---------- How would i do that? I tried with: .menutop{ position: absolute; width:7%; height:30px; float:left; margin-top:97px; } .menu{ position:relative; width:7%; height:auto; float:left; margin-top:107px; } But it makes .menu go on top of .menutop
37a994d4013fee270049868d6f8e74c51ba801fe8287f08e79e193e2e025f6b8
['8035314ecd5c466c93708d7ae7522391']
When dealing with strings in C++ its best to sue std<IP_ADDRESS>string and your code seems to be wrong with a changes like using std<IP_ADDRESS>cout instead of plain cout another thing you need to be careful is linking your files especially files in different directories you need to tell code blocks were to find this print.cpp by going to build option and go for the search tab directory and point to where print.cpp is other wise the other approach is to just build a project which will have the main.cpp and and then add print.cpp class to current project I hope this will be of some help
3ea65eb04adb3e139a6ac695f780660c6183a4b88f93b8303c86a392a98e887d
['8035314ecd5c466c93708d7ae7522391']
If your developing an application for tizen i think the best approach is to use this renative it will simplfy a lot of the build process and also you can port you existing code with no issues after this you can use rnv run -p --tizen once your set up everything
a5efd90f75ec7eb14204e0e0c0d5a4c238348e6225bae633c1eae44d0302ecb6
['8044bf14cf1040a482378081396d46bf']
I want to test the performance of tcp with and without Dynamic right-sizing.In this link patches for kernel 2.4.23 and 2.4.8 are present but nothing is mentioned about later versions of kernel. I would like to know if it is implemented by default in later versions or if any patches are avialable for the later versions of kernel.
d631bff3377d74682b40a48fd4e1c4187ea6bf48e077cc337f8c9f3e69c89156
['8044bf14cf1040a482378081396d46bf']
The adb tool can be found in sdk/platform-tools/ If you don't see this directory in your SDK, launch the SDK Manager and install "Android SDK Platform-tools" Also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location.
a2b0a9fa0f9e0e5891c35945da3bc9aee7be1a15326b46cf6d1bca73bd9419ff
['804b4b9e102d4427803ba6e8ea2e1e51']
I would like to create a restaurant guide for a client. The restaurants of course are divided in various categories (and many of those may belong to two or more categories). This is the easy part. The tricky one, I do not know how to handle is the following: A restaurant has a photo and some description. A restaurant may (or may not) have a section dedicated to its' Menu. A restaurant may (or may not) have a section of Offers. A resturant may (or may not) have photos. In the home page there are (among the other sections) two sections relative to New Menus and New Offers. If a restaurant changes its' menu or offer (or both) its' photo and details have to appear for the New Menus and its' photo and the kind of Offer for the New Offers. Does anyone have any idea on how can I approach it? I have in mind a solution but it is very bulky. My solution is to create a Category with the restaurant's name, then for each restaurant's section to create a custom post type assigning as category the name of the restaurant and then in the Post page, relative to the restaurant, assemble the post with the various custom post types.
02be22faeda631ebc4db0dc9d3b1085f62dc3493cc6a67d163d5de4c4a34d330
['804b4b9e102d4427803ba6e8ea2e1e51']
As a bit of emphasis: I have a fancy old SLR film camera that I've used for a long time, and of course my phone has a gazillion-MP digital camera (which these days is really extremely good). I have taken phone photos that were fine for their purposes. I have also occasionally wanted to put the phone into Tv mode so as to get a good stop-action photo without using flash, and it just doesn't have this mode, and that's when I wish I had brought the fancy film camera with me (well, these days it's the fancy DSLR).
6557bd7bb7d84e394bc4c749a2eaec4e1aee87ca916ec2ea4de393f1708e941d
['80535480570a4e4784ab027323ebe929']
If you are using AutoGenerateColumns="False" in grid view then Add the Columns <asp:TemplateField HeaderText="Edit"> <ItemTemplate> <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandArgument='<%# Bind("ID") %>' CausesValidation="false" CommandName="EditData" Width="55px" /> </ItemTemplate> </asp:TemplateField> And then add the OnRowCommand Event. In OnRowCommand Event check the Condtion e.CommandName == "EditData" if the condition satisfies then get the data(PRIMARY KEY) by e.CommandArgument and do as you want
c92c3b82fa28cb99ee0e39117ca304ec44a8dba6991793237b021d79239fd25a
['80535480570a4e4784ab027323ebe929']
I found the solution. we need to use spannalbe. String [] parts = textViewText.split(" "); StringBuilder strtextViewBuiler = new StringBuilder(); for(String items:parts){ if(items.startsWith("http://") || (items.startsWith("https://")) || (items.startsWith("www."))) { if(items.contains("<")){ items = items.substring(0, items.indexOf("<")); } strtextViewBuiler .append(items+" "); } else if(items.contains("<http://")){ int startIndex = items.indexOf("<http://"); int endIndex = items.indexOf(">"); String replacement = ""; String toBeReplaced = items.substring(startIndex, endIndex+1); items = items.replace(toBeReplaced, replacement); strtextViewBuiler .append(items+" "); } else if(items.contains("<https://")){ int startIndex = items.indexOf("<https://"); int endIndex = items.indexOf(">"); String replacement = ""; String toBeReplaced = items.substring(startIndex, endIndex+1); items = items.replace(toBeReplaced, replacement); strtextViewBuiler .append(items+" "); } else{ strtextViewBuiler .append(items+" "); } } mtextView.setMovementMethod(LinkMovementMethod.getInstance()); mtextView.setText(setSpannablePropertyForDescription(strtextViewBuiler .toString()), BufferType.SPANNABLE);
cf519e8ae1c65061bcf4a8f2ecf4a311fd38ddde62996cbe3e6f381904e0a091
['807ade1d7a0f4dfea7359fd40015236f']
Which browser are you using, as stated in the code: WARNING: this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera browsers. For other browsers please use an polyfill, for example: [https://github.com/andyearnshaw/Intl.js/]. Probably you are best to use another library like the one they mentioned.
300e2436d80907e04c7e1107cf243e6765eaca16f29a604dd509b293cc2868ab
['807ade1d7a0f4dfea7359fd40015236f']
Why not have a look at the javascript that gets transpiled from the typescript? import { Component} from '@angular/core'; Does two things: Transpiles into a require call if you have commonjs as module format in typescript, e.g. var core_1 = require('@angular/core'); core_1.Component({}) Second it tells the compiler to look for the types of class Component in @angular/core. By default all non relative paths in import are looked up in the node_modules folders. So it would look at: node_modules/@angular/core/index.d.ts for @angular/core SystemJs is used as module loader at runtime. The browser sees in production only the transpiled javascript. So it has to know, where to look for the dependencies, this is defined in systemjs.config.js. There the packages for @angular/core are defined to look in node_modules by default. Here you can also define to load the dependencies from a CDN, and the version in node_modules would only be used for compilation of the Typescript to Javascript. Typescript compiler does the conversion from ES6 to ES5. See typescript config: tsconfig.json SystemJs is not doing the bundling, it can actually load bundles. Bundling of your javascript needs to be done in continuous integration, e.g. through grunt or gulp.
5399269fc2070410d03beafa8aa4168a448f8e24666c148beab29113bd53eb3c
['807dd0924f144762bfe02996ea8339d0']
AppleScriptからNightShiftのON/OFFを操作したいと思っています。 明日までONにするというところのCheckboxの操作の仕方がわからない UIの取得の仕方が分からない ご教授いただければ幸いです、よろしくお願いいたします。 tell application "System Preferences" activate reveal pane "com.apple.preference.displays" end tell delay 0.5 tell application "System Events" tell process "System Preferences" try click button "Night Shift" of window 1 end try end tell end tell delay 0.5 tell application "System Preferences" activate close window 1 end tell
303d4aa2fe0619213b075592502432691b663540ae4a30619c0b1ed94f9b63e8
['807dd0924f144762bfe02996ea8339d0']
@DanielCook It's not just a Windows thing. Many Unix shell utilities, especially the older ones, behave unpredictably if the last line doesn't end in LF. On the other hand, sometimes the *absence* of a final LF is essential, as when using PHP to generate XML - if the PHP source file has a LF after the final `?>`, it will be copied to the output and probably wind up in a place where the XML parser doesn't like it. So it's not by any means a hard rule.
9c1a5e6bdad0400c3c6400333be2118aa7e444b8bca05d1688eab37b9d45635e
['80909557e943470cacf3402280cd660c']
Symfony's trying to convert your $role(array property) to not multiple choice field(string). There's several ways to deal with this problem: Set multiple to true in your choice form widget. Change mapping from array to string for $role property in your entity. If you insist to have above options unchanged, you can create DataTransformer. That's not the best solution because you will lose data if your array have more than 1 element. Example: <?php namespace Acme\DemoBundle\Form\DataTransformer; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\TransformationFailedException; class StringToArrayTransformer implements DataTransformerInterface { /** * Transforms an array to a string. * POSSIBLE LOSS OF DATA * * @return string */ public function transform($array) { return $array[0]; } /** * Transforms a string to an array. * * @param string $string * * @return array */ public function reverseTransform($string) { return array($string); } } And then in your form class: use Acme\DemoBundle\Form\DataTransformer\StringToArrayTransformer; /* ... */ $transformer = new StringToArrayTransformer(); $builder->add($builder->create('role', 'choice', array( 'label' => 'I am:', 'mapped' => true, 'expanded' => true, 'multiple' => false, 'choices' => array( 'ROLE_NORMAL' => 'Standard', 'ROLE_VIP' => 'VIP', ) ))->addModelTransformer($transformer)); You can read more about DataTransformers here: http://symfony.com/doc/current/cookbook/form/data_transformers.html
ead5c0e79f999b9baf6f21d0bd8246c04e7542fa5d232caa1c86cf53c98896b4
['80909557e943470cacf3402280cd660c']
It would be much easier to use jQuery to handle AJAX requests: function addUserExp(){ var title = document.getElementById('title').value; var startDate = document.getElementById('startDate').value; var endDate = document.getElementById('endDate').value; var description = document.getElementById('description').value; $.post("addExperience.php", { "title": title, "start": startDate, "end": endDate, "desc":description }) .done(function(data) { document.getElementById('addNewExp').innerHTML=data; }) .fail(function() { alert("There was a problem with request."); }); } You can read more about $.post here.
d50740868f59f1325894efa16ae0ef7a4bcabd2cdfc25ad9f8c8fd793242a986
['809671c9f54d40618f2151c1b021a54a']
I'm running Windows 10 Home 64-bit. All of a sudden, the minimize/restore/close buttons stopped working in maximized windows; additionally scrollbars don't work in maximized windows and sometimes web app buttons don't work in Chrome. I have a dialog "Restore pages?" in Chrome which I can't dismiss because that button doesn't work either, even if I unmaximize the window. This is rendering my PC practically unusable - help please? :) edit: already tried rebooting, chkdsk, and Dism /Online /Cleanup-Image /RestoreHealth; if I reboot the problem goes away temporarily but within a minute it's back, as if some program that runs on startup is causing it but I don't know which...
48fe0ae8150774ee00dd447d88c8598d66ac310bdcfcdd1dbe9d90b9df6ccf39
['809671c9f54d40618f2151c1b021a54a']
What I wound up doing is deleting my backups off of the backup drive, then excluding a few folders that are already backed up to cloud services (e.g. Google Drive), and running the backup from scratch. The size of the backup went down from 890GB to 80GB and all my files were backed up.
333265c073e848a75c48022d4066eb443b5edf4f86e7021f23e7f0bddad0e843
['809eda19199942c98e8cf9eca6c5fb1b']
Your voltage divider will not provide around 3V, but around 2.25V (9V / 4) when no LED is connected (do the calculations). The LED itself is a conductor and will be parallel with R2, which will change the resistance of the lower part of your voltage divider (which is then no longer a real voltage divider) to something much lower than 1k Ohm.
6ed1534de3b7dca8dd327398481ec9eee8257514f785ee760f051b290398c72c
['809eda19199942c98e8cf9eca6c5fb1b']
Thanks for comments. Following suggestion from @user2974951, I think I found what I'm looking for. All I need to use is the Power Calculations with the following R formula: pwr.p.test(h = 0.2, n = nr, sig.level=0.05) While I have to understand what all parameters mean and read some literature, first preliminary results seem promising.
01b974840254e17326d85c3b453afd65b641444ab628e20b1be72114f9c0aa5b
['80a5ee3af3ac462486d1d9db14c05059']
After some struggles I was able to implement a Custom User Provider in Symfony, however it isn't working as expected and I am having difficulties spotting where I've gone wrong. This is my setup: I created a CustomUserProvider class like so: <?php namespace XXX\AccountsBundle\Security\User; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use XXX\AccountsBundle\Entity\Accounts; class CustomUserProvider implements UserProviderInterface { protected $user; public function __contsruct (UserInterface $user) { $this->user = $user; } function loadUserByUsername($username) { $user = Accounts<IP_ADDRESS>find(array('email'=>$username)); if(empty($user)){ throw new UsernameNotFoundException('Could not find user. Sorry!'); } $this->user = $user; return $user; } function refreshUser(UserInterface $user) { return $user; } function supportsClass($class) { return $class === 'XXX\AccountsBundle\Entity\Accounts'; } } I registered services like so: parameters: xxx_userentity.class: XXX\AccountsBundle\Entity\Accounts xxx_userprovider.class: XXX\AccountsBundle\Security\User\CustomUserProvider services: userproviderentity: class: %xxx_userentity.class% userproviderclass: class: %xxx_userprovider.class% arguments: ['@userproviderentity'] And I created the provider like so: providers: main: id: userproviderclass The issue I have is that when I try to login, the $username variable in the loadUserByUsername function seems to be coming up empty and thus I can't implement the logic I need here (which is why I created a custom user provider in the first place). I can confirm the function is in fact executing because I can force an exception on it that wouldn't work if it wasn't being executed, so I know the code is executing but I am not sure why the variable is empty when someone logs in. The original (working) setup (without the custom user provider) simply uses this provider setup: providers: main: entity: class: XXX\AccountsBundle\Entity\Accounts property: email And this does work. My guess is that I need to somehow specify the property: email in my provider but I am not 100% clear on how exactly I should be doing that. I appreciate any directions!
1f10b98059c19f5d5a5a97b509c56e961ebb433a4da16f8a521aca74366877e6
['80a5ee3af3ac462486d1d9db14c05059']
I have a GKE project in which I am deploying a WP website using bitnami/wordpress repository. For some odd reason I am getting an error while the pod is restarting about the wp-config file. This situation exposed an important issue to me and that is troubleshooting failures of other kinds as well. So I am trying to figure out what is the ideal or advisable way of troubleshooting deployments when the pod is never alive for me to actually check the Persistent Volume Claim where data is being kept (in case I need to manually adjust certain files or push through corrections while the deployment is inaccessible). I've tried poking the file directly to at least get an idea of why the error and put simply it appears that the script is getting stalled in some process that does not let the entire execution complete, thus resulting in an incomplete wp-config file that results in the error above. The problem here is that since the pod is alive for just about 30 seconds while it is trying to restart, I don't actually have a lot of time inside the pod to further troubleshoot nor test anything else. E 2019-07-05T18:38:12.336224194Z �[0m�[1mWelcome to the Bitnami wordpress container�[0m E 2019-07-05T18:38:12.336229090Z �[0mSubscribe to project updates by watching �[1mhttps://github.com/bitnami/bitnami-docker-wordpress�[0m E 2019-07-05T18:38:12.336234022Z �[0mSubmit issues and feature requests at �[1mhttps://github.com/bitnami/bitnami-docker-wordpress/issues�[0m E 2019-07-05T18:38:12.336237673Z �[0m I 2019-07-05T18:38:15.282309557Z nami INFO Initializing apache I 2019-07-05T18:38:15.341679988Z nami INFO apache successfully initialized I 2019-07-05T18:38:18.132225972Z nami INFO Initializing php I 2019-07-05T18:38:18.169468837Z <PERSON> INFO php successfully initialized I 2019-07-05T18:38:21.066019612Z nami INFO Initializing mysql-client I 2019-07-05T18:38:21.115363595Z mysql-c INFO Trying to connect to MySQL server I 2019-07-05T18:38:21.117771115Z mysql-c INFO Found MySQL server listening at mysql-sqlproxy-gcloud-sqlproxy.sqlproxy:3306 I 2019-07-05T18:38:21.148760516Z mysql-c INFO MySQL server listening and working at mysql-sqlproxy-gcloud-sqlproxy.sqlproxy:3306 I 2019-07-05T18:38:21.178621769Z mysql-c INFO ==> Found database dtb-fp-112-wp-dok42. Skipping database creation... I 2019-07-05T18:38:21.179106832Z nami INFO mysql-client successfully initialized I 2019-07-05T18:38:24.698919546Z nami INFO Initializing wordpress I 2019-07-05T18:38:36.079448151Z wordpre INFO WordPress has been already initialized, restoring... I 2019-07-05T18:38:36.812451128Z mysql-c INFO Trying to connect to MySQL server I 2019-07-05T18:38:36.820733131Z mysql-c INFO Found MySQL server listening at mysql-sqlproxy-gcloud-sqlproxy.sqlproxy:3306 I 2019-07-05T18:38:36.853653121Z mysql-c INFO MySQL server listening and working at mysql-sqlproxy-gcloud-sqlproxy.sqlproxy:3306 I 2019-07-05T18:38:36.854253915Z wordpre INFO Upgrading WordPress Database ... E 2019-07-05T18:38:37.276642374Z Error executing 'postInstallation': PHP Notice: Undefined index: HTTP_HOST in /bitnami/wordpress/wp-config.php on line 90 E 2019-07-05T18:38:37.276666760Z PHP Notice: Undefined index: HTTP_HOST in /bitnami/wordpress/wp-config.php on line 91 E 2019-07-05T18:38:37.276680033Z Is it possible to bind the same PVC to a different deployment? perhaps an FTP server or a file manager that would allow me to either retrieve files as a backup or fix / adjust files as required that may help recover from the failed deployment? I appreciate the direction. Thanks!
4693a3d065ef0772777605f2bf354e4e0a256268a2aa4fd9c77e4da01b0cf209
['80b910076c414180a58bb909b528da5f']
It is possible and there are many reasons you might want to do this. For example debugging a javascript infinite loop close to the start of the page loading, that stops the chrome developer toolset (or firebug) from loading correctly. See section 2 of http://www.laurencegellert.com/2012/05/the-three-ways-of-setting-breakpoints-in-javascript/ or just add a line containing the word debugger to your code at the required test point.
4411ada957b2524fff835b808f38ad856bde8adbe9e5f340aa991aaf0d9398bb
['80b910076c414180a58bb909b528da5f']
I have a small app I am testing in XCode6 and I get 2 compiler warnings for the SBSJsonParser.m file Semantic Issue variable 'k' may be uninitialized when used here (in function scanRestOfDictionary) c++; if (![self scanValue:&v]) { NSString *string = [NSString stringWithFormat:@"Object value expected for key: %@", k]; [self addErrorWithCode:EPARSE description: string]; return NO; } and same again variable 'lo' may be uninitialized when used here (in function scanUnicodeChar) if (lo < 0xdc00 || lo >= 0xdfff) { [self addErrorWithCode:EUNICODE description:@"Invalid low surrogate char"]; return NO; } anyone with any ideas?
17a3ddc1dab2cd840c5d24b93c76be9ac889f312ad02a21fc87d1e315b941b37
['80cf72fa144f4495ab203f5f02e0ceff']
I don't know if this is the forum for a question like this... The short answer is if you're making money you have to pay. I don't think they are going to get bent out of shape if you aren't intaking any revenue, but tread carefully. You can read about MP3 royalties rates here.
7ca3f2f1a2d6e802fe70ffb483582796f36e8d17aeb599a1ac03aa1f43437481
['80cf72fa144f4495ab203f5f02e0ceff']
JSON JSON JSON! JSON is awesome, and is IMO the easiest way to communicate between the web and any other platform. You can look here and here for more info on the android side. Depending on what platform you are using for your website, there are many awesome libraries to help export your info to JSON. Happy Coding!
aae8b62a761d4a3e4fb5678ee83cf87c3b13afd04bc70efb59e5ea12f24661ee
['80d15f4d4c2540c5802cd8c1e0281ad8']
<html> <head> <title>Rotate image</title> <style type="text/css"> .rotate { transform:rotate(90deg); } .images { margin-top:10px; } </style> </head> <body> <div class="images"> <img src="http://placehold.it/70x70" height="70px" width="70px"> </div> <div class="images"> <img src="http://placehold.it/70x70" class="rotate" height="70px" width="70px"> </div> </body> </html>
e8043fb0110c104ce2541602ec97504d7675765a76965033fcd9d69cf53975b0
['80d15f4d4c2540c5802cd8c1e0281ad8']
<input type="text" id="pointspossible"/> <input type="text" id="pointsgiven" /> <input type="text" id="pointsperc" /> $(function(){ $('#pointspossible').on('input', function() { calculate(); }); $('#pointsgiven').on('input', function() { calculate(); }); function calculate(){ var pPos = parseInt($('#pointspossible').val()); var pEarned = parseInt($('#pointsgiven').val()); var perc=""; if(isNaN(pPos) || isNaN(pEarned)){ perc=" "; }else{ perc = ((pEarned/pPos) * 100).toFixed(3); } $('#pointsperc').val(perc); } });
510b75aaa8fe6ea4de0472ada5da23fcaf075720b2e0e8f264aa7e8802d22d81
['80d77d8870e74e9c8ac2c4a920e730c8']
I've got the following problem. I've got an Entity which looks like this: @Entity @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Teacher{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name = "teacherId", referencedColumnName = "id", nullable = false) private final Set<Student> students = new HashSet<>(); } Now I've got two finder methods: findAllTeachers(): SELECT t from Teacher t findTeacherByIdWithDetails(Long id): SELECT t from Teacher t JOIN FETCH t.students s where t.id = :id As long as I'm on server side all is good. I'm using Hibernate on a wildfly 10 applicationserver. I've got 2 SOAP webservice methods, one method for return all teachers and one method for returning exactly one teacher by id with the students loaded. Now of course the LazyInitializationException is thrown when I'm calling the webservice method for return all teachers, because the Teacher Entity is already detached. Now here is my question. Is there any other option than creating a DTO for this Entity? If I'm setting @XMLTransient for the students collection, I'm also hiding it when I'm calling the webservice method for the detailed Teacher. It would be so great if you could help me out with this problem... I tried a lot and I know that it would work with REST by using jackson-datatype-hibernate. But it is required to be a SOAP webservice.
5e6e70964dfa007cb48606538fb29892ae256a79ec6cc382f22ad83e415e5680
['80d77d8870e74e9c8ac2c4a920e730c8']
I've got a problem with returning only specific elements of an array. Query looks like this at the moment: GET /processdata/_search { "query": {"match_all": {}}, "_source": "data.cells" "size": 1 } My response is (3 similar data entries with cells array): ... "_source": { "data": [ { "cells": [ { "temp": 33, "volt": 12 }, { "temp": 40, "volt": 13 } ] }, { "cells": [ { "temp": 34, <-- THIS IS THE VALUE I NEED "volt": 12 }, { "temp": 40, "volt": 13 } ] }, { "cells": [ { "temp": 35, "volt": 12 }, { "temp": 40, "volt": 13 } ] } ] } Now I want to retrieve only data of the second "data" object in the "data" array. And in this "data" object I'd like to select the "temp" value of the first "cell" entry of the "cells" array. I tried something like this: GET /processdata/_search { "query": {"match_all": {}}, "_source": "data[1].cells[0].temp", "size": 1 }
ccc469f2fad9e50811c2d4506b39f115e42cb01aad9ec48d2e2c0989c8f1386a
['80db713638ba4395b577d4201bb22f68']
function IntervalClass() { var intervalID; this.addSetInteval = function(val) { this.intervalID = val; } this.clearIntevals = function() { clearInterval(this.intervalID); } } function addListners(editorName, charLimit, infoDiv) { if(editorName == null) return; var objInterval = new IntervalClass(); var editorInstance = FCKeditorAPI.GetInstance(editorName); var oDOM = editorInstance.EditorDocument; editorInstance.Events.AttachEvent( 'OnPaste', function(){ return TrimCharacters(editorInstance, charLimit, infoDiv, objInterval); }) ; if (document.all) { oDOM.attachEvent("onkeypress",function(){ return LengthValidation(editorInstance, charLimit, infoDiv); }); oDOM.attachEvent("onkeyup",function(){ return TrimChars(editorName, charLimit, infoDiv, objInterval); }); } else { oDOM.addEventListener("keypress",function(){ LengthValidation(editorInstance, charLimit, infoDiv); }); oDOM.addEventListener("keyup",function(){ TrimChars(editorName, charLimit, infoDiv, objInterval); }); } objInterval.addSetInteval(setInterval(function(){ TrimChars(editorName, charLimit, infoDiv, objInterval); },1000)); } function LengthValidation(editorInstance, charLimit, infodiv) { var text = editorInstance.GetHTML(true); var textlength = text.length; if(textlength > 0) change(); if(textlength >= charLimit) { alert('You cannot enter more than (' + charLimit + ') characters!'); infodiv.innerHTML = 'You cannot enter more than (' + charLimit + ') characters!'; return false; } if(infodiv != null) infodiv.innerHTML = '(' + (charLimit - textlength) + ') Characters Remaining'; return true; } function TrimCharacters(editorInstance, charLimit, infodiv, objInterval) { var text = editorInstance.GetHTML(true); var textlength = text.length; if(textlength > charLimit) { objInterval.clearIntevals(); editorInstance.SetHTML(text.substr(0,charLimit)); TrimXtraChars(editorInstance, charLimit, infodiv) alert('You cannot enter more than (' + charLimit + ') characters!'); addListners(editorInstance.Name, charLimit, infodiv) } else { var textHtml = editorInstance.GetClipboardHTML(); if(textHtml.length + textlength <= charLimit) { editorInstance.InsertHtml( textHtml ); //.toLowerCase() } else { alert('Your paste action is resulting in more than (' + charLimit + ') characters!'); } } text = editorInstance.GetHTML(true); textlength = text.length; if(infodiv != null) infodiv.innerHTML = '(' + (charLimit - textlength) + ') Characters Remaining'; return false; } function TrimChars(editorName, charLimit, infodiv, objInterval) { var editorInstance = FCKeditorAPI.GetInstance(editorName); var text = editorInstance.GetHTML(true); var textlength = text.length; if(textlength > charLimit) { objInterval.clearIntevals(); editorInstance.SetHTML(text.substr(0,charLimit)); TrimXtraChars(editorName, charLimit, infodiv) alert('You cannot enter more than (' + charLimit + ') characters!'); addListners(editorInstance.Name, charLimit, infodiv) } text = editorInstance.GetHTML(true); textlength = text.length; if(infodiv != null) infodiv.innerHTML = '(' + (charLimit - textlength) + ') Characters Remaining'; } function TrimXtraChars(editorName, charLimit, infodiv) { var editorInstance = FCKeditorAPI.GetInstance(editorName); var text = editorInstance.GetHTML(true); var txtlen = text.length; if(txtlen <= charLimit) return; if(txtlen > charLimit) { var diffLen = (txtlen - charLimit); var AlterText = text; if(text.lastIndexOf("&lt;") != -1) AlterText = text.substr(0,text.lastIndexOf("&lt;")); if(AlterText.length > charLimit) { editorInstance.SetHTML(AlterText.substr(0,charLimit-(diffLen+diffLen))); TrimChars(editorName, charLimit, infodiv); } else { editorInstance.SetHTML(AlterText); } } }
b1df070f1420542184a40793edf6699b4c15409ea994d88c6760bb84f80e137b
['80db713638ba4395b577d4201bb22f68']
I am trying to write an illustrated memoir of a recent trip, inserting photos into the text, sometimes several photos per page. Once my document gets to be more than about 10 pages, the photos seem to stray from the place where I inserted them, even though I have anchored them to the page, or even to the paragraph. This seems to happen when I resize the photos and then place them where I wish. I sometimes go back to a previous section and add photos, and then get into more trouble. This is very frustrating. What can I do to get around this issue?
e3b4b9518dde420a36cdf59eb3cb8335c0bec8cf8c16f70559e8a53e57b990ba
['80f76dfe726a4b1c880afc25b2a9afbd']
Shells maintain a cache of the paths where executables were found in the $PATH variable. So it cached /usr/bin/git rather than /usr/local/bin/git, because the latter didn't exist when your shell started. Running hash -r in Bash from your current terminal will clear this cache, then the first instance found in $PATH should be the one that executes.
e43609d6c5206ce6ddbeb222d7c7809809c51007be9102375e5699c208e88c83
['80f76dfe726a4b1c880afc25b2a9afbd']
Vendor wants to put db into simple mode prior to upgrade then back into full recovery mode after upgrade. I do not want to do this because I am not sure what impact it will have on the db cluster. Won't have to drop the db from the AG then put it back in after this process?
a4228ea1d88b9b17b9e351dd404a85f11c0034b183504a3c498f8a213b2bad21
['80ffca250baa4eeb9fd1613b702eb6c5']
Here is a very insightful article Summary: Use checked exceptions for rare but valid contingencies that relate to the purpose of your code. Client code should know how to handle these. Use unchecked exceptions for faults that shouldn't happen but do. (Server down, classpath misconfigured, SQL syntax error, etc.) The IT guy who manages the server, or the developer who just passed bad SQL to prepareStatement() should know how to fix these problems. Faults should propagate up to the logging layer so the info doesn't get lost.
028b4697969f8e0666eabdc82a4c4a658c535344638b570c62cb9b72e7df6dbb
['80ffca250baa4eeb9fd1613b702eb6c5']
I just downloaded and installed version 2.8.11-ansi. RichTextControl is the first demo listed, and works fine. It sounds like there is something messed up with your installation. Unless you have to support windows 98/ME, I don't know any good reason to prefer the ansi version over unicode. Can you provide the exact text of the error message, and a listing of your site-packages, and the contents of wx.pth
c004c9e7abd73f635f2def71e498477ba9130811b00d038211d08e0552dc0f5e
['810aa713baf94d63ae0f9a117d362681']
I using Z3 C++ api to find a satisfiable formula that is minimal with respect to some boolean variables (let us call them b0,...,bn) being true. I have a formula that includes boolean variables b0,...,bn and I want to find some satisfiable formula where I have the least number of b0,...,bn set to true. I do this by initially finding a subset of b0,...,bn that can be assigned to true and satisfy my formula, and I incrementally ask the solver to find smaller subsets (i.e. where one of these boolean variables is flipped to false). I find my local minimum when I cannot find a smaller subset, i.e. I get a unsat result from the Z3. At this point, I would like to access the last valid model. Is that possible? Does Z3 modify the model when a call to "check" is unsat? If so, how can I do this using the C++ api? Many thanks in advance,
8f8ac2805121b42d4063adfb24802ba3336e89e31bf378b225a7bf160b1c7b1c
['810aa713baf94d63ae0f9a117d362681']
I have a problem to solve that can be translated into difference logic, and rather than implementing a decision procedure, I would like to use z3 for this purpose. Nevertheless, I run a few examples and I had exponential-like runtimes (even though there is a polytime decision procedure for it). I am new to z3 and I dont know if I am doing something wrong. Here is the code that I am using (c++ api), varing this "max" variable. int main(int argc, char **argv) { context c; solver s(c, "QF_IDL"); int max = 10000; int prev = 0; for(int i = 1; i < max; ++i){ expr x = s.ctx().int_const(std::to_string(i).c_str()); expr y = s.ctx().int_const(std::to_string(++i).c_str()); expr pr = s.ctx().int_const(std::to_string(prev).c_str()); s.add(pr < x); s.add(x < y); prev = i; } s.add(s.ctx().int_const(std::to_string(max-1).c_str()) < s.ctx().int_const(std::to_string(0).c_str())); clock_t begin = clock(); switch (s.check()) { case unsat: std::cout << "UNSAT"; break; case sat: std::cout << "SAT"; break; case unknown: std::cout << "unknown\n"; break; } clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std::cout << "elapsed time: " << elapsed_secs; } Many thanks in advance, <PERSON><IP_ADDRESS>to_string(i).c_str()); expr y = s.ctx().int_const(std<IP_ADDRESS>to_string(++i).c_str()); expr pr = s.ctx().int_const(std<IP_ADDRESS>to_string(prev).c_str()); s.add(pr < x); s.add(x < y); prev = i; } s.add(s.ctx().int_const(std<IP_ADDRESS>to_string(max-1).c_str()) < s.ctx().int_const(std<IP_ADDRESS>to_string(0).c_str())); clock_t begin = clock(); switch (s.check()) { case unsat: std<IP_ADDRESS>cout << "UNSAT"; break; case sat: std<IP_ADDRESS>cout << "SAT"; break; case unknown: std<IP_ADDRESS>cout << "unknown\n"; break; } clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std<IP_ADDRESS>cout << "elapsed time: " << elapsed_secs; } Many thanks in advance, Pedro
ceb36dd5fe55004ed33e4ce64acda7c752b50ea148f12e4aefacd7cdeff3909f
['810c85ebbe354851af625b070123ae94']
If you're still dealing with this problem (or if others hit it later): wait_fences typically means that you are manipulating UI off-screen (or during a competing animation) - possibly either within the MFMailComposeViewer, or more likely behind it. (There are a ton of other wait_fences questions here on Stack.) In other words, the problem is likely not with the code you posted, but with the other UI events happening around it. If that (and searching) doesn't lead you to a fix, you can manually troubleshoot the problem by commenting-out the surrounding UI-related code until it works, or (failing that) reduce the failing code to its simplest possible example version and post it here so we can troubleshoot it further. (Also, presentModalViewController:animated: is deprecated in iOS6, but this question was asked in the halcyon days of iOS5, so I'm sure that's not the problem.)
3d0810d3cfb87df9f58a7636a0f7a25b654a57fd67462f352b5ab849eeeb539a
['810c85ebbe354851af625b070123ae94']
When creating a simple MongoDB query, I have a question about the ordering of conditions in the query - for example (Mongoose.js syntax): conditions = { archived: false, first_name: "<PERSON>" }; vs. conditions = { first_name: "<PERSON>", archived: false }; ..in a simple find() function: User.find(conditions, function(err, users) { <some logic> }); ..assuming a simple single-key indexing strategy: UserSchema.index( { first_name: 1, archived: 1} ); ..does the order of the conditions listed above matter? IMPORTANT: I know the order DOES MATTER for compound indexes, but per above I am curious about single-key index queries. Also interested in cases of totally non-indexed queries since we're here. :) ALTERNATE EXPLANATION: Put another way, assuming 100 Users (50 archived and 50 not), given two possible internal MongoDB searching strategies: First filter out all 50 of the archived users, then search through the remaining 50 non-archived users with the first_name value of "<PERSON>" First search through ALL 100 User documents for the first_name value "<PERSON>", and then filter the found objects by removing any <PERSON> that are archived. ..I would assume #1 to be faster (potentially MUCH faster in large queries with more than two conditions). But regardless of which is faster and why, surely one of them is. CORE QUESTION: Outside the vast and powerful world of compound indexes, does MongoDB know how to perform its most performant/quick searches/filters automatically, regardless of which fields and which ordering? Or do we need to tell the system what is best programmatically (via the order of conditions presented, etc)?
5a962482a3c80b369eb72b10ac867e6bd52dfa76f117dae48503b959dcb3f901
['810cd1579c0d4863b7981cdd212dc0eb']
I am trying to install owncloud and had some issues with permissions in /var/www/html/. One site suggested to run a script which changes the permission, and it looked ok to me so I ran it as root in the directory /home/owncloud. ocpath='/home/owncloud' htuser='www-data' htgroup='www-data' rootuser='root' printf "Creating possible missing Directories\n" mkdir -p $ocpath/data mkdir -p $ocpath/assets mkdir -p $ocpath/updater printf "chmod Files and Directories\n" find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directories\n" chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} ${ocpath}/assets/ chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} ${ocpath}/data/ chown -R ${htuser}:${htgroup} ${ocpath}/themes/ chown -R ${htuser}:${htgroup} ${ocpath}/updater/ chmod +x ${ocpath}/occ printf "chmod/chown .htaccess\n" if [ -f ${ocpath}/.htaccess ] then chmod 0644 ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/.htaccess fi if [ -f ${ocpath}/data/.htaccess ] then chmod 0644 ${ocpath}/data/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess fi source However, something must have gone terribly wrong, and I got plenty of errors in the style of chmod: changing permissions of 'xxx': Operation not permitted. Now I can't even log in any more using ssh: ssh -p 1234 <EMAIL_ADDRESS> <EMAIL_ADDRESS>'s password: /bin/bash: Permission denied Two questions: What could have possibly gone wrong? And less important: Is there a way to fix this (it's a test server, so no harm if I have to restore from a backup).
8475ff8ccfc5c7e310017414bd5591367cbee4675c56188e5aacd0dc26ca9308
['810cd1579c0d4863b7981cdd212dc0eb']
I am trying to access the official website for trains in the UK, but I keep seeing a 504 - Gateway Timeout error on my laptop connected to wifi and then fiber. The site is up, as confirmed when I access the page via the phone network on my cell phone. Therefore, I guess the error comes from my side an not from theirs. I have tried 3 different browsers disabling the firewall on my laptop (littlesnitch) restarting my router disabling my pihole ad blocker What else could cause this error, and how could I further troubleshoot this issue?
18c58420494d1280a4b9ebf3fee11d8bbfc42ae9ae7cfe299d2f733664bbf383
['812071654d684848a805df6f2b7c8716']
`we don't have to worry about O(1) vs. O(n) problem when finding the correct methods/properties/fields becouse reflection is slow as hell.` I completely disagree with this. We should be worried about performance because _reflection is slow as hell_ and we don't want to make it even slower, do we?
b8be8d2078bfda8f521ac2efb78174c58d4884b8fedbd5c73db02bbf9b061183
['812071654d684848a805df6f2b7c8716']
I tried various different combinations for the contextual filter, but none of them were working. (It won't display any Contact Info nodes). So I removed the contextual filter. As of now it's displaying all 5 Contact Info nodes in the sidebar. I just want to know what's the correct contextual filter that I need to apply to get only the correct 1 contact info node to display.
b1e4b3eed47f5eea96e78090d1f9cb98c458ef388d69a19abc05d00d32387723
['8121272762ae476f8e5e5d78bdbd4e18']
Wrote a simple keychron.service file to overwrite a parameter during each boot-up. [Unit] Description=The command to make the Keychron K2 work [Service] Type=oneshot ExecStart=/bin/echo 0 | sudo /usr/bin/tee /sys/module/hid_apple/parameters/fnmode [Install] WantedBy=multi-user.target This script is for patching my keyboard, and it simply writes a 0 into /sys/module/hid_apple/parameters/fnmode. Unfortunately I can't get it to work. Here's what I did in an attempt to troubleshoot it. Check that fnmode is 1 thekenu:~ $ cat /sys/module/hid_apple/parameters/fnmode 1 Restart keychron.service, and use systemctl status to ensure it restarted successfully thekenu:~ $ sudo systemctl restart keychron.service thekenu:~ $ systemctl status keychron.service ● keychron.service - The command to make the Keychron K2 work Loaded: loaded (/etc/systemd/system/keychron.service; enabled; vendor preset: enabled) Active: inactive (dead) since Wed 2020-07-22 06:33:13 PDT; 3s ago Process: 28778 ExecStart=/bin/echo 0 | sudo /usr/bin/tee /sys/module/hid_apple/parameters/fnmode (code=exited, status=0/SUCCESS) Main PID: 28778 (code=exited, status=0/SUCCESS) Jul 22 06:33:13 thekenu-XPS-15-9560 systemd[1]: Starting The command to make the Keychron K2 work... Jul 22 06:33:13 thekenu-XPS-15-9560 echo[28778]: 0 | sudo /usr/bin/tee /sys/module/hid_apple/parameters/fnmode Jul 22 06:33:13 thekenu-XPS-15-9560 systemd[1]: Started The command to make the Keychron K2 work. Expected fnmode to be 0, but it is still 1 thekenu:~ $ cat /sys/module/hid_apple/parameters/fnmode 1 Run the ExecStart command from keychron.service thekenu:~ $ /bin/echo 0 | sudo /usr/bin/tee /sys/module/hid_apple/parameters/fnmode 0 Now fnmode is 0. But it seems like I merely typed out what keychrone.service was supposed to do. thekenu:~ $ cat /sys/module/hid_apple/parameters/fnmode 0
daa3804b6cad1a325864be056096cf2d3b946b9087570e8c53dca10b3607b3e9
['8121272762ae476f8e5e5d78bdbd4e18']
Thanks for pointing out the redundant `sudo`. However, I believe the main thing I was missing is pointed out by this `man systemd.service` snippet:`Specifically, redirection using "", and ">>", pipes using "|", running programs in the background using "&", and other elements of shell syntax are not supported.` Once I realized this, I was able to search for similar problems on StackExchange a lot easier. It turns out this is a common problem too. In any case, thanks for the help!
72eb9dc784a182a425384eb15e5efa2a14c2d5261da3e7073ac34da31d664408
['812ddde1150746c984ab3c80a08ee002']
in DataTable library you can't use any attribute rowspan or colspan in your html tag and make sure that your number of column between table heading and table body is match, ex: <table id="xyz"> <thead> <tr> <th>Heading 1</th> <th>Heading 2</th> <th>Heading 3</th> <th>Heading 4</th> <tr> </thead> <tbody> <tr> <td>Content</td> <td>Content</td> <td>Content</td> <td>Content</td> <tr> <tr> <td>Content</td> <td>Content</td> <td>Content</td> <td>Content</td> <tr> <tr> <td>Content</td> <td>Content</td> <td>Content</td> <td>Content</td> <tr> <tr> <td>Content</td> <td>Content</td> <td>Content</td> <td>Content</td> <tr> </tbody> </table>
7d3a53b042ea9c1c073f1d2f423cddb777549659318674b54e8f076a3ca5bf85
['812ddde1150746c984ab3c80a08ee002']
Your ajax parameter missing a comma after success function, and try to define success function callback from server as data and then use json_encode for your array data in php server. $.ajax({ type: 'POST', url: editUrl, dataType: 'json', data: data, success: function(data) { console.log(data); }, error: function() { console.log('error'); } });
544a90c53133f3f884ce9e74177c9cfc5f702aa7848a29fd947e684b78cbc0b0
['814722841d1c4aa69485c80660156fba']
what i'm trying to do is a simple practice code with a output like this: user1 logged in at hh:mm user2 logged in at hh:mm ... so i wrote a basic for loop, but what i don't understand why it only runs once. for user in $(who) do USERID=$(echo $user | tr -s ' ' | cut -d' ' -f1) LOGTIME=$(echo $user | tr -s ' '| cut -d' ' -f4) echo "$USERID logged in at $LOGTIME" done this echos the following: user1 user2 user3 logged in at hh:mm hh:mm hh:mm i've put echo lines in between to figure out what is going on and how to fix it, but the only thing i figured out is that the for loop is only running once so USERID and LOGTIME is just a long string with linebreaks. what am i doing wrong? (i did the IFS=$’\n’)
d058618bb580d04541c3591125d0b81922c76abe7421774e6fd0e879e56e6c28
['814722841d1c4aa69485c80660156fba']
i need to get names for undefined number of students which is set as a member of a self referential structure. i have a pseudo-code and the actual code set up but no matter what i give, the input loop stops at the third time. can anyone help? pseudo code: while name != 0 scan name current student name = name current student score = random current = current -> next actual code: #include<stdio.h> #include<string.h> #define DEBUG 1 struct Student{ char name[30]; double score; struct Student* next; }; int main(void){ char n[30]; int i = 0; struct Student s; struct Student *head = &s, *current; current = head; while(i < 4){//4 times for debugging scanf(" %s",n); strcpy(current->name,n); current -> score = 100; current = current->next; if(DEBUG) printf("100\n"); i++; } return 0; } the result i get : input1 100 input2 press any key to continue what am i doing wrong?
629e8ce0dc62ccdae5cddc6a7e7d7185fb4d8177d36cd95889b23e29f3963048
['816e842a31ef41798ad2a1afe2cc39c0']
I am planning a migration from Exchange 2003 to 2016 and now learned that it requires a forest functional level 2008 or greater. We have some newer 2016 and 2012 servers, but have multiple 2003 servers left on the domain and can't raise the level which leave me with two options... Deploy Exchange 2013, or Install 2016 in a different tree in the forest? All of our servers, machines and users all currently reside within a "company.local" namespace which is at 2003 level split into different sites for each of our 40 remote office locations (spoke and hub) If a was to create a "company.com" domain for this new 2016 Server with Exchange 2016 will I be able to add and manage the users in the .local domain? Would I need to setup any sort of trusts between the two? I really don't want to move the users them from their current containers because of Group Policy, Applications pushed and Roaming profiles. Exchange 2003 really works nice within user manager... and I hate playing with a live domain without some professional opinions ;) Any suggestions from anyone with experience with the above would be greatly appreciated :) Kind Regards, <PERSON>
e0d0d0debb8e06d613ef9def408be17987feba17c7ad9416b4faaef10ca28862
['816e842a31ef41798ad2a1afe2cc39c0']
.NET 4.0, Nullable has a "GetValueOrDefault()" method. So if you cast the query to Nullable, then you can end up with the correct Type when complete. This method will also generate the correct single SQL SELECT SUM query and is faster than other solutions that return the entire recordset to later sum via linq decimal result = ((decimal?)query.Where(w => w.Customer =="ABC").Sum(s => (decimal?)s.Amount)).GetValueOrDefault();
20b97d6f9271a2dcdc3846fc9b3625f9715b76d8d2cf43966d3aa264d4a30bd8
['816f0a8ad98040ad894667096c785783']
Some of my sketch is outputting the content of a file on an SD card into the serial monitor. However, this file can be long and at the end of the loop I put the Arduino in a deep hibernation state for several minutes which cuts any transmission of data. I can't really set any delay to wait for before the hibernation (since the size of the file varies), so I would like to know if there is a way to know whether the Serial is transmitting or not (some kind of busy or buffer empty flags).
71a763fc3773a75221c1011dc72fbc0ac5d395afd36867c41763110fa26ba204
['816f0a8ad98040ad894667096c785783']
It is not really clear what you're asking; I acknowledge you tried to split it into context and questions, but the text could use some proof-reading. Also, the code could and should be copied here (you don't have to type it again, that's what Ctrl+C is for) because without indentation nor colors it's really difficult to follow even a simple code. As for what I've understood of your questions, since this is more about Qt and not about the processing, you should post your Qt code. In the meantime, I would advise you to look at the documentation and examples of the class QRadioButton, especially isChecked(). If you want to run the processing after pushing a button, you just have to connect() the event pressed() to a slot of a custom class which will do the processing.
bab13c3057ab284b3775190599807f16605ef395f92f7214393081e434534103
['816f95af7f7d4855bfe8ae50eb928c7b']
So everything is almost fine but you must pass the user variable to the form init as the kwargs, also, on the queryset dont call it like kwargs['user'] and just call user, something like this: def __init__(self, user, *args, **kwargs): super(Producto_Form, self).__init__(*args, **kwargs) self.fields['Negocio'].queryset = Negocio_Model.objects.all().filter(Administrador_id=user.id) also I changed the super() constructor on the get_form_kwargslike this: def get_form_kwargs(self, *args, **kwargs): kwargs = super(crear_producto, self).get_form_kwargs(*args, **kwargs) kwargs['user'] = self.request.user return kwargs
8afa1487b3c6eb53473dee6d963242e428174ab1403410e2dc2605612942b47d
['816f95af7f7d4855bfe8ae50eb928c7b']
So Im making a log-in where, if the user and password are correct, a checkbox's value becomes true, everything is done, but I dont know how to return the value from the server using the response from express. Here is the POST methon in the server: app.post('/CTRL', function (req, res) { var nombre = req.body.name; var passw = req.body.passw; connection.query('SELECT * FROM usuario WHERE User=?', [nombre], function (error, results, fields) { if (error) { res.send({ "code": 400, "failed": "error ocurred" }) } else { if (results.length > 0) { if (results[0].Password == passw) { console.log('Nombre: ' + nombre + ' password: ' + passw); console.log('inicio de sesion exitoso!') res.send('Nombre: ' + nombre + ' password: ' + passw); } else { console.log('Contrasena incorrecta') res.send({ "code": 204, "success": "Email and password does not match" }); } } else { console.log('Nombre invalido'); res.send({ "code": 204, "success": "nombre incorrecto" }); } } }); });
990ac543c8b409704ece0947d4d22ae01ac216f78468a148825ccb773e4c0674
['8172622e94404e8dbd70081f1097f011']
I am not sure if the answer was clear. Trying to explain Spring velocity binding requires the entire path as an argument to the #springBind So If you have a collection dataItems, you cannot bind like #foreach($dataItem in $dataItems) #springFormSingleSelect( "dataItem.data1" $labelKeys "") #end Instead #set ($end = $dataItems.size() - 1) #foreach($i in [0..$end]) #springFormSingleSelect( "dataItems[$i].data1" $labelKeys "") #end This would bind the collection items.
e7c2794b7fd78039232e09846174a472d30d2e33172e348df3f706fbadff52ed
['8172622e94404e8dbd70081f1097f011']
When I used the option sftp="true" from with a maven-antrun-plugin, I was getting the following error. [ERROR] around Ant part ...... @: The type doesn't support the "sftp" attribute. I was able to get this working by switching back to older version of jsch, specifically 0.1.29 <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.29</version> </dependency>
fcc46a627bcd4de6b75693f694390e6a0de95dd3e795f63caef7dc8773ceb03f
['8180b6caabc94efc93df117c3c14192d']
I have tried using BatchGetSymbols to retrieve price data for multiple stock tickers for Weekly and Monthly price data (ohlc) but weekly and monthly functions fail to return to correct data. When using the 'batchgetsymbols' 'freq.data = "weekly' argument the weekly price starts from a Wednesday which is incorrect for weekly price data. It Weekly ohlc data should be at the end of each week (Monday-Friday). The closest thing I have found to retrieving the correct weekly/monthly data is using the 'getsymbols' function with 'quantmod' but currently only limited to searching one single ticker. Is anyone able to help me alter this script to search and retrieve weekly ohlc data for multiple tickers? For example: > library(quantmod) stock_list <- c("FB", "AAPL", "GOOG","BA","DAL","TSLA") start_date <- Sys.Date()-14 end_date <- Sys.Date() master_df <- NULL for (idx in seq(length(stock_list))){ idx = 1 stock_index = stock_list[idx] getSymbols(stock_index, verbose = TRUE, src = "yahoo", from=start_date,to=end_date) temp_df = as.data.frame(to.weekly(get(stock_index))) # weekly data temp_df$Date = row.names(temp_df) temp_df$Index = stock_index row.names(temp_df) = NULL colnames(temp_df) = c("Open", "High", "Low", "Close", "Volume", "Adjusted", "Date", "Index") temp_df = temp_df[c("Date", "Index", "Open", "High", "Low", "Close", "Volume", "Adjusted")] master_df = rbind(master_df, temp_df) } Any help would be much appreciated.
bbb16d4890569263a0fead97da3a290542485e8a88496d41ba00a7fec010635a
['8180b6caabc94efc93df117c3c14192d']
When using the importJSON function in a cell am I able to use this cell in other cell formulas? Example: Cell A1 contains =importJSON("url", "/name", "noHeaders"),1,1) which displays a value of 100. Can I then use this in a formula in Cell B1? Example: Cell B1 formula =IF(AND(A1 > 50), "Y", "N")). Currently the formula doesn't work. How am I able to check is the importJSON result is an actual number or string?
eaa976e7ccda7d69cc41e7938f88626ecac4744372b0447d6f20d2c51756f1ef
['81822bfd9a214ecd808c189b478e9ac1']
How do I make a Jupyter slide show portable? I can serve the slideshow locally, but I can't send that to anyone and have it work with all the images, slide animation functionality, etc. I am using jupyter nbconver my_notebook.ipynb --to slides and get a simple linear html file that depends on the files being on the machine where the file is used.
ef5832e16887b742e8cbdfca205cf8b136e2dfafc54882c182fc21d632069361
['81822bfd9a214ecd808c189b478e9ac1']
I am trying to get the max of a list, the list may contain a zero, 0. In Tcl 8.5, when i run: set x {-5 -<PHONE_NUMBER>} set maxx [expr max($x)] set minx [expr min($x)] puts "$minx $maxx" I get the error: missing operator at _@_ in expression "max(-5 -4 -3 -2 -1 _@_0 1 2 3 4 5)" (parsing expression "max(-5 -4 -3 -2 -1 0 1...") invoked from within "expr "max($x)"" invoked from within "set maxx [expr "max($x"]" I've tried ever syntactical variation and resource I could find. As a work around, I will just use lsort and take the first/last elements of that list, but I really want to know what I am doing wrong here :/ Thanks.
327902a3f04c355d1e5967be74e9c383cab19eb12b60f3561e1363fdfcc06535
['818938e429f54bd9bebaf3f22f5fd550']
I'm trying to test out some of the # methods of cpp (define, if, include etc). However, my compiler is running into issues when I try to write these in code. For some reason, the code #include <iostream> #define DEBUG 1 #if DEBUG #define X(x) std<IP_ADDRESS>cout << x << std<IP_ADDRESS>endl; #else #define X(x) #endif int main(){ X("hi") X("37") std<IP_ADDRESS>cout << "Hello" << std<IP_ADDRESS>endl; return 0; } issues a compile time error that says "expected ';' at the end of declaration" pointing to the line in #endif. I've searched for solutions online, but I'm not sure where a semicolon is needed, if at all. I also get similar errors when I try to define a vector: #include <vector> int main(){ vector<string> msg = {"hi", "bye"}; return 0; } Is this a compiler issue, or am I missing semicolons somewhere? As for the vector code, I believe the compiler states that the semicolon is missing after variable "msg" (not at the end of the line). Thanks for any help!
ac30af13d065cc709291888d09f8a29453d953d420d8d419d8a52d91dc3760a0
['818938e429f54bd9bebaf3f22f5fd550']
I'm trying to find the key corresponding to the maximum value in a HashMap. My declaration is as follows: HashMap<Node, Double> coinD= new HashMap<>(); However, when I try to use an anonymous function to compare two values inside the entrySet of this map, I get a type casting error: Node bestNode = Collections.max(coinD.entrySet(), (e1, e2) -> e1.getValue() - e2.getValue()).getKey(); Returns a type mismatch on e1.getValue() and e2.getValue(): cannot convert from double to int. Where is this coming from? Why is an integer necessary here; why can't the function use doubles to compare? Does the function I defined require ints, or does .getValue() have to return an int? Any help would be greatly appreciated!
badfe2c639de2b9447099b3b275823004a667da2f07233fffa0ba1cb247acc45
['818b4845cd264656b731d09b9442aad0']
I have a directed weighted graph with cycles (example graph). My goal is to get the maximum path from vertex "St" to vertex "E1". Without that positive cycles I can use the Bellman Ford algorithm with negative weights at the edges to find the longest path. But because of the positive cycle, the longest path is ∞. Additionally I have probabilities on the edges which I can use to create the path: In each run of the cycle (e.g. st -> z3 -> z2) I have a 20% probabilty of going st -> z3. This means, in the second run I have 20% of 20% = 4% probability, in the third run I have 0.8% probability and so on. I can define an abort criterion which stops using the edge if the probability is below a specific value. My question is now: Is there a generic algorithm to solve my problem to get the expected longest path? I'm not that familiar with all the algorithms and thus its hard to find something related. I read an article in a book, which says, I have to "extract" the cycle in the graph to transform it to a directed acyclic graph. Extract means, I have to add as many iterations of the cycle to the graph as I need (e.g. to come to a probability < 0.1%). Is this the right approach or do you have any other ideas?
89f3b38cfc7a9658d22209f42672bdef8c7978301b10905ec500dbb1960bdf25
['818b4845cd264656b731d09b9442aad0']
Ok i am looking for a method of handing multiple ssh from a single public ip address and a single port to multiple servers based on the ID file use to connect to the server. I have considered using the ~/.bashrc to run a ssh connection to the private ip of the server but that is the only idea i have. It has been hard to find any relevant info as searching anything with SSH and proxy ends with either forward or reverse proxy questions. Best case scenario user@publicip -i user1 --- proxy to user@<IP_ADDRESS> user@publicip -i user2 --- proxy to user@<IP_ADDRESS> I think i can make this work using ~/.bashrc user1@publicip -i user1 --- proxy to user@<IP_ADDRESS> user2@publicip -i user2 --- proxy to user@<IP_ADDRESS> Thank you!
0b0f2e5310d85323b7678d9193ae82ad99b7be4824d30b28e826bfddf82f1b77
['819993b8c9514d42be501554656fe788']
I managed to create a HTML/CSS editor, at http://hexagonest.tk/code/, but I can't manage it to work Javascript. I'm not sure why, all the code is valid. For example, go on this jfiddle, and type in this code: <script> function dothis(){ document.getElementById("thewow").innerHTML = "poop!"; } </script> <button type="button" onclick="dothis()">Hi</button> <p id="thewow">Hi</p> In theory, it should work, yes? Even when I right click>inspect element, it shows that there is a valid tag. What's wrong with this? If you didn't catch it, my problem is that Javascript is now working with my live HTML editor.
ed79a14c84f509f4334ca9a9ca9fbe9c36af3074ba12cdb4d87904446fd46421
['819993b8c9514d42be501554656fe788']
Ok, I know there are other questions like this on stack overflow, but this isn't the same. I have this thing that I made with jQuery, and it's basically a stickman that walks around. So far, there's two states for the stickman. Sitting, and standing. I want to know how I could check if it's the standing picture is visible or hidden, so I can disable the movement when the standing picture is hidden. Here's the thing so you know what i'm talking about: http://jsbin.com/okazof Here's the code source: http://jsbin.com/okazof/1/edit
990207b847a807dd1d264bb0709e720028cef4333b3fda4bb7bd78a17091f04c
['819c325382eb43d89184c173ab4a67b6']
I am trying to get an SKLabelNode to show up on my screen, but it doesn't show. Here is my code... override func didMoveToView(view: SKView) { let textLabel = SKLabelNode(fontNamed: "Avenir-Black") textLabel.text? = "HI THERE" //textLabel.position = CGPoint(x: frame.midX, y: frame.midY) textLabel.horizontalAlignmentMode = .Center textLabel.verticalAlignmentMode = .Center textLabel.fontSize = 100 textLabel.zPosition = 2 textLabel.color = UIColor.whiteColor() textLabel.name = textLabel.name print("flkjsfhdj") self.addChild(textLabel) } What am I doing wrong?
ff87fee408a5c758fcdbc83cc19ba93a5489f4b66c8997979e98210185c04374
['819c325382eb43d89184c173ab4a67b6']
I figured out the issue. The issue is that you cannot correctly store a Tensor or a Numpy array in a Pandas Dataframe. I ended up having to manually create the image/tensor pairs by doing the following: img_list = [] labels_list = [] for i in range(64): labels_list.append(utils.string_to_numpy(train_df["output_tensor"][i])) image = tf.keras.preprocessing.image.load_img(f"/home/michael/Desktop/YOLO_Detector/dataset/{train_df['filename'][i]}", target_size=(448, 448)) image_arr = keras.preprocessing.image.img_to_array(image) / 255.0 img_list.append(image_arr) img = np.asarray(img_list) label = np.asarray(labels_list) and then calling the img as x and label as y in model.fit()
1b944adec0beb9cbed5bdc92e0293550f4969cb8835f5f9005a8698c6ca60d91
['81a0137e11284bb0bd890a3d402c269b']
I have tried every method mentioned above and nothing worked, except installing jupyter in the new environment. to activate the new environment conda activate new_env replace 'new_env' with your environment name. next install jupyter 'pip install jupyter' you can also install jupyter by going to anaconda navigator and selecting the right environment, and installing jupyter notebook from Home tab
0dbd865737e599e68adf213e1a95f5e7f79b4098d039ee457a236dea17d22589
['81a0137e11284bb0bd890a3d402c269b']
GridSearchCV expects the parameter values in a sequence format, so always you should give the parameter values in the form of a list or numpy array even if the parameter value is a single value. For example: if you give the below dictionary for GridSearchCV it raises an error, since the value of n_jobs -1 is a single integer and not sequence(list or array). parameters={'alpha':[0.01, 0.1, 1, 10], 'n_jobs':-1} but if you wrap the -1 in a list and give to GridSearchCV it wont raise any errors. parameters={'alpha':[0.01,0.1,1,10], 'n_jobs': [-1]} Hope it helps.
d7af6eb9c35c81ef9033b6d357adb5a25b260b6373e009529c0b1cefc8136ab7
['81b39a5a17e241e08c0ac9c3bc804b0c']
If anyone is using AddThis, please check this thread: http://support.addthis.com/customer/portal/questions/1570789 AddThis has some, uh, unique functionality that affects the image picker presented. As in, when there is only one image on the page, it ignores the defined og:image. If you set that lone image to be excluded, then the image picker won't show any images for selection.
7ae09c9c134dbcdc3b77b19cacdfdedeefdaca142854f45f329366d2f57ba788
['81b39a5a17e241e08c0ac9c3bc804b0c']
Do you need a hammer, a mallet, or a shoe? There is no one answer.. A framework is only as good as it's intended utilization. what I'm saying is it's ok that there isn't ONE ultimate solution. take it project by project. I've been coding AS since AS first existed and have spun my wheels on these questions only to find there is no one objective answer other than that. good luck!
9a30595bba8fdec3394327e91fb199b998477d0db58c28a1a6e7ba00e20ed373
['81c2213529fe4b6f93c33ec8700b8dee']
Eu entendo essa questão, solucionei o caso de outra forma, fazendo requisição ao DNS informado após o "@", com isso já consigo resolver meu problema. Entendo que o melhor passo seria a verificação a partir da confirmação de email do usuário, porém no meu caso isso não se aplica, pois não faço essa validação no processo de cadastro do usuário.
520ca1a317d4d496f16d888a312a708cb2bf9e401f6e05b6325bcb8cccac7bd0
['81c2213529fe4b6f93c33ec8700b8dee']
I think A silicon based life form would... live in a hot enviroment since silicon compounds are too stable in a not that hot enviroment. (around 1100 degrees, approximately the melting point of silicon sulfite, wich it disposes like we dispose co2) live inside planets since only there is enough silicon and heat. consume sulfur instead of oxygen, since there no oxygen available inside planets (oxygen most likely only as oxide). dispose liquid sulfur dioxide. have "bones" out of some silicon based crystal, if any. swim in magma, since burrowing through stone would be a huge energy effort. get petrified when taken out of magma since most silicon compounds are minerals. never be noticed by humans even if it lived in earth since they can't isolate magma and keep it hot. (they would noever notice that some rocks are petrified lifeforms)
4247ecb94c841cd1627d8a8e2dd87b8063588ac4ae46fd84043135f56af26db0
['81c5f35d1b6e41d78f65007216ad9c14']
With Windows 7, if you have multiple accounts (and there are no passwords on those accounts), Windows will give you a welcome screen on boot to let you choose which one to log in. With Windows 8, it will just log you straight in to the last logged in account. How can I make it act like Windows 7?
3b599890767b9305f338ea56aecb360ba2aaf7262b7d1e4300f11db3721b32ac
['81c5f35d1b6e41d78f65007216ad9c14']
I got it working, but in an less than perfect way. This way Windows would ask you to type the username every time. Would still like it to show a welcome screen with icons you can click on every boot though. Run secpol.msc > Local Policies > Security Options > Interactive logon: Do not display last user name > Enabled
481ef257385efdd5686e0cd049c2c13a6cea41643195bcb0941bc6b4eb4aac76
['81c99715fe214040be1bdf2444ea0beb']
Try to connect to remote mysql via ssh2 and php. $ssh_server=''; $ssh_port=''; $ssh_user=''; $ssh_password=''; $ssh_connection=ssh2_connect($ssh_server, $ssh_port); $ssh_auth=ssh2_auth_password($ssh_connection, $ssh_user, $ssh_password); $ssh_tunnel = ssh2_tunnel($ssh_connection, $ssh_server, $ssh_port); $db_hostname = 'localhost'; $db_database = ''; $db_username = ''; $db_password = ''; $db_port = '3306'; $connection_mysql = new mysqli($db_hostname, $db_username, $db_password, $db_database, $db_port); Tunnel is ok, but I see, that mysql use my local mysql DB, not remote via SSH. So, how can i use mysql via SSH? OS windows with WAMP on it.
6e59840f8ddc6d67dcbffb9f4d8717e1524b3fd094e1295aed67ffbd0cd5e348
['81c99715fe214040be1bdf2444ea0beb']
I have date without time in unixtime (1497851100 - 2017-06-19) and I have a time in format H:m (13:45, for example). So, how can I get a fully unixtime (timestamp)? My solution: convert H:m to seconds and add it to unixtime. But maybe there is any other solution withowt .split(':') and etc.?
7e6e0db67b828613c584c6990ff1ae07fd4a08fdd7a8093d7adea09315e76bf8
['81cc366dbac54316b52736452c7d9da3']
I have a view named _RequirementAreaExtranetContent. When trying to load it, I get the VirtualFile content from my VirtualPathProvider. I have boiled it down to the simplest HTML inside, and also replaced the content with that of a partial view that IS working. Does anyone have any idea why it may not be loading?
aa310006e877191e12eae198fee0039a876b3e6925705102899d55c7288e3387
['81cc366dbac54316b52736452c7d9da3']
I have heard good things about SlowCheetah, but was unable to get it to work. I did the following: add am tag to each for a specific configuration. Ex: <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'UAT|AnyCPU'"> <OutputPath>bin\UAT\</OutputPath> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AppConfig>App.UAT.config</AppConfig> </PropertyGroup>
7a10819bca4f854c4ab73b3b820f7cec78804ab9d5534a1f4fe6c930e58bb91f
['81d9da58108f430588ecc3a89c386369']
It's not a good approach to skip last number of records and then fetch the remaining because there might be new insertions in to the database that leads to invalid records. Any how you can use offset to skip number of rows as per your requirement. scope :waiting_list, -> { where(will_not_attend: false).order(created_at: :asc).offset(Attendee.count - 5) }
30ce8d524486f693b66b9048597382afd43e7d4ee0dcc29af2c6eb29279cb772
['81d9da58108f430588ecc3a89c386369']
For me jQuery Version is 1.10.2 To check the substring within the string you can use includes jQuery function like this var sub_str = "find" var main_str = "find me if you can" result = main_str.includes(sub_str) if result{ * Stuff todo if result found }else{ * Stuff todo if result not found } result true; // if you have sub string finder method separately and calling it from somewhere else.
8de357f79cffe090e40187b320370ea71dfe2b64bd416a1ff57e6ec85fc90c33
['81ecd9d1ac6a48f1b4de9257326bf2d3']
I had a spa panel installed when the home was built for a future spa. Now we've found a spa and it requires 60a breaker at the panel. The panel has a 50a breaker in it. The panel inside the house at the other end has a 60a breaker. The wire between the panels is 6 AWG copper. I've read 4 gauge wire would be better for the 60a but also that the 6 gauge wire is enough and is what is required per the spa manual. Can I just swap the 50a breaker for a 60 at the spa panel and not have to install 4 gauge wire and a 60a spa panel?
17c1acad1c79e3c391d3f50407da4714ec96b9f51a50eafcdb96f68020cb4304
['81ecd9d1ac6a48f1b4de9257326bf2d3']
A dashboard, as described by <PERSON>, is [...] a visual display of the most important information needed to achieve one or more objectives; consolidated and arranged on a single screen so the information can be monitored at a glance. Based on the above quote, a dashboard should not be considered as a comprehensive tool for analysis or decision making. It should be used as a stepping stone where from there you can drill down to other sections in your product for further details and analysis. A dashboard should be treated as a summary/overview of the most important information your users require to achieve their main goal - not just any other task. Hence you should consult with your users/customers of what's the most important information they are interested in. From there any further details they require to see they should be able to drill down through another section in your product rather than on the dashboard. Talking with your users/customers will give you plentiful of insights and responses that you might not have thought of previously and help you form better insights as to what's most important to them in their current day to day job.
ef3e71f2f4f24c970a3b329c565e5e2d8027aedde2d9a8fc20f1c565f73b87ea
['81f27eb748b8433385f8ad6370338af2']
<PERSON> I tried this out of my own curiosity but got an error "This ActiveX control cannot be inserted". I looked and apparently this method is turned off by default "for security reasons". You also have to change a registry value to make it work: https://support.microsoft.com/en-us/help/2793374/cannot-insert-certain-scriptable-activex-controls-into-office-2013-documents
fc2c60ecbc8f711e817bc96d3238d397c9ebb8cb86af5479bb07b34cb3c8d663
['81f27eb748b8433385f8ad6370338af2']
What I have done personally is I have an FTP site and then a program that basically grabs installers in a list from that FTP site to which I can always grow. Perhaps something along those lines would work for you? You could use a hosting site or even google drive. As far as installing them in a suite you can make custom scripts that go down the list to install one after another
66cfbb41f9862dd8d3a9ff8c1a1bb33bbc58db7d86d5d75d9e5642a4118b93d2
['822078cc0ce14d1fa8c8a7cb9eb2b195']
Welcome All. Currently I'm working with Xamarin.Forms. Could somebody tell mi please how to set redirectUrl in xamarin.auth? I'm stuck with this one. Write now I have something like this in my .Droid project: var authUrl = "https://www.linkedin.com/uas/oauth2/authorization"; var redirectUrl = "http://localhost:3000/signin_linkedin"; var tokenUrl = "https://www.linkedin.com/uas/oauth2/accessToken"; var auth = new OAuth2Authenticator( clientId: "*", clientSecret: "*", scope: "r_basicprofile", authorizeUrl: new System.Uri(authUrl), redirectUrl: new System.Uri(redirectUrl), accessTokenUrl: new System.Uri(tokenUrl)); I managed to get LinkedIn login and pass form. When I click "Sing in and allow" I get error like: "The web page at http://localhost:3000/signin_linkedin?code=..." could not be loaded becouse: net::ERR_CONNECTION_REFUSED I think the reason of this behavior is invalid redirectUrl. Best regards <PERSON><IP_ADDRESS>ERR_CONNECTION_REFUSED I think the reason of this behavior is invalid redirectUrl. Best regards Michał
9028efd1dc1bf728cd27d71ad12724fe1c0996be42a42253a6328311016a002e
['822078cc0ce14d1fa8c8a7cb9eb2b195']
I'm just wondering how to approach to my project. In my application I have: MVC4 project DB_Project with Interfaces and Models Repository_Project with interfaces implemantation - I'm using Ninject Next step is mobile app(XAMARIN), and here is the question: What kind of WCF project should I choose and why...WCF Service Application or WCF Service Library? Should I add this project like any other or create separate one? After choosing WCF project, how to use reference to Repository_Project - is this the right way?
6c2f64272df1ea9b06e481df57173aa4db8fd5739a6a1378f06371a96fcfa16d
['8229b867c54d4e1ab736d63128370656']
I've requirement where I need to store information from different sources in my system and the process that data. When I say from different sources it will be completely different table structure from all the sources and these sources will be infinite. If I've to maintain the same table structure of source then I've to create multiple tables for each source and I'll have thousands of sources so my database will be bloated with lot of tables. All this information is accessed within my system so for each source I need to maintain mapping information with that I can query particular table to get that source data. Hence I came with a single table structure to store that data and it looks like below - tables with column information: TableMetaData Id, TableName, SourceId TableFieldMetaData FieldId, FieldName, TableMetaDataId TableFieldValues Id, MetaDataFieldId, Value Example source table Customer CustId, Name, Location 1, ABC, London above table will be stored as below in my three tables: TableMetaData 1, Customer, XYZSource TableFieldMetaData 1, CustId, 1 2, Name, 1 3, Location, 1 TableFieldValues 1, 1, 1 2, 2, ABC 3, 3, London I want to know whether this is the best approach to store data or not? I know this single table will have millions of records and retrieving the data will be very tedious too. Is there any better approach for storing this kind of data? Or should I go with multiple tables approach which I mentioned initially where every source will have replica of their tables in my system. What is the industry standard for this?
c4eac44917333d1423a6f274a7f0f2f70b74336415c47060ea2aed3170550588
['8229b867c54d4e1ab736d63128370656']
I am trying to prove the NP-Completeness of Min-satisfiability problem which can be defined as: Given a CNF formula (Set of clauses of 1 or more boolean variables) and a number x, there exists a satisfying assignment of those variables such that number of true variables in the assignment is less than or equal to x
0f275fb888bbe0102db7af7f53e5c718d4d2a48473724443d81119b752e9634a
['8231c3ab3d1c4ad38010bce6375ff5fd']
Ya so it turns out you just need to use v[seq(to=length(v),by=stride)], just another quirk of R. Though as <PERSON> mentioned they don't bother making it easier since array order is less important to statisticians. I imagine people are more likely to do something like sample(v,as.integer(length(v)/stride)) without being so verbose of course.
1259009874f870ad2c74a10b0a01e7b13e8cade06525a75240954fd11a445db2
['8231c3ab3d1c4ad38010bce6375ff5fd']
In numpy if you have an array x you can access it's elements with a 'stride' (i.e. skipping some inbetween) like so: x[<IP_ADDRESS>2]. How can you do this in R with a vector? I've searched all over the internet and couldn't find an answer to something so simple, kind of surprising. EDIT: I just realized that you could use seq(), but is there no built-in method for doing this?
c53bd09ba6974b6249e25f047fbf45ad80269835f7d17c842968905ea990e6ef
['823321228cb14ca6a4a1be0d9d1b3774']
If I have two colors, let's say Red (#ff0000) and Dark Red (#850000). Is there a way to make it so that when one color is changed, the other changes accordingly? So for example if I change Red into Blue, Dark Red automatically changes to Dark Blue and so on..
d9fca4f8520d3087322aba603cc6481c3f32bdd124d3c5396b28e2e27294a4cf
['823321228cb14ca6a4a1be0d9d1b3774']
I'm making a chrome extension that has an options.html page. On the options page I have 3 checkboxes. When one of the checkboxes is checked/unchecked the value of that checkbox is saved to- or removed from chrome.storage using chrome.storage.sync.set(). But I can't seem to retrieve the data once it is saved using chrome.storage.sync.get(). Here's the code I have: options.html: <div class="checkboxes"> <input id="test1" name="test1" type="checkbox"> <input id="test2" name="test2" type="checkbox"> <input id="test3" name="test3" type="checkbox"> </div> options.js: $(document).ready(function() { var storage = chrome.storage.sync; //Retrieve existing settings $(':checkbox').each(function() { $(this).prop('checked', function() { var name = this.name; storage.get(name, function(test){ console.log(test[name]); }); }); }); $(".checkboxes").on("change", ":checkbox", saveSettings); //Save or delete settings function saveSettings() { var name = this.name; if($(this).is(':checked')) { storage.set({name:'checked'},function(){ console.log("saved"); }); } else { storage.remove(name, function(){ console.log("removed"); }); } } }); Above outputs: console.log(test[name]); > undefined console.log("saved"); > saved console.log("removed"); > removed Why do I get "undefined"? I tired the same thing using localStorage which worked fine on only option.js. But when I tried to retrieve the stored data on background.js it didn't work. I figured their localStorage details are not accessible to each other. I should also mention I'm not the best at javascript/jquery and I'm still learning, so please excuse my mistakes.
650e06c947a22a695b422d7cb59d47d23066167ab0cca6794a6d770c23676f14
['82336429bcc74d7880f72e1e53341bbd']
I supose that you, previously have this mod_rewrite rule active: Users goes to http://site.com/product/12 and in the browser is showed this URL, and internaly, and only internaly, server serve http://www.site.com/product.php?id=12 Put the first RewriteCond and Rule this: RewriteCond %{ENV:REDIRECT_STATUS} !200 RewriteRule ^(\w+)\.php\?id=(\d*)$ /$1/$2 [R=301] And add another to remove the .php when ends with .php RewriteCond %{ENV:REDIRECT_STATUS} !200 RewriteRule ^(\w+)\.php$ /$1 [R=301]
5129214ce9857670fd45970dbe92bb4db7ee1a0463ddbe691d216a3e9a4fb335
['82336429bcc74d7880f72e1e53341bbd']
All that you made with cookies will be data supplied by your users, then you cannot trust it. In other hand, if you work with cookies, all of them will travel in each request header. You should do it in server side and yes, a database is not performant. You can try to persist this information with something like Redis, a in-memory data structure store, used as database, cache and message broker.
699d97c0d3627774d1723dfbde1bd3141c74bf6539db90b17db29b7d035a5d2e
['823c8f5e596b42a4bc661bd339e32d42']
$user = User<IP_ADDRESS> select('name', 'email_id', 'gender') ->where($field, "=", $postData['login']) ->where("password", "=", sha1($postData['password'])) ->first(); if ($user) { $token=str_random(60); $user->api_token=$token; $user->save(); $response['status'] = 200; $response['message'] = "success"; $response['data'] = $user; } else { $response['status'] = 200; $response['message'] = "failure"; } In this code, the "if" statements only run if $user has some value, which is obvious but if $user is null, next statements didnt execute. Even if i write echo "anything" just below query, it didnt display it, it just return null. So i didnt get values written in else block. I have tried different things, but fails in that.
f281c770894c9b5a8e851357efc1eec8c9145ffbb2aaa666e33fa2b817a1223e
['823c8f5e596b42a4bc661bd339e32d42']
I tried a lot but no result:- Create Form Response Function: public static $codes= array('error1','error2','error3'); public static function createFromResponse($response) { $code = $response->body->category_code; //it contains the values from $codes array if (isset(self<IP_ADDRESS>$codes[$code])){ $cn = self<IP_ADDRESS>$codes[$code]; } else{ $cn = get_class(); } return new $cn($response); } Currently $cn contains class Bookmyroom and $response is object containing error for e.g. class bookroom- class Bookmyroom extends Error { // contains some functions } Error Class:- class Error extends Base { public $response; public function __construct($response) { $this->_objectify($response->body); } public function _objectify($fields) { foreach ($fields as $key => $val) { $this->$key = $val; } } } Only the line return new $cn($response); in the first function function CreateFormResponse(); throws 500 Internal Server Error - Bookmyroom Thanx in advance...
75d1172673f7382f498796254fa24d5f2718bcf82f26966ae9ea082705b0c03f
['8243ee4cf6cf4397b8aa58c953139bc2']
After one success circle of animation, tweenjs gets me twitching, i wanna create infinity moving animation, from top, to bottom, but i have some bugs in my code I need help! http://weblife.su/WineBazar/1/ var group_position_1 = new TWEEN.Tween(group.position) .to({ y: THREE.Math.degToRad(-20)}, 1000) .yoyo(true) .repeat(1) .easing(TWEEN.Easing.Linear.None) .onStart(() => { }) .onUpdate(() => { }) .onComplete(() => { group_position_2.start() }) var group_position_2 = new TWEEN.Tween(group.position) .to({ y: THREE.Math.degToRad(-30)}, 1000) .yoyo(true) .repeat(1) .easing(TWEEN.Easing.Linear.None) .onStart(() => { }) .onUpdate(() => { }) .onComplete(() => { group_position_1.start() })
57982de7b802c3dff604f549171b4c2b6375f02a1469533d389ad6747caf581d
['8243ee4cf6cf4397b8aa58c953139bc2']
I am searching for a method, how to add this model to my page. Cuz now, I have only a black bottle without any glare. When i uploaded this model, i cant add color and e.t to the bottle. Ive added some code after. [1]: https://i.stack.imgur.com/mhLpV.jpg [2]: https://imgur.com/a/1lN4WJa var camera, scene, renderer; init(); function init() { scene = new THREE.Scene(); directionalLight = new THREE.DirectionalLight(0xffffff, 100); directionalLight.position.set(0, 1, 0); directionalLight.castShadow = true; scene.add(directionalLight); scene.add(light4); camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 500); camera.position.x = 1; camera.position.y = 1.5; camera.position.z = 2; scene.add(camera); renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setPixelRatio(window.devicePixelRatio); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); var loader = new THREE.GLTFLoader(); loader.load('../ws_r_2-3.glb', function(gltf) { gltf.scene.position.y = 0; scene.add(gltf.scene); render(); }); var controls = new THREE.OrbitControls(camera, renderer.domElement); controls.addEventListener('change', render); controls.update(); window.addEventListener('resize', onWindowResize, false); } function onWindowResize() { renderer.setSize(window.innerWidth, window.innerHeight); render(); } function render() { renderer.render(scene, camera); }
55e824c39a5a6d04c23bb80d7e52b997979f4da7cacebf477cb7216d9b87c2b4
['8244dcf27fdc43aea8f35fe140cd4881']
To expand on what everyone else has said, you are using setState in the render method. It appears you are changing the state using the props this.setState({ tickets:this.props.tickets, }); In your code, you do not need to do this, you can use this.props. directly instead of this.state.tickets in jsx. However, should you need to update your state based on the props, you should use getDerivedStateFromProps With that, you can write a static method like this static getDerivedStateFromProps(props) { return { tickets: props.tickets } } The return value of getDerivedStateFromProps is used to update the state. In this case, the tickets key in state will be updated with the value of props.tickets.
906f6366317d316a3746044416486147f2cf72470d011e1be5f904b3c9b9010f
['8244dcf27fdc43aea8f35fe140cd4881']
I have encountered the following scenario when trying to test a saga from redux saga. Some package information: I use redux-saga@0.15.6, redux@3.7.2 with node v9.5.0 and npm 5.6.0. I have the following structure: sagas index.js index.spec.js Inside index.js, I define my sagas. A basic idea of what I have there is this: function doSomething() { /* Some code */ } function* notExportedSaga() { yield takeLatest(SOME_ACTION, doSomething) } export function* exportedSaga(action) { yield put({ type: OTHER_ACTION, payload: somePayload }) } In index.spec.js, I want to test my sagas. I have a import at the top of my file: import { exportedSaga } from './index' With the structure and code I described, this works just fine. However, if I change doSomething from being defined like it is to a fat arrow function: const doSomething = () => { /* Some code */ } What will happen is, when running the unit tests, I will get this error: console.error node_modules/redux-saga/lib/internal/utils.js:240 uncaught at rootSaga at rootSaga at rootSaga ReferenceError: doSomething is not defined Do you know why this is happening? I have open a issue , because I don't know if this is a bug or not.
c0a2da0d84211c8ce0be5ba464557c46aaa9b47acdeea5602f9afdc444d1e023
['824eb15369944ba2b53829b76b6780ca']
I am trying to create a Google Apps Script for a Spreadsheet of mine. It is supposed to run a function and based on today's date return the results to a specific sheet in the spreadsheet. When just appending rows to the active sheet and not a specific sheet it works fine. Also, the code saves fine in the Script Editor, so I would assume there are no major errors. Perhaps I have it laid out wrong in the Javascript or a fundamental error in the code that I do not understand. I am leaning towards my IF ELSE or how I am setting the active spreadsheet then sheet, but don't know for sure. Any help would be appreciated. Here is the code basics: function CheckDateInsertData() { function infoDate(){ this gets today's date} if (infoDate() >= 2016/01/01 && infoDate() <= 2016/01/31) { function GetData1{ //this retrieves necessary data, working when not using IF ELSE statements and only single active sheet, without calling sheet by name. var Data =.......... ; appendData(Data); function appendData(Data){ var sheet = SpreadsheetApp.getActiveSpreadsheet(); sheet.setActiveSheet(sheet.getSheetByName("January")); sheet.appendRow(['Date', 'Price', 'Location']); } } } else if (infoDate() >= 2016/02/01 && infoDate() <= 2016/02/29){ function GetData2{ var Data = ........; appendData(Data); function appendData(Data){ var sheet = SpreadsheetApp.getActiveSpreadsheet(); sheet.setActiveSheet(sheet.getSheetByName("February")); sheet.appendRow(['Date', 'Price', 'Location']); } } } }
77f006c1b039538817bd36ca9a4ea5d3904e3ddd7334d71bd6d369bc36fe94b1
['824eb15369944ba2b53829b76b6780ca']
disclosure. I am not a programmer For the past year or so I have been utilizing the Facebook Graph API to pull Facebook page "likes" into a spreadsheet so that I can track how many likes my page gets vs other pages of similar business. It is kind of rudimentary but it became cumbersome to have to visit every page each week to get the total page "Likes" so this my solution. I was utilizing this formula... =importjson(concatenate("https://graph.facebook.com/",APINames!$B11,"?access_token=",$B$1),"/likes","noHeaders") I reference this post... Get Facebook page like count for OpenGraph v2.10 Which states to use the a different URL to retrieve page likes. https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count When inputting the new URL in my formula function I still receive a reference error. =importjson(concatenate("https://graph.facebook.com/v2.10/",APINames!$B3,"?access_token=",$B$1),"&fields=fan_count","noHeaders") If anyone could point me in the right direction I would be very grateful. I have spent over an hour scouring the web for information as well as reading the new changelog for v2.10. I fear going back to the manual process!!
f800cf32332db05d4122b2c0c2ed7e570f77eef4eedc9259318ac4d3018623dc
['8268f89a9fc64164af456d998a44b96b']
I have this small program as i am trying to understand the vector and the classname being passed as an argument. Here is the program: #include<iostream> #include<vector> using namespace std; class objectclass{ public: void vec_try(){ cout<<"print out something"; } }; class another{ public: void run(); vector<objectclass *>ports; void add_obj(objectclass *p){ ports.push_back(p); } }; void another<IP_ADDRESS>run(){ //int j=0; ports[j]->vec_try(); } int main(){ another a; a.run(); system("pause"); return 0; } i have idea that passing classname in vector as an object is fine and then using push_back to insert the element in that vector but in the function add_obj(objectclass *p) how do i pass the values if i dont want to change the defination of the function. i know a way like this: objectclass *p; p= new objectclass[10]; but my function has already defination and also i want to call the function vec_try() with ports[i] so i am not getting how to pass the values and the how this is working with ports[i]. i basically need some clarification on this.
786090228395223e84e1f40d75393d188b6423e50af7528d61b87f97948546b1
['8268f89a9fc64164af456d998a44b96b']
I have this socket program which has both parts of send and recieve but when i use select it always returns "Time error " . Here is code void server<IP_ADDRESS>run(){ int RetVal; struct timeval *tp=new timeval; tp->tv_sec=300; tp->tv_usec=500000; fd_set readfds; FD_ZERO(&readfds); FD_SET(sock,&readfds); FD_SET(sock1,&readfds); cout<<"run() is working fine"; if((RetVal=select(1,&readfds,NULL,NULL,tp))==SOCKET_ERROR) //check for incoming packets. { cout<< "Timer error!"; Sleep(50); } else if(RetVal>0) //There are incoming packets. { if(FD_ISSET(sock1, &readfds)) //incoming packet from peer host 1 { send(); } else if(FD_ISSET(sock, &readfds)) //incoming packet from peer host 1 { send1(); } else{ cout<<"no port is open to communicate"; } } } server<IP_ADDRESS>server(){ WSADATA wsadata; try{ if (WSAStartup(0x0202,&wsadata)!=0) throw"Starting WSAStartup() error\n"; //Display name of local host if(gethostname(servername,HOSTNAME_LENGTH)!=0) //get the hostname throw"Get the host name error,exit"; } catch(char *str){ cerr<<str<<":"<<WSAGetLastError()<<endl; } printf("Server: %s waiting to be contacted for time/size request...\n",servername); } server::~server(){ WSACleanup(); } void server<IP_ADDRESS>send(){ try{ if ((sock= socket(AF_INET, SOCK_STREAM, 0)) == SOCKET_ERROR) { cout<< "SERVER: socket unable to initialize\n"; } servers.sin_family = AF_INET; servers.sin_port = htons(port); servers.sin_addr.s_addr = INADDR_ANY; if (bind(sock, (sockaddr*)&servers, sizeof(servers)) == SOCKET_ERROR) { cout<<"SERVER: Cant Bind the Socket"; closesocket(sock); } if (listen(sock, MAXPENDING) == SOCKET_ERROR) //if((value=listen(sock, MAXPENDING))==SOCKET_ERROR) { cout<<"SERVER: listening socket not open"; closesocket(sock); } if ((clientSock= accept(sock, 0, 0)) == SOCKET_ERROR) { throw"SERVER: connection not accepted"; } if ((nBytes= send(clientSock, "Hello", 20, 0)) == SOCKET_ERROR) { throw"SERVER: data sending failed "; } } catch(char *str){ cerr<<str<<":"<<WSAGetLastError()<<endl; } closesocket(clientSock); closesocket(sock); } void server<IP_ADDRESS><IP_ADDRESS>~server(){ WSACleanup(); } void server::send(){ try{ if ((sock= socket(AF_INET, SOCK_STREAM, 0)) == SOCKET_ERROR) { cout<< "SERVER: socket unable to initialize\n"; } servers.sin_family = AF_INET; servers.sin_port = htons(port); servers.sin_addr.s_addr = INADDR_ANY; if (bind(sock, (sockaddr*)&servers, sizeof(servers)) == SOCKET_ERROR) { cout<<"SERVER: Cant Bind the Socket"; closesocket(sock); } if (listen(sock, MAXPENDING) == SOCKET_ERROR) //if((value=listen(sock, MAXPENDING))==SOCKET_ERROR) { cout<<"SERVER: listening socket not open"; closesocket(sock); } if ((clientSock= accept(sock, 0, 0)) == SOCKET_ERROR) { throw"SERVER: connection not accepted"; } if ((nBytes= send(clientSock, "Hello", 20, 0)) == SOCKET_ERROR) { throw"SERVER: data sending failed "; } } catch(char *str){ cerr<<str<<":"<<WSAGetLastError()<<endl; } closesocket(clientSock); closesocket(sock); } void server::send1(){ try{ if ((sock1= socket(AF_INET, SOCK_STREAM, 0)) == SOCKET_ERROR) { throw "SERVER: socket unable to initialize\n"; } servers.sin_family = AF_INET; servers.sin_port = htons(port); servers.sin_addr.s_addr = INADDR_ANY; if (bind(sock1, (sockaddr*)&servers, sizeof(servers)) == SOCKET_ERROR) { throw"SERVER: Cant Bind the Socket"; closesocket(sock1); } if (listen(sock1, MAXPENDING) == SOCKET_ERROR) { throw "SERVER: listening socket not open"; closesocket(sock1); } cout << "SERVER: Ready to run now..."; if ((clientSock= accept(sock1, 0, 0)) == SOCKET_ERROR) { throw"SERVER: connection not accepted"; } if ((nBytes= send(clientSock, "Hello", 20, 0)) == SOCKET_ERROR) { throw"SERVER: data sending failed "; } } catch(char *str){ cerr<<str<<":"<<WSAGetLastError()<<endl; } closesocket(clientSock); closesocket(sock1); } I have tried so many things but my select() is always returning same thing. My program is working fine without run() and select() if i call send and recv() directly its working fine. but select() is not working i guess.
95deb85e0e2d09f4cee4422062d0198b133309d4097d2e97bd9d446be63b9bb6
['826ae036fcf84da3a633009b771c4d45']
Thanks to <PERSON>, I managed to find the following solution that worked. This allowed me to track my progress to update UI whilst also using a completion handler. observation = task.progress.observe(\.fractionCompleted) { progress, _ in DispatchQueue.main.async(execute: { self.globalScrollTitle.mainprogress = CGFloat(progress.fractionCompleted) }) if progress.fractionCompleted == 1 { completion() } } My download func now looks like this: func download(url: String, fileName: String, completion: @escaping () -> Void) { let myUrl = URL(string: url) let request = URLRequest(url:myUrl!) let config = URLSessionConfiguration.default let operationQueue = OperationQueue() let session = URLSession(configuration: config, delegate: nil, delegateQueue: operationQueue) let task = session.dataTask(with: request) { (data, response, error) in guard error == nil else { print(error!) return } // Success if let statusCode = (response as? HTTPURLResponse)?.statusCode { print("Success: \(statusCode)") } do { let documentFolderURL = try FileManager.default.url(for: .downloadsDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let fileURL = documentFolderURL.appendingPathComponent(fileName) try data!.write(to: fileURL) DispatchQueue.main.async { if FileManager.default.fileExists(atPath: fileURL.path) { print("file present!") // Confirm that the file is here! } } } catch { print("error writing file \(error)") } } observation = task.progress.observe(\.fractionCompleted) { progress, _ in DispatchQueue.main.async(execute: { self.globalScrollTitle.mainprogress = CGFloat(progress.fractionCompleted) }) if progress.fractionCompleted == 1 { completion() } } task.resume() } }
43b07619ce0cf09585c154c55a68a0a5ffb2a7915c1ed9be29e40a4bf617f5c4
['826ae036fcf84da3a633009b771c4d45']
First of all, as others have said, it is better to use parameters when executing SQL queries in VB.NET. It has many benefits and it's fairly simple. Taking a snippet of your insert query as an example, instead of defining the first value clause as '" & TBPENJADWALAN.Text & "' the first value might be @TBPENJADWALAN. The string from TBPENJADWALAN.Text is then passed to @TBPENJADWALAN using the following code: cmd.Parameters.Add("@TBPENJADWALAN", OleDbType.VarChar, 50).Value = TBPENJADWALAN.Text OleDbType.VarChar = Type of data you're storing 50 = Size of your field So instead of your code as follows... simpan = ("INSERT INTO T_Penjadwalan(Kode_Penjadwalan) VALUES ('" & TBPENJADWALAN.Text & "') ...it would be: simpan = ("INSERT INTO T_Penjadwalan(Kode_Penjadwalan) VALUES (@TBPENJADWALAN)") cmd.Parameters.Add("@TBPENJADWALAN", OleDbType.VarChar, 50).Value = TBPENJADWALAN.Text It's much cleaner and more secure. You can take that example and change the rest of your insert query. In terms of your original question about inserting data to a DataGridView, in my experience, it's best to create a DataSet and Adapter to fill it. Try this: Dim adapter As SQLDataAdapter Dim ds As New DataSet adapter = New SQLDataAdapter(simpan, cmd) adapter.Fill(ds) DataGridView1.DataSource = ds.Tables(0)
89fccbf30584bba06c3ba11e3c4fd78901c51813168e915ec972c62334d27d71
['826b210618c6422b981457c36de28d6a']
I would like to make my web page that I coded with Ruby on Rails as backend embeddable so that users are able to easily share it by copy and pasting some embed code. (much like YouTube embed code, but for a webpage) Could someone point me to a tutorial or general direction how to go about doing so? I'm planning to embed my web page in Joomla CMS. Many thanks. <PERSON>.
533feccaf60821aac92c394880245a825217500e4d47f8a7417d8571c6b7ac74
['826b210618c6422b981457c36de28d6a']
Suppose I have : SM Week Capacity A 0 1000 A 1 110 B 1 980 B 2 89 B 3 89 And I want to get : SM Week Capacity A 0 1000 B 1 980 In other words, I want to get only the rows where the week is the minimum in the group defined by SM. How can I do this in pandas, outside of iterating row by row to check manually? Thanks.
6b84f3ae18023705601ef6f801f244163297a8a0cb887d7c09b1e81e66fb9bc2
['826c027c331e479796d74fb9110e31ea']
Xcode Question, how to run one file at a time? I keep getting this error: "Linker command failed with exit code 1" and I've noticed that it occurs when i use the "int main" method in multiple files. Furthermore, when I try to run a simple return 0 file, my "hello world" file still gives results to the console. So my assumption is that xcode is running all of the files in the project at the same time causing me to have a duplication error when I repeat method names (such as "int main"). How do I only run one file at a time? These are C files by the way, I'm using xcode as a tool to practice my c programming before next semester. Thanks for your help!
73d5f63ea78b1df71d88a67a57aebbcca820d5a005957a99cc47023637983d3f
['826c027c331e479796d74fb9110e31ea']
Given the root node of a Binary Search Tree, I'm trying to create a recursive search where all nodes within a given maximum and minimum range are found but in the LEAST amount of visits. So essentially the set up to this question will be(I think): public Node finder(Node root, int max, int min) {};
f0b0998593aca7f351272957f579d55d51593ab8164b52f33c37c30ca1a54e8b
['82736041c0fa4e84b927df96212ea8e6']
I am new to python and pyglet, so this could be trivial question, but i was not able to find a solution so far. I am trying to export my application to a .exe with pyinstaller. I am able to create a .exe with the command pyinstaller --hidden-import pkg_resources.py2_warn GameWindow.py However, when i try to execute the GameWindow.exe i get several errors and the following traceback Traceback (most recent call last): File "site-packages\pyglet\__init__.py", line 334, in __getattr__ AttributeError: 'NoneType' object has no attribute 'StaticSource' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "GameWindow.py", line 294, in <module> File "site-packages\pyglet\__init__.py", line 340, in __getattr__ File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "c:\users\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module exec(bytecode, module.__dict__) File "site-packages\pyglet\media\__init__.py", line 143, in <module> File "site-packages\pyglet\media\codecs\__init__.py", line 175, in add_default_media_codecs File "site-packages\pyglet\media\codecs\__init__.py", line 128, in add_decoders File "site-packages\pyglet\media\codecs\wmf.py", line 881, in get_decoders File "site-packages\pyglet\media\codecs\wmf.py", line 829, in __init__ File "_ctypes/callproc.c", line 935, in GetResult OSError: [WinError -<PHONE_NUMBER>] Cannot change thread mode after it is set [11808] Failed to execute script GameWindow Error in atexit._run_exitfuncs: Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "c:\users\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module exec(bytecode, module.__dict__) File "site-packages\pyglet\media\__init__.py", line 143, in <module> File "site-packages\pyglet\media\codecs\__init__.py", line 175, in add_default_media_codecs File "site-packages\pyglet\media\codecs\__init__.py", line 128, in add_decoders File "site-packages\pyglet\media\codecs\wmf.py", line 881, in get_decoders File "site-packages\pyglet\media\codecs\wmf.py", line 829, in __init__ File "_ctypes/callproc.c", line 935, in GetResult OSError: [WinError -<PHONE_NUMBER>] Cannot change thread mode after it is set Exception ignored in: <function WMFDecoder.__del__ at 0x000002594E230318> Traceback (most recent call last): File "site-packages\pyglet\media\codecs\wmf.py", line 876, in __del__ AttributeError: 'WMFDecoder' object has no attribute 'MFShutdown' Exception ignored in: <function WMFDecoder.__del__ at 0x000002594E230318> Traceback (most recent call last): File "site-packages\pyglet\media\codecs\wmf.py", line 876, in __del__ AttributeError: 'WMFDecoder' object has no attribute 'MFShutdown' i tried to use pyinstaller --hidden-import=['pkg_resources.py2_warn', 'WMFDecoder.MFShutdown'] GameWindow.py, but doesn't help. Do you have any suggestion on how to solve this issue?
343dffbcb52612fd288fa7407801abb0755c7bcece9284e0a20498ede8bd0175
['82736041c0fa4e84b927df96212ea8e6']
I would like to know if there is a way to execute compiling and linking actions with Bazel in separate steps. If i execute the command bazel build -s //main:hello-world all the bazel SUBCOMMANDS are printed. I am aware that is possible to execute these subcommands from command line, but I would like to know how to use Bazel to execute for instance only the compile action, and only the linking action in separate steps. Thank you in advance for any help!
02cbfc0ee03d01490866a538227cb01d4f1cc3a847cfc65cc55856aec43aabbf
['827bb1f4e01548e5aaf71cb4b2b28a8b']
I'm trying to read from a remote data source using Kendo DataSource. "Uncaught TypeError: undefined is not a function". The browser successfully makes the AJAX call, and I'm unable to figure out what's wrong with Kendo internally. Their documentations are of no help. Here's my code: var accountsListDs = new kendo.data.DataSource({ transport: { read: { url: "http://localhost:8085/cabinet/wicket/bookmarkable/com.finovera.web.services.AccountsService", dataType: "json", type: "GET", data: { op: "list" } } } }); Here's the stack trace: http://pastebin.com/GtaHifJM
44b1837005bef16f6d8087425034ca89662aaf5bba4487a2d6887c906d839e7a
['827bb1f4e01548e5aaf71cb4b2b28a8b']
The reason why it does show up properly in certain screen resolution is because your image dimension is 1550x417, and you using CSS background position property to set it to 1300px 400px. That's not a very responsive way to setting background position, and it bound to vary from screen to screen. There is an easier way to do this. Since the banner is mostly solid color why not slice only the graphic part of the image, and use background color? You can then position the image to the center of the element. Slice: http://i.imgur.com/2s35JYs.png Example: background: url('../images/banner2.jpg') center center no-repeat #ECE8DF;
bc0ceb4305ceb1ba11b1fb38abc361db4d8e94cc74989c793ee0d38ef5d5a0aa
['828557dced98409ca58de7a3a43974de']
i add row in flexigrid directly, and i try to update row directly but flexAddData always show old row. how to update row directly ? any idea ? please help i am sorry my english not well if ( flag == 'add' ){ $.ajax({ type : "POST", url : "tr_procurement_data.php", data : "process=prod_name&id_prod="+id_prod+"&qty_pad="+qty_pad+"&hb_pad="+hb_pad , dataType : "json", success : function(data){ //add record to array rows.push({id: [data.id_prod], cell: [ data.id_prod, data.nm_prod, data.qty_pad, data.hb_pad ] }); data = { total: 1, page:1, rows: rows} $("#flex1").flexAddData(data); } }); } if ( flag == 'edit' ){ var fgrid = getAllRow(); //save array var fleng = fgrid.length; fgrid.forEach(function(row) { alert(row); if ( id_prod == row[0] ){ rows.push({id: [row[0]], cell: [ row[0], row[1], qty_pad, hb_pad ] }); }else{ rows.push({id: [row[0]], cell: [ row[0], row[1], row[2], row[3] ] }); } }); data = { total: fleng, page:1, rows: rows} deleteRow(); $("#flex1").flexAddData(eval(data)); } } function deleteRow() { $("[id^=row]").each(function() { $(this).find('div').each(function() { alert( $(this).html() ); $(this).remove(); }); }); } function getAllRow() { var arrReturn = []; $("[id^=row]").each(function() { var arrRow = []; $(this).find('div').each(function() { arrRow.push( $(this).html() ); }); arrReturn.push(arrRow); }); return arrReturn; } that's my code hope
80bd319e78947e1da90896c7d7659534af64d22593b6150ef0e8993950b1e0e3
['828557dced98409ca58de7a3a43974de']
maybe this can help u function conditionalDialog(mode){ var theButtons = {}; var theautoOpen = true; var title = ""; if (mode=='first'){ theautoOpen = false; } if (mode=='Add'){ title = "Add Product Record"; theButtons["Save"] = function() { simpan('add'); Tambah(); }; theButtons["Close"] = function() { $(this).dialog("close"); }; }else{ title = "Edit Product Record"; theButtons["Save"] = function() { simpan('edit'); $(this).dialog("close"); }; theButtons["Cancel"] = function() { $(this).dialog("close"); }; } $('#form').dialog("option","title",title); $('#form') .dialog({ autoOpen: theautoOpen, width: 600, buttons: theButtons, show:"slide" }); } u can see at line $('#form').dialog("option","title",title); it will change label
b16aee1d75d50fa84e973aee75beb22b9d958cae525545a7bdaa5e639ee107a8
['8299a082ecf444a694cd60c963fee33e']
I have code which plays a sound after I clicked a button. When I click this button a second time first comes a thing like a reset or so. What I want: Every time I click the button I want to play the sound immediately without reset button. My code: -(IBAction)playfrosch { if (gestartet == 0) { gestartet = 1; NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/frosch.mp3", [[NSBundle mainBundle]resourcePath]]]; NSError *error; audioPlayerfrosch = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; audioPlayerfrosch.numberOfLoops = 0; [audioPlayerfrosch play]; [startfrosch setTitle:@"Frosch" forState:UIControlStateNormal]; } else { gestartet = 0; [startfrosch setTitle:@"Nochmal?" forState:UIControlStateNormal]; } } I think my problems are the part after "else".
ad40a866486bc45ef8573e68a3db99bb5eafc383c4904b1be5fcc2cba93f42db
['8299a082ecf444a694cd60c963fee33e']
after updating to WP 3.8 I can't see anymore my thumbs in archive.php. Here's the code: <div class="post-entry"> <?php if( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail( 'thumbnail', array( 'class' => 'alignleft' ) ); ?> </a> <?php endif; ?> <?php the_excerpt(); ?> <?php wp_link_pages( array( 'before' => '<div class="pagination">' . __( 'Pages:', 'responsive' ), 'after' => '</div>' ) ); ?> </div> In the functions.php I've added the following: add_theme_support( 'post-thumbnails' ); But nothing to do. The thumbnails still no more there. Any help? Thanks in advance, <PERSON>
9eaf9073d61eb023c4fae9152be7ce138bcde129843bd6313de9ee4de8165343
['82a390d9b66545a7906ed28c5b1bca63']
using SSH in th etc/hosts I found: 127.0.0.1 localhost.localdomain localhost ::1 localhost localhost6 localhost6.localdomain6 # Auto-generated hostname. Please do not remove this comment. 127.0.0.1 localhost ip-104-238-95-53 <IP_ADDRESS><IP_ADDRESS> localhost.localdomain localhost ::1 localhost localhost6 localhost6.localdomain6 # Auto-generated hostname. Please do not remove this comment. <IP_ADDRESS><IP_ADDRESS>1 localhost localhost6 localhost6.localdomain6 # Auto-generated hostname. Please do not remove this comment. 127.0.0.1 localhost ip-104-238-95-53 104.238.95.53 ip-104-238-95-53.secureserver.net ip-104-238-95-53
88bd4a60e0096c2c38f84fa527526e6ae5724cad9c26a6a967dafd5d5cd4f5a5
['82a390d9b66545a7906ed28c5b1bca63']
Consider the stochastic volatility state space model $x_{t} = \phi x_{t-1} + a_{t}, \; a_{t} \sim \mathcal{N}(0,\tau^2)$ $y_{t} = \text{exp}(x_{t}/2) \; e_{t}, \; e_{t}\sim \mathcal{N}(0,\sigma^2)$ I know the observation density $p(y_{t}|x_{t}) = \mathcal{N}(0,\sigma^2 \text{exp} (x_{t}))$. I want the predictive observation density $p(y_{t}|x_{t-1})$. Could anyone please help deriving this?
816e8fecdef60128aaba15227a17d99038114f1b8a15869779652cf403f86772
['82a507a0e3a644dd95a8d36c8f33620d']
Hope someone can help me! How can I apply a progressbar to a datagridview. I have a button, when I click it, the records in database loads in a datagridview, but I have many records so when the data is loading, the application looks like it's frozen, I need that the user see the progressbar so he knows its loading. This is my code for the load: Dim conex As New SqlConnection("Data Source=localhost;Initial Catalog=DATABSE;Integrated Security=True") Dim da As New SqlDataAdapter("SELECT * FROM table1", conex) Dim ds As New DataSet da.Fill(ds) dv.Table = ds.Tables(0) DataGridV1.DataSource = dv I've searched and view many answers but I still don't get it using backgroundworker. Or where can I get a good information about this? Thanks in advance!
3fbbc7e12115212585ac19d01ffb8a12a7159579ce3ab7c3b983e6ee56d8aac1
['82a507a0e3a644dd95a8d36c8f33620d']
I have created a Report Viewer using VB.Net. I have created a form wich has 9 optional textboxes. If user input 2 textbox, 3, and so on, I'm looking on how to show each textbox value entered in different page for print. I already know how to show only entered values in same page, but I can not find a solution on how to show each txtbox value (if entered) in pages separately I use this code to show customer info, but I Need to show separately for each textbox entered value: Dim paramName As New ReportParameter("ParamName", customer.NameTxt.Text) Dim paramGender As New ReportParameter("ParamGender", customer.GenderTxt.Text) Dim paramAge As New ReportParameter("ParamAge", customer.AgeTxt.Text) ReportViewer1.LocalReport.SetParameters(paramName) ReportViewer1.LocalReport.SetParameters(paramGender) ReportViewer1.LocalReport.SetParameters(paramAge) Me.ReportViewer1.RefreshReport() Thanks In advance
10df5519229dfac1ed69605fe7415c231cdf638c26fdeb44035b115a88012c07
['82a81db4bcfe41ecada467c154027319']
Many thanks <PERSON>. Like a lot of things, it seems easy when you know how! I'm not really using a 14-point font, I just used it in the example to make the scaling more obvious, and to make it clear that the caption font was being downsized too.
6f253a351d6e4a59c9df1f5825d4a4868ad4e16eddbabec77a685a0c4721c55f
['82a81db4bcfe41ecada467c154027319']
<PERSON>, I thought about your comment today - "but really, think of entering the mid-1990s and switching to zsh" - and you have a point here. For my non- *csh* dependent stuff, I installed *zsh*. I also have *screen* installed now, so I can create a new screen (which will be in the same working directory I was just in), type in *zsh* and voila - I'm in the mid-1990s. I'm not sure that everything works identically as if I'd set *zsh* to the default shell for that user, but it does seem to simplify things (e.g. I can get a directory listing when I use *ls* and ).
2ecfc924b52b244c31bab0f8eeda7e9c86cc87d3dbd03c8bd8e7995ce4a1a012
['82bb736e4a4946cb9e09b9140b903965']
Matrices are very good for calculus, and for setting the transforms in an universal way. But aren't so good when you are transitioning from one state to the other. a simple animation as from {transform: rotate(0deg);} to {transform: rotate(360deg);} is impossible to set with matrices Also, take into account that even using matrices, you can chain them with others transforms. All that said, let's see an example of your rotation working on a previously transformed element .flip-container, .front { width: 320px; height: 480px; } .front { transition: 0.6s; position: absolute; top: 0; left: 0; z-index: 2; background-color: green; /* transform: rotate(10deg); is equivalent to matrix<PHONE_NUMBER>, 0.173648, -0.173648, <PHONE_NUMBER>, 0, 0) */ transform: matrix<PHONE_NUMBER>, 0.173648, -0.173648, <PHONE_NUMBER>, 0, 0) rotateY(0deg); } .flip-container:hover .front { transform: matrix<PHONE_NUMBER>, 0.173648, -0.173648, <PHONE_NUMBER>, 0, 0) rotateY(180deg); } <div class="flip-container"> <div class="front"> Test </div> </div>
a289460eadac5de87437cfef1074f03917a608c63fb437e4e32d05a526e972c2
['82bb736e4a4946cb9e09b9140b903965']
Any given element can have only one transform at any given time. Any attempt to set at the same time 2 transforms will result in one of them being overriden. You can: 1) set two divs, one inside the other, and apply a different transform to the parent and to the child. 2) build the composite transform. In the case of an animation, that means creating composite transforms for each frame.
2943b6d46a78b2826bf8c1f5d36f8074e0e5f632d85ba69811689b360a7aa40a
['82c28ea21cac41e8bf2e5ddb06e33e54']
I'm trying to make a year long stop motion video with the images taken from a webcam. I've created a input.txt file with this format inside: ffconcat version 1.0 file 'amianthe201909031230.jpg' duration 0.<PHONE_NUMBER> file 'amianthe201909031330.jpg' duration 0.<PHONE_NUMBER> The command I've crafted (mostly taken from the example in the official ffmpeg documentation) is: ffmpeg \ -y \ -hwaccel vaapi \ -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi \ -f concat \ -i input.txt \ -vf 'hwmap=mode=read+write+direct,format=nv12,ass=subtitles.ass,hwmap' \ -c:v h264_vaapi \ ~/amianthe.mp4 But it badly fails with this output: ffmpeg version 4.1.4-1build2 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9 (Ubuntu 9.2.1-4ubuntu1) configuration: --prefix=/usr --extra-version=1build2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Input #0, concat, from 'input.txt': Duration: 00:00:18.70, start: 0.000000, bitrate: 5 kb/s Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi)) Press [q] to stop, [?] for help [Parsed_ass_2 @ 0x5557f4ec4ac0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.6.1 (COMPLEX) [Parsed_ass_2 @ 0x5557f4ec4ac0] Using font provider fontconfig [Parsed_ass_2 @ 0x5557f4ec4ac0] Added subtitle file: 'subtitles.ass' (4 styles, 2 events) [Parsed_hwmap_3 @ 0x5557f5381ec0] Unsupported formats for hwmap: from nv12 (vaapi_vld) to vaapi_vld. [Parsed_hwmap_3 @ 0x5557f5381ec0] Failed to configure output pad on Parsed_hwmap_3 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed! I'm honestly lost: from my understanding, all the elaboration should be done directly in the video card memory, so I don't understand why it's converting the surface format. Is there some other parameter I must put in format? What am I missing?
292efe9248e9fd2f28c7c13ed34d69aa49439fd92868c9e397b10957841c1ca5
['82c28ea21cac41e8bf2e5ddb06e33e54']
I've some problems trying to preload ManyToMany relations. I have People in relation with Segments; People belong to Groups, and when I load a Group I want to preload all his People with theyrs Segments. Here's the (simplified) mappings: Group: Cerebrum\ORM\GroupEntity: type: entity table: groups id: uuid: type: integer column: id generator: { strategy: AUTO } options: { unsigned: true } fields: name: type: string length: 200 unique: true column: group_name manyToMany: people: targetEntity: Cerebrum\ORM\PersonEntity cascade: ["persist"] mappedBy: groups Person: Cerebrum\ORM\PersonEntity: type: entity table: persons id: uuid: type: integer column: id generator: { strategy: AUTO } options: { unsigned: true } fields: username: type: string length: 50 nullable: true unique: true manyToMany: groups: targetEntity: Cerebrum\ORM\GroupEntity cascade: ["persist", "remove"] inversedBy: people joinTable: name: groups_persons joinColumns: person_id: referencedColumnName: id onDelete: CASCADE inverseJoinColumns: group_id: referencedColumnName: id onDelete: CASCADE segments: targetEntity: Cerebrum\ORM\SegmentEntity cascade: ["persist"] inversedBy: people joinTable: name: segments_persons joinColumns: person_id: referencedColumnName: id onDelete: CASCADE inverseJoinColumns: segment_id: referencedColumnName: id onDelete: CASCADE Segment: Cerebrum\ORM\SegmentEntity: type: entity table: segments id: uuid: type: integer column: id generator: { strategy: AUTO } options: { unsigned: true } fields: name: type: string length: 200 unique: true column: segment_name manyToMany: people: targetEntity: Cerebrum\ORM\PersonEntity cascade: ["persist"] mappedBy: segments When I load a group I try this approach: <?php $builder = $entityManager->createQueryBuilder(); $builder->select('p,s') ->from('Cerebrum\ORM\PersonEntity', 'p') ->leftJoin('Cerebrum\ORM\SegmentEntity', 's') ->where('p.uuid IN (:persone)'); $builder->setParameter('persone', $this->entity->getPeople()); $query = $builder->getQuery(); If I try $query->getDQL() I get SELECT p,s FROM Cerebrum\ORM\PersonEntity p LEFT JOIN Cerebrum\ORM\SegmentEntity s WHERE p.uuid IN (:persone), and if I cycle through $query->getResult() I obtain a list of PersonEntity and SegmentEntity. The problem is that PersonEntities don't have theyr relations loaded, as you can see in this dump: Cerebrum\ORM\PersonEntity {#427 -uuid: 1 -username: "argonauta" -segments: Doctrine\ORM\PersistentCollection {#464 -snapshot: [] -owner: Cerebrum\ORM\PersonEntity {#427} -association: array:20 [ …20] -em: Doctrine\ORM\EntityManager {#108 …11} -backRefFieldName: "people" -typeClass: Doctrine\ORM\Mapping\ClassMetadata {#428 …} -isDirty: false #collection: Doctrine\Common\Collections\ArrayCollection {#465 -elements: [] } #initialized: false } } This cause A LOT of queries to database, because each Person load his Segments with a single query. I know I'll need all these informations, so preloading them with a single query is my choice. Do you have any hint for me? I spent all the morning googling :-(
2b49a001851326ce90aed9997b9d2b1b7a90269385b1a21701df720b801c1d7c
['82c60b5a1b9347ebbd66efbafffe390a']
Why isn't this working?!? I'm writing a function that simplifies a square root (i.e sqrt(44) would turn into 2*sqrt(11). I'm returning this as a double[] but I'm getting an error that says "This method must return a result of type double[]" even though I am returning a double[]. Can anyone please let me know how to fix this, I'm completely lost. public static double[] simpDiscr(double d, double coeff) { int max = (int) (Math.floor(Math.sqrt(d))); int[] squares = {}; for (int i = 2; i <= max; i++) { squares = Arrays.copyOf(squares, squares.length + 1); squares[squares.length - 1] = i * i; } for (int square : squares) { if (d / square == Math.floor(d / square)) { d = d / square; coeff = coeff * Math.sqrt(square); return simpDiscr(d, coeff); } else { double[] dAndCoeff = { d, coeff }; return <PERSON>; } } }
db0f1b34615ec29304092ab5d2d56992628aec807fdf8e189e0bc367060dc7f5
['82c60b5a1b9347ebbd66efbafffe390a']
A couple of things. Add a semicolon at the end of line 2. (This isn't necessarily necessary but prevents possible errors.) Remove the equals from i<= arr.length in line 3 to assure that your not excessing an index of the array that doesn't exist. You don't need the else in line 6. You have no code to run in the else statement so it isn't necessary. At line 10, you have an else statement missing it's curling brackets. You need these around the code block you're running for the else statement. Also, you're missing the word return. I've made a correct one here: function check(arr, el) { let sum = 0; for (i = 0; i < arr.length; i++) { if (arr[i]==el) { sum++; } } if (sum == 1) { return true; } else { return false; } }
9d387d88283e443c60aecb097c0c38075d855405c31ca2f3a5c3bd697f557abb
['82d2dbf3c35f4a0c812428a4ad8ccce2']
Didn't work as expected, but solved it with PHP, feedback would be appreciated: .htaccess DirectoryIndex index.php RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?esource\.mx$ [NC,OR] RewriteCond %{HTTP_HOST} ^(www\.)?esource\.com\.mx$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.esc-nube\.com$ [NC] RewriteRule .* http://esc-nube.com/ [R=301,L] RewriteCond %{HTTP_HOST} ^(www\.)?esource\.us$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.esc-cloud\.com$ [NC] RewriteRule .* http://esc-cloud.com/ [R=301,L] RewriteCond %{HTTP_HOST} ^www\.esourcecapital\.com$ [NC] RewriteRule .* http://esourcecapital.com/ [R=301,L] index.php <?php $domain = $_SERVER['HTTP_HOST']; if ($domain == "esourcecapital.com") { $filename = "esc.html"; } if ($domain == "esc-nube.com") { $filename = "es.html"; } if ($domain == "esc-cloud.com") { $filename = "en.html"; } $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); echo $contents; ?> Any tips for speed?
e4599c1004e35d8d25bfbd0cc0ed86a3de03957f2d308e322b63626e170b8955
['82d2dbf3c35f4a0c812428a4ad8ccce2']
Not the perfect solution, (I'm not good with promises) but here's a quick and dirty way: Add , Childs: []} to all nodes. And process them with a nested rampage! function processNode(node) { models.Category.create(node).then(function(created){ node.Childs.forEach(function(child){ models.Category.create(child).then(function(theChild) { created.addChild(theChild); child.Childs.forEach(function(grandChild){ models.Category.create(grandChild).then(function(theGrandChild){ theChild.addChild(theGrandChild); grandChild.Childs.forEach(function(grandGrandChild){ models.Category.create(grandGrandChild).then(function(theGrandGrandChild){ theGrandChild.addChild(theGrandGrandChild); }) }) }) }) }) }) }); } categories.forEach(function(mainCategory){ processNode(mainCategory); }); Ugly, but does the job, still looking for a pretty way of doing this.
f03cec1d0bc15ec8a1719a48588dd76caf7b35592f75d2e61ba85727e561632e
['82dacf4107174f40a58bf3bdee60ba55']
I'm trying to implement the Firebase access from a desktop app using AngularJS2 + Eletron. I've downloaded the example "Electron + AngularJS2" from https://github.com/DenisVuyka/ng2-electron, it works very fine. But after I add the Angularfire2 component, AngularJS starts to fail. Basically I just did the follow steps after download the ng2-electron source: 1. Installed the components: npm install angularfire2 firebase --save 2. Updated my app.module.ts: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { AngularFireModule } from 'angularfire2'; export const firebaseConfig = { apiKey: "xxxxx", authDomain: "xxxxxx", databaseURL: "https://xxxxx", storageBucket: "xxxxx", messagingSenderId: "xxxxx" }; @NgModule({ imports: [ BrowserModule, AngularFireModule.initializeApp(firebaseConfig)], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } The follow error appears after these changes: "Failed to load resource: net<IP_ADDRESS>ERR_FILE_NOT_FOUND", "Error: (SystemJS) XHR error loading" Does anyone know how to solve it? Thanks
587cb515cdb289e6b4db256bc59b9fb40bece532269b50e613470534d59f2fa0
['82dacf4107174f40a58bf3bdee60ba55']
Using @5minutes2start suggestion I could fix my code. So, the changes were made on file systemjs.config.js I've added these 2 lines on map: 'angularfire2': 'npm:angularfire2', 'firebase': 'npm:firebase', and added these to packages: angularfire2: { main: './bundles/angularFire2.umd.js', defaultExtension: 'js' }, firebase: { main: './firebase.js', defaultExtension: 'js' } My full systemjs.config.js: (function (global) { System.config({ paths: { 'npm:': 'node_modules/' }, map: { app: 'app', '@angular/core': 'npm:@angular/core/bundles/core.umd.js', ... 'angularfire2': 'npm:angularfire2', 'firebase': 'npm:firebase', }, packages: { app: { main: './main.js', defaultExtension: 'js' }, rxjs: { defaultExtension: 'js' }, angularfire2: { main: './bundles/angularFire2.umd.js', defaultExtension: 'js' }, firebase: { main: './firebase.js', defaultExtension: 'js' } } }); })(this); After these changes another error appeared: "Cannot read property 'FacebookAuthProvider' of undefined", I could fix it using the solution discussed here: https://github.com/angular/angularfire2/issues/576 Add "firebase = firebase.firebase;" before "var _a = firebase.auth;" on angularfire2.umd.js firebase = firebase.firebase; var _a = firebase.auth;
16ef75c1ca956a587ca3289f9e3f741da7f635443bafcae12f5c03beda57f31b
['82dcd6bd15d54a41a6a0bf07bc873791']
I am testing out ssh-ldap-pubkey, to get the ssh key from an LDAP server. From auth.log, it shows that my user surfer.example is being closed in preauth and not even running the AuthorizedKeysCommand script. Aug 13 12:51:57 ubuntu-bionic sshd[1685]: Invalid user surfer.example from <IP_ADDRESS> port 58997 Aug 13 12:51:57 ubuntu-bionic sshd[1685]: Connection closed by invalid user surfer.example <IP_ADDRESS> port 58997 [preauth] Aug 13 12:52:11 ubuntu-bionic sshd[1687]: Invalid user surfer.example from <IP_ADDRESS> port 59004 Aug 13 12:52:11 ubuntu-bionic sshd[1687]: Connection closed by invalid user surfer.example <IP_ADDRESS> port 59004 [preauth] Aug 13 12:56:40 ubuntu-bionic sshd[1691]: AuthorizedKeysCommand /usr/local/bin/ssh-ldap-pubkey-wrapper vagrant failed, status 1 Aug 13 12:56:40 ubuntu-bionic sshd[1691]: Accepted publickey for vagrant from <IP_ADDRESS> port 59100 ssh2: RSA SHA256:EjagAW+Wdlac37IGrrLJ3/DA/g8qHCZGPGUCyCEGKTc Aug 13 12:56:40 ubuntu-bionic sshd[1691]: pam_unix(sshd:session): session opened for user vagrant by (uid=0) What is in /etc/ssh/sshd_config: AuthorizedKeysCommand /usr/bin/ssh-ldap-pubkey-wrapper AuthorizedKeysCommandUser nobody The command used to attempt the ssh is: $ ssh surfer.example@<IP_ADDRESS> surfer.example@<IP_ADDRESS><PHONE_NUMBER>]: Invalid user surfer.example from 192.168.35.1 port 58997 Aug 13 12:51:57 ubuntu-bionic sshd<PHONE_NUMBER>]: Connection closed by invalid user surfer.example 192.168.35.1 port 58997 [preauth] Aug 13 12:52:11 ubuntu-bionic sshd<PHONE_NUMBER>]: Invalid user surfer.example from 192.168.35.1 port 59004 Aug 13 12:52:11 ubuntu-bionic sshd<PHONE_NUMBER>]: Connection closed by invalid user surfer.example 192.168.35.1 port 59004 [preauth] Aug 13 12:56:40 ubuntu-bionic sshd<PHONE_NUMBER>]: AuthorizedKeysCommand /usr/local/bin/ssh-ldap-pubkey-wrapper vagrant failed, status 1 Aug 13 12:56:40 ubuntu-bionic sshd<PHONE_NUMBER>]: Accepted publickey for vagrant from 10.0.2.2 port 59100 ssh2: RSA SHA256:EjagAW+Wdlac37IGrrLJ3/DA/g8qHCZGPGUCyCEGKTc Aug 13 12:56:40 ubuntu-bionic sshd<PHONE_NUMBER>]: pam_unix(sshd:session): session opened for user vagrant by (uid=0) What is in /etc/ssh/sshd_config: AuthorizedKeysCommand /usr/bin/ssh-ldap-pubkey-wrapper AuthorizedKeysCommandUser nobody The command used to attempt the ssh is: $ ssh surfer.example@<PHONE_NUMBER> surfer.example@<PHONE_NUMBER>: Permission denied (publickey).
c7c850ea8d097cfd25607998ae216f31736aecaca2f75649ce4828e4cceae79d
['82dcd6bd15d54a41a6a0bf07bc873791']
I started KDE and logged in as non-root user (I was previously logining in as root and then `startx`) and then the wireless `just worked`. However I feel I failed at connecting wifi via `cli`. I was able to connect with ethernet at `cli` using `dhcpcd ` yet I failed with wireless and was left somewhat disconcerted.
65acba551bc348ae5106c2e7ed3697e97edd0ff0b674b42d97b4da57fe48ca8c
['82df5b02104e42c997aff90c1b0e0cdb']
Thank you guys... You are great :) Now it works. My final code is so short: ... import XMonad.Prompt import XMonad.Prompt.Input import Data.Char (isSpace) ... calcPrompt <IP_ADDRESS> XPConfig -> String -> X () calcPrompt c ans = inputPrompt c (trim ans) ?+ \input -> liftIO(runProcessWithInput "qalc" [input] "") >>= calcPrompt c where trim = f . f where f = reverse . dropWhile isSpace Just for the others: to use this tiny calc integrated in xmonad, I call it by a key binding like this one: , ((modm, xK_KP_Multiply), calcPrompt defaultXPConfig "qalc" ) Of course you need qalc installed. I think this is rather handy snippet, because it's not just a calc, you can basically call any executable that produces some short output: calculator, dictionary, whatever you like...
f322d2f972aad10d35408b5db4e6177c4f917bc58b4c077e94bc1cd2d5ea0b40
['82df5b02104e42c997aff90c1b0e0cdb']
I want to use jQuery Selectable to select rows from a table. The problem is that jQuery seems to hijack all click events so that I can't use anything clickable (links in my case) inside the table. Html: <table class="sel-table"> <thead> <th>col1</th> <th>col2</th> <th>col3</th> </thead> <tbody> <tr> <td> <a href="http://www.google.com">click me! a1</a> </td> <td>a2</td> <td>a3</td> </tr> <tr> <td>b1</td> <td>b2</td> <td>b3</td> </tr> <tr> <td>c1</td> <td>c2</td> <td>c3</td> </tr> </tbody> </table> CSS: .ui-selectable>.ui-selected { background-color: #a6c9e2; } Javascript: $(".sel-table>tbody").selectable({filter: 'tr'}); JSFiddle: http://jsfiddle.net/qt67rf12/ When you click the link, nothing happens, selectable processes the event instead. However, the middle button (open in new tab) works perfectly. What's preventing the default action on link and how can I fix it?
10d5075ba301d41dbc6d17daf8ce6bdc317dd0048410e75d6e64a13a445a5fa6
['82fb9324fea944e88c3a0118fd284e67']
Imagine the output of the CNN is 1x1920. The classes to be classified are 1 and 2, with very few 2. For example, a label for one image can be: 111111111111111112111111111111111111111111111111111111111111111111111111... For the CNN is easy to say that the output is all 1 and fail on the 2. So when I test the trained network the output vector 1x1920 is all 1. So I would like to put some kind of weight to the classes so that failing on 2 has more importance. For example: Weight for class 1 = 1/(2*number_of_ones); Weight for class 2 = 1/(2*number_of_twos); How can I do this?
abce8bae038a4cf6a3ef14b16759a53a4b6b7e97d41265044bfeb330596f4216
['82fb9324fea944e88c3a0118fd284e67']
I did an approach based on @guness answer. I found that being limited to two LiveDatas was not good. What if we want to use 3? We need to create different classes for every case. So, I created a class that handles an unlimited amount of LiveDatas. /** * CombinedLiveData is a helper class to combine results from multiple LiveData sources. * @param liveDatas Variable number of LiveData arguments. * @param combine Function reference that will be used to combine all LiveData data results. * @param R The type of data returned after combining all LiveData data. * Usage: * CombinedLiveData<SomeType>( * getLiveData1(), * getLiveData2(), * ... , * getLiveDataN() * ) { datas: List<Any?> -> * // Use datas[0], datas[1], ..., datas[N] to return a SomeType value * } */ class CombinedLiveData<R>(vararg liveDatas: LiveData<*>, private val combine: (datas: List<Any?>) -> R) : MediatorLiveData<R>() { private val datas: MutableList<Any?> = MutableList(liveDatas.size) { null } init { for(i in liveDatas.indices){ super.addSource(liveDatas[i]) { datas[i] = it value = combine(datas) } } } }
58327b3915a33dc34596b916e92190e93f365627ec3625320f3d78e5dbc4833b
['8311653aead042d88c7ec47b27e11b70']
Well this is fairly a basic question. Lets say I want to operate a website from my own personal computer. Its a pretty easy task by port forwarding port 80 and starting my Apahe server. Why this is not practical is because, serve so many people with my slow Internet connection! So how does web hosting servers solve this problem? How are they able to serve so many people?
ffbfcefaac4cf0f56700e36d28db9757134d6ea73a9f87194764463074be703e
['8311653aead042d88c7ec47b27e11b70']
Since you are getting actual errors on your hard drive focus on that. The utility SpinWrite from 'grc.com' is superb at recovering data from failing sectors and at remapping around them. Many things can cause this such as if the drive has a loose data cable in the machine or if the electronics in either the drive controller or the drive itself were damaged by a voltage spike such as from lightning storm very nearby or if the drive itself jolted physically causing a read head physical crash on the media inside or if the drive is overheating by far the electronics will malfunction. It sounds like when a specific place or places on the hard drive is accessed it triggers. Making a backup copy of any data you want to keep from that hard drive is urgent.
436fd13fb4d27e6c6d2c9096bea12adce708fea5e1115ddc39ad2fa7e966a102
['83155d2eee5942bbb2a51781c7632d8c']
A peer of mine showed me earlier today this problem, taken from a 7th grade math contest : Let $A=\{1,2,3,\ldots,n\}$; (where $n \geq 5$) prove that $A$ can be divided into two disjoint subsets such that the sum of the elements in the first subset is equal to the product of the elements in the second subset. This has been puzzling me for 15 minutes already, but I'm sure there's a simple, straight-forward way to do it since it's a 7th grade problem, albeit I can't see it. Can anyone shed some wisdom here ?
8a25460890b3b161bbced9cc0858aab5ae7d398de5d013be7d64982af1aec127
['83155d2eee5942bbb2a51781c7632d8c']
Simply put, velocity is defined as the rate of change of displacement with respect to time. Therefore, using this definition, you can easily get the expression of $v(t)$ by simply taking the first derivative of $s(t)$. This further yields : $$s'(t) = v(t) = -32t+40 \implies t_0 = 1.25$$
998f004054864c67a49d7074e440c7756975fbda32fd6fbcacafad47d28a4106
['831e22640ca14e5b98630aedfe1ca8c7']
Splitting bounded contexts is also a big DDD benefit, you resolve each problem in its context, even if you must duplicate data between contexts. Good aggregate roots definition gives a simpler design and leads to potential performance improvement (scalability through grid computing, see <PERSON> post). When your design becomes really Domain Driven, your applications is more supple to new business needs, because implementation becomes really an implementation detail.
4dde7195c4e1233c535b258609b92583e3a82c7054b25c9b5444164f601f216e
['831e22640ca14e5b98630aedfe1ca8c7']
Text files are sequential, so when deleting a line, you'll have to move all the following lines up. You can use file mapping (a win32 api that you can call through PInvoke) to make this operation a bit less painfull, but you surelly should considere using a non sequential structure for you file so that you can mark a line as deleted without realy removing it from the file... Especially if it should happen frenquently. If I've remember File Mapping Api should be added to .Net 4.
e4da89ebede9d9513b67bbcdbc1a45bb0d05d132e21e145896fa1e528f536cbb
['83253cff8475457f9cc7d79c64fc006c']
In ES 5 SKYRIM, the weapon weight does effect your jogging speed, I don’t know about swords vs. axes and maces( I don’t use the last two), but usually the material does.like daedric and Falmer weapons make you jog slower than let’s say a glass or a steel sword. It even says it in one of the loading screens with the dwemer in dwarven armor, sword, and shield.” Carrying heavier weapons or armor will make you move slower.”
00e5408a45da31ea78c27d9b59c23b3ea46baf4970f1a7b1ead660ad299c0b23
['83253cff8475457f9cc7d79c64fc006c']
i am somewhat confused on how to proceed with the hypothesis testing, i have 1 sample with a total of 31 inputs divided into 2 groups of different conditions, 1 sample has 16 inputs, the other has 15. when i tried using simple t-test for each groups, my mentor told me that using t-test on a sample with less than 30 data would cause a statistical bias, what approach should i use to deal with this dilemma? from what i learnt, nonparametric methods are the most suiteable for small size samples, but how do i know which nonparametric method is the best? the null hypothesis mean would be = or ≠ 0
1a9afedf4024a62308c47842129f1d598ccf5c79f6bde3cc2dcde4c45d0e61d9
['83265522880f4b1dbc0bcde2197f70c2']
I have a CRM date-time field on Form. I have disabled the field on load. I enable this field on click of a custom button. However, when I enable the field, the values in the time picker are disabled i.e. i cannot choose the value in the picklist. however i can manually enter values in textbox. this is happening only for the time picker. the Date picker works just fine. When i load the form in editable mode, the same script runs fine and lets me select values in the time picker Help would be appreciated since i am trying to solve this since 2 days. thanx!
6503abcae96104a7d433ad6530569843df193336f9bc25fcd4c94f52ce508613
['83265522880f4b1dbc0bcde2197f70c2']
I am working with CRM 2011. I created a new organization ORG with a Service Account SRVACC. I created 2 other users with system admin role. I also created One Business Unit. So now in my System I have one Parent Business & one Child Business unit, 2 System admin users and One SRVACC with system admin role. For testing purpose, i changed the BU of the SRVACC from parent BU to child BU. The problem is that now I cannot change it back to the parent BU for the SRVACC record. Can someone please help. Error: Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #9D70E497Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> <ErrorCode>-<PHONE_NUMBER></ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #9D70E497</Message> <Timestamp>2014-10-06T07:23:41.398256Z</Timestamp> <InnerFault> <ErrorCode>-<PHONE_NUMBER></ErrorCode> <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>Principal user (Id=f55c3ae0-5748-e411-bb3d-005056a77686, type=8) is missing prvReadAsyncOperation privilege (Id=e84acc8f-0c61-43e3-a716-20964a483bdf)</Message> <Timestamp>2014-10-06T07:23:41.398256Z</Timestamp> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </InnerFault> <TraceText i:nil="true" /> </OrganizationServiceFault>
75d11350d214801a1a4b5ae4dd2e819b0f09591834eb3368018c57a4f9d6d08c
['83390a3cf7b64b8fb229765f128723da']
I use function webkitgetasentry to upload files(include folder) (drag and drop use) below is my code function drop(e){ e.stopPropagation(); e.preventDefault(); //call start modal (waiting file uploading...) var items = e.dataTransfer.items; for(var i=0; i<items.length; i++){ var item = items[i].webkitGetAsEntry(); if (item){ callmyfunction(item); } } //start modal close } callmyfunction do file upload . but this code run async. so start modal close before callmyfunction all complete how can i start modal close when callmyfunction all complete?
5c8e87f5731298974da764779f05d755d8b5f0d5cbc443509ea5759cf8f039c0
['83390a3cf7b64b8fb229765f128723da']
i want to show dialog like this: test 0 test 1 test 2 test 3 ........ test success i try..... but it do not working! it show only success.... is there way to output during execution by realtime? this is example code test.py # -*- coding: utf-8 -*- import sys import test2 from PyQt4 import QtGui class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): self.btn = QtGui.QPushButton('Dialog', self) self.btn.move(20, 20) self.btn.clicked.connect(self.showDialog) self.le = QtGui.QLineEdit(self) self.le.move(130, 22) self.setGeometry(300, 300, 290, 150) self.setWindowTitle('test') self.show() def showDialog(self): self.le.setText(test2.main("10",self.le)) def main(): app = QtGui.QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) if __name__ == '__main__': main() test2.py import time def main(num,text_edit_box): for i in range(int(num)): text_edit_box.setText(str(i)) print i time.sleep(1) return "success"
5dd519ec35d7836791ee3d0fec6069b48d9e4b52fa1c45cfe5b7bd20e1a345df
['83484d3a260c4e58b14587a8105c1971']
First of all according to the man page of signal() you should not use signal() but sigaction() The behavior of signal() varies across UNIX versions, and has also varied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. But one might hope that signal() behaves sanely. However, there might be a data race because main might be interrupted before a store e.g. in a situation like this if ( i > 10 ) { i += j; } void f(int signum) { i = 0; } If main is past the compare (or if the according registers do not get update if main was interrupted while compare), main would still to i += j which is a data race. So where does this leave us? - Don't ever modify globals that get modified elsewhere in signal handlers if you cannot guarantee that the signal handler cannot interrupt this operation (e.g. disable signal handler for certain operations).
e84cf4e781921d5555d04ff421ec374d45d7e854b058bc21ebc89cc24b1c36b8
['83484d3a260c4e58b14587a8105c1971']
To answer your addendum (the original question was nicely answered by @unwind). I think it mostly depends on the context. If you are working with text i.e. string literals you have to use const char* or char* because the compiler will convert the characters accordingly. Short of writing your own string implementation you are probably stuck with whatever the compiler provides to you. However, the moment you have to interact with someone/something outside of your CPU context e.g. network, serial, etc. you have to have control over the exact size (which I suppose is where your question stems from). In this case I would suggest writing functions to convert strings or any data-type for that matter to uint8_t buffers for serialized sending (or receiving). const char* my_string = "foo bar!"; uint8_t buffer* = string2sendbuffer(my_string); my_send(buffer, destination); The string2buffer function would know everything there is to know about putting characters in a buffer. For example it might know that you have to encode each char into two buffer elements using big-endian byte ordering. This function is most certainly platform dependent but encapsulates all this platform dependence so you would gain a lot of flexibility. The same goes for every other complex data-type. For everything else (where the compiler does not have that strong an opinion) I would advise on using the (u)intX_t types provided by stdint.h (which should be portable).
4858d33537a218a2e359bd4e9f29700568404e8819618f1df4d6292b851b22e0
['834c03252afd47dba53bb826ae8b737c']
This layout I don't even know how to name it. "Fluid" or "liquid" columns seems to refer to simple dynamic heights. I made this one with and got two questions: is it possible to do it with raw HTML5/CSS3? Is it possible to make it work for 3, 4, ..., n columns?!
5ee059d983c3284c872f21f8b498fcfb505b67d754678f889fcaf9d78c462f4c
['834c03252afd47dba53bb826ae8b737c']
What you need is call accepts_nested_attributes_for from your Lesson class: # app/models/lesson.rb class Lesson < ActiveRecord<IP_ADDRESS>Base attr_accessible :title, :desc, :content, :tag_names belongs_to :user has_many :tag_relationships, :autosave => true has_many :tags, :through => :tag_relationships, :autosave => true accepts_nested_attributes_for :tags end And then, in your controller/view: # app/controllers/lessons_controller.rb class LessonsController < ActiveSupport<IP_ADDRESS>Controller def edit @lesson = Lesson.find(params[:id]) end end <%= form_for(@lesson) do |f| %> <div class="lesson_content"> <%= f.label :content %> <%= f.text_area :content %> </div> <div class="tags"> <%- @lesson.tags.each do |tag| -%> <%= fields_for(tag) do |t| %> <%= t.label :name, "Tag" %> <%= t.text_field :name, data: { autocomplete_source: tags_path} %> <%- end -%> <%- end -%> </div> <%- end -%> However, this would show a text field for every tag. If you want to use a single text field for all the tags (separated by commas, for example), and also retrieve lessons filtering by tags, you should check this gem: acts-as-taggable-on.
fa5a2970f03eb050f73ee98a370f75e184b1cb93047b162cc2cdb117fc73e27d
['834d2407b91e42768134fca5d402a85e']
Thanks so much <PERSON>, I just realised I could leave the A off, and chuck that integral over the same integral from 0 to a as a fraction and get the same answer as inserting A myself and normalising. I've emailed my lecturer again to see where the misunderstanding is! Cheers, much appreciated.
4d727a11bf34175e793589d42e15c28faaf26864958b0a9877679ea7fa9d7b16
['834d2407b91e42768134fca5d402a85e']
@ACuriousMind Until just now, I thought $\Delta x$ was equal to the full width of the well, which I've learned below is not the case. It makes sense now too as it's an uncertainty in x. So I had thought if it's equal to the full width of the well, how could it be equal to the standard deviation when the SD is not the full width of the well.
f3f3300402a6a59cd5f63cb386c1e589ef147759894b545db89df0c6343d6f13
['834de600e8234ee28c083bba7423396f']
Because the increased voltage is better at overcoming what little electrical resistance the surface of the body (and any attempt at insulation) provides, and will drive a higher current through the squishy stuff that you presumably value. And there's a risk of a flashover arc, and if that happens your remains will be sufficiently charred that they won't be getting an open-casket funeral.
ac8f4306da0143e324637321d3c6dc329b87413db32a4c439ba16b80bf0aaae0
['834de600e8234ee28c083bba7423396f']
Also the cloth is increasing the contact area. So if you pick up something small- like a soldering iron bit- with a cloth, you won't burn (say) 0.5 sq" but you'll get 1 sq" hot. Historically, steam engine drivers carried an oily rag for the sole purpose of allowing them to handle levers and valves safely.
58d62bee166bb78fa4641ca52651e1f471e07247733baf63306b0601f8b47832
['835f74f141e446f8befe9e1335a9c3fb']
Catalano Framework is the best lib in image processing for java. It works in Android too with the same code. Example: FastBitmap fb = new FastBitmap("c:\\yourImage.bmp"); fb.toGrayscale(); Threshold t = new Threshold(120); t.applyInPlace(fb); // Your objects. BlobDetection bd = new BlobDetection(); ArrayList<Blob> blobs = bd.ProcessImage(fb);
082897d89695588df0d5729f5e3164c3c6e512b5bd4833ba850e1aba0792f170
['835f74f141e446f8befe9e1335a9c3fb']
I answered in Code Project too. I do this in desktop version, you can adapt in android. I'll do a sample in both enviroment in next version (1.3). FastBitmap image = new FastBitmap("c:\\files\\blob.png"); image.toGrayscale(); Threshold t = new Threshold(); t.applyInPlace(image); BlobDetection bd = new BlobDetection(); ArrayList<Blob> blobs = bd.ProcessImage(image); image.toRGB(); Graphics g = image.getGraphics(); g.setColor(Color.red); for (Blob blob : blobs) { ArrayList<IntPoint> lst = PointsCloud.GetBoundingRectangle(blob.getPoints()); int height = Math.abs(lst.get(0).x - lst.get(1).x); int width = Math.abs(lst.get(0).y - lst.get(1).y); g.drawRect(lst.get(0).y, lst.get(0).x, width, height); } JOptionPane.showMessageDialog(null, image.toIcon());
2fa1adf4247e5927b6448d2e55cf5a0371259efe0bbeef850a8aaabced9f8e1a
['8372d755141f4a2e82e899c9deda3c25']
Unfortunately, I am not sure what I was missing. The above methods don't work for me to get the xib cell's height or let the layoutifneeded(), UITableView.automaticDimension to do the height calculation. I've been searching and trying for 3 to 4 nights but without an answer. Some answers here or on another post do give me hints for the workaround though. It's a stupid method but it works. Just add all your cells into an Array. And then set the outlet of each of your height constraint in the xib storyboard. Finally, add them up in the heightForRowAt method. It's just straight forward if you are not familiar with the those APIs. Swift 4.2 CustomCell.Swift @IBOutlet weak var textViewOneHeight: NSLayoutConstraint! @IBOutlet weak var textViewTwoHeight: NSLayoutConstraint! @IBOutlet weak var textViewThreeHeight: NSLayoutConstraint! @IBOutlet weak var textViewFourHeight: NSLayoutConstraint! @IBOutlet weak var textViewFiveHeight: NSLayoutConstraint! MyTableViewVC.Swift . . var myCustomCells:[CustomCell] = [] . . override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = Bundle.main.loadNibNamed("CustomCell", owner: self, options: nil)?.first as! CustomCell . . myCustomCells.append(cell) return cell } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { let totalHeight = myCustomCells[indexPath.row].textViewOneHeight.constant + myCustomCells[indexPath.row].textViewTwoHeight.constant + myCustomCells[indexPath.row].textViewThreeHeight.constant + myCustomCells[indexPath.row].textViewFourHeight.constant + myCustomCells[indexPath.row].textViewFiveHeight.constant return totalHeight + 40 //some magic number }
28c9969c5fc1af6a69a627e0fb441e7b40fcc8c4ee85a352d778cef6af926a12
['8372d755141f4a2e82e899c9deda3c25']
A simple work around would be deleting the file after using it. Of course you should backup your files somewhere else. And usually I will rename the file first. Set fso = CreateObject("Scripting.FileSystemObject") Set fsoFolder = fso.getfolder(filePath) fsoFile.Name = "d:\folder\blablabla.xls" ' do your things FileSystem.Kill "d:\folder\blablabla.xls" 'delete file
d00406b47523b4d2e004007b934a4f93e94f2f5ff8591ff664716670e4eb8820
['837e4161ef9c4fd3882433553b085907']
I have a jquery grid component on my webpage. I want to change css file, that it uses. I set it in jj:head tag: <sj:head jqueryui="true" jquerytheme="custom-theme" customBasepath="css"/> And I see this html tag on my webpage: <link type="text/css" href="css/custom-theme/jquery-ui.css" rel="stylesheet" id="jquery_theme_link"> Styles files path for jquery-grid component is <link rel="stylesheet" type="text/css" href="/appname/struts/themes/ui.jqgrid.css"> I want this path to be like this: <link rel="stylesheet" type="text/css" href="css/custom-theme/ui.jqgrid.css"> Where can I set struts jquery grid css file location?
8310cf0f7ee7fb9fb7e0c343db57e51b747ab12f4c56c903bce724e505c87565
['837e4161ef9c4fd3882433553b085907']
I develop an application, which allows user to choose wallpaper from gallery and set it as a device wallpaper. I want to make a preview for each picture in gallery as it is a real wallpaper. The preview is a screenshot of a homescreen with all widgets and icons and selected picture as a device wallpaper. I think about two variants: 1) Change current wallpaper to a picture, which user looks. Then make a screenshot of a homescreen with this wallpaper and all widgets and icons. Then show this screenshot to user and put real wallpaper back. 2) Get all widgets and icons position, draw it on a picture, which user looks. I don't know how to implement any of this variants. If you have any idea, pleace help me.
89e1bc2f66eb7bb7b9ce4d2c1f6233ba3d5e60924ac60a1879c1a3187c0c13d8
['837eec265bdc4bfc877721db9b747c60']
In Visual Studio 2012 (11.0.51106.01 Update 1) the .appxmanifest for my Windows Store App has the image slot for the 140% size Badge Logo listed as 34x34 (pixels). When I run Windows App Certification Kit 2.2 against the app it fails with: "The image 'Assets\BadgeLogo.scale-140.png' failed the size restrictions of 33 X 33." I resized the image to 33x33 but then Visual Studio fails with: "App manifest references badge logo image 'Assets\BadgeLogo.scale-140.png' which has not valid dimensions. It must be 34x34 pixels." Anybody else have this problem? If so can you provide any guidance on resolving it?
9ced1b7e624b8eee90d56f3ee92f0723b5b6f8cbd22c5f65fa715e854e89b16c
['837eec265bdc4bfc877721db9b747c60']
This question should also be tagged windows-runtime. I'm not sure how the "WEBCREDENTIALS=MyPasswordName" descriptor works but the "WEBCREDENTIALS=MyPasswordName,myweb.com" descriptor can (must?) refer to an entry made by your app in PasswordVault. Entries in PasswordVault can be viewed in the "Control Panel -> Credential Manager -> Web Credentials" pane. Here is a method to encrypt and decrypt some data: // using System.Diagnostics; // using Windows.Storage.Streams; // using System.IO; // using System.Runtime.InteropServices.WindowsRuntime; // (convert streams from Windows. to System. and vice-versa) // using Windows.Security.Credentials; // using Windows.Security.Cryptography; // using Windows.Security.Cryptography.DataProtection; public async void EnDeCryptDataUsingWebcredentials() { #region Set up environment // Specify variables for mock PasswordCredential string credentialResource = "MyResourceIdentifier"; string credentialUserName = "Foo"; string credentialPassword = "<PERSON>"; // Get a vault instance. PasswordVault passwordVault = new PasswordVault(); // Inject new credential PasswordCredential testCredential = new PasswordCredential(credentialResource, credentialUserName, credentialPassword); passwordVault.Add(testCredential); #endregion Set up environment string dataToEncrypt = "The quick brown fox jumped over the lazy dog."; Debug.WriteLine(String.Format("UnencryptedData: {0}", dataToEncrypt)); // Assemble descriptor from PasswordCredential. PasswordCredential credential = passwordVault.Retrieve(credentialResource, credentialUserName); string dataProtectionDescriptor = String.Format("WEBCREDENTIALS={0},{1}", credential.UserName, credential.Resource); Debug.WriteLine("Encryption Descriptor: {0}", dataProtectionDescriptor); // Encrypt data. DataProtectionProvider encryptionProvider = new DataProtectionProvider(dataProtectionDescriptor); IBuffer unencryptedDataBuffer = CryptographicBuffer.ConvertStringToBinary(dataToEncrypt, BinaryStringEncoding.Utf8); IBuffer inputDataBuffer = await encryptionProvider.ProtectAsync(unencryptedDataBuffer); // View encrypted data as string. string encryptedData = String.Empty; using (StreamReader reader = new StreamReader(inputDataBuffer.AsStream())) { encryptedData = reader.ReadToEnd(); } Debug.WriteLine(String.Format("EncryptedData: {0}", encryptedData)); // Decrypt data (never supply a descriptor for decryption). DataProtectionProvider decryptionProvider = new DataProtectionProvider(); IBuffer outputDataBuffer = await decryptionProvider.UnprotectAsync(inputDataBuffer); // View decrypted data as string. string decryptedData = String.Empty; using (StreamReader reader = new StreamReader(outputDataBuffer.AsStream())) { decryptedData = reader.ReadToEnd(); } Debug.WriteLine(String.Format("\nDecryptedData: {0}", decryptedData)); }
d807a3c031d63de7260fbda45e9cc864cda91fec6d3ca728d9a3259bf9878529
['83806215f1054ded92125b8d140e3886']
How can I add items to listbox when item source is a list. XAML: <ListBox Grid.Row="2" HorizontalAlignment="Stretch" ItemsSource="{Binding Source={StaticResource viewModel}, Path=CultureEvents}"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Source={StaticResource viewModel}, Path=ItemTitle}" Height="30" HorizontalAlignment="Left" Margin="116,364,0,0" VerticalAlignment="Top" Width="334" Foreground="White" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> In viewmodel I have list: public List<CultureEvent> CultureEvents { get; set; } And property: public string ItemTitle { get { return ?; } set { ? = value; OnPropertyChanged(new PropertyChangedEventArgs("ItemTitle")); } } But I don't know what to put into property.
8f53d8b9228d844e6f67baab241c68517ac74a24e5fd4fae9b3ec9ce939f8b90
['83806215f1054ded92125b8d140e3886']
I have a listbox with data binding. <ListBox x:Name="EventsListBox" Margin="0,85,0,0" VerticalAlignment="Top" Height="682" Width="480" HorizontalAlignment="Center" BorderThickness="0" Background="#FFE8E8E8" BorderBrush="#FF535353" SelectionChanged="EventsListBox_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <Grid Margin="5,5,5,0" Height="200" Width="470" VerticalAlignment="Center"> <Image Source="{Binding Default_Image, Converter={StaticResource ImageConverter}}" Margin="0" Stretch="Fill" Width="480"/> <Image Source="gradient.png" Margin="0" Width="480"/> <TextBlock x:Name="NameCont" Text="{Binding Title}" TextWrapping="Wrap" Margin="10,0,0,10" FontSize="25" Foreground="White" VerticalAlignment="Bottom"/> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> I created new page like PageTemplate and I want to load data to that page based on user selected item. How can I make navigation? I'm using JSON.NET which load data to MainPage and generate ListBox items. I want to make: when user click on item navigate to PageTemplate and load data to that page but how to make it with listbox?
39f9be0ed25c99b1d194e812f5e16719939a45184825b573c115d17e3d8ced39
['83a738c8d79f48e1857c063b5a9470e2']
I don't know of any native versioning with PDF files (nor does my Google search). PDF files (according to wikipedia) are binary. Delta storage only works with text files (like source code files and readme files). I have a background in using SVN and Git. I recommend using Git, as it has superior compression capabilities and is a distributed version control system. Subversion is a centralized version control system, which means you need a server in order to run it. You could install the SVN server software on your computer, but it's probably not worth the overhead. Distributed version control systems work via local repositories (ie: no server required).
d4152f29058dde4e8671ed2d323a02df91996f3bb991badfab17ac16acee7fd1
['83a738c8d79f48e1857c063b5a9470e2']
Follow up - it seems like CFAttributedStringSetAttributes (plural) is the way to go. I still need to implement it into my program, but in a small test, this function allows me to overwrite previously defined values without getting an EXC_BAD_ACCESS crash. Would have been nice if this was documented somewhere. Hope this helps other people out there. Thanks!
fd883b678ce8a394f517eb6a343cf70eb6081b7b170522bf813798c9711be041
['83af32ab9d9e419fac4070d0f40fafc5']
I encountered a strange issue that I cannot find any documentation explaining. I have a controller with the URL mapping /profiles. I started accidentally sending in requests /profile. Normally in my experience, this would result in a 404 as I have no controllers mapped to /profile but instead I started getting null pointers in my /invitations controller and sure enough if I put a breakpoint in the invitation controllers base GetMapping method it was getting hit. The invitation controller is not referenced in any of my config classes nor is mapped with any wild cards that would allow /profile to go it. What's more any improper URLs even at lower levels such as /(any-controller}/{id}/something-wrong will go to it. Is there some kind of default controller setting in spring I am missing?
5bec60619f47965e3c2311bbfbcb0b72767f743a41f4591adfdb91ff5709751b
['83af32ab9d9e419fac4070d0f40fafc5']
So Thanks to <PERSON>'s comment as it led me to the answer. After playing around the @Order tag is the mechanism by which you control the order in which they load. The second part however is that yes the Order does matter. If you read the documentation of AbstractHttpSessionApplicationInitializer it states that it must me ordered before any other initializers that register filters. It also defaults its Order to 100. The reason it has to go first is it uses filters to retrieve the session from the cache database. If for example you order your AbstractSecurityWebApplicationInitializer to 50 you will no longer authenticate when switching servers because the spring security filters will execute before the filters that get the session from the database. On the other side of this I removed a bug I was getting Spring-Tomcat Web Application java.lang.IllegalStateException, was solved by making my main initializer AnnotationWebAppInitializer go before the others.
ffd43a22f3a65357e221449d0c536f007f382144c091a6d43ed06bfd457b3f59
['83bdccd1391d4c21b8e173d2ee48a447']
i was careless about this, I should have written like this import os import random from PIL import Image from PIL import ImageDraw from PIL import ImageFont def watermark_text(input_image_path, output_image_path, text, pos): photo = Image.open(input_image_path) # make the image editable drawing = ImageDraw.Draw(photo) black = (255, 255, 255) font = ImageFont.truetype("font.ttf", 40) drawing.text(pos, text, fill=black, font=font) photo.show() photo.save(output_image_path) if __name__ == '__main__': path="./bg/" files=os.listdir(path) d=random.choice(files) img = path + d watermark_text(img, '1.jpg', text='Risna Fadillah', pos=(0, 0)) sorry.
b33964ef133cf8d6c0835bb1079823823d5837d321b7564324c489ec3e208214
['83bdccd1391d4c21b8e173d2ee48a447']
I've error when i pick a random image in a folder and i want to edit with PIL. My code is import os import random from PIL import Image from PIL import ImageDraw from PIL import ImageFont def watermark_text(input_image_path, output_image_path, text, pos): photo = Image.open(input_image_path) # make the image editable drawing = ImageDraw.Draw(photo) black = (255, 255, 255) font = ImageFont.truetype("font.ttf", 40) drawing.text(pos, text, fill=black, font=font) photo.show() photo.save(output_image_path) if __name__ == '__main__': path="./bg" files=os.listdir(path) d=random.choice(files) img = d watermark_text(img, '1.jpg', text='Risna Fadillah', pos=(0, 0)) and error showing like this Traceback (most recent call last): File "quotes.py", line 26, in watermark_text(img, '1.jpg', File "quotes.py", line 10, in watermark_text photo = Image.open(input_image_path) File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/PIL/Image.py", line 2878, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: '1qqq.jpg' How to fix it?
2f9ffd23a7e061a54b3920cd44c2542643b508887a04bf66b32c1759bdb8fdf4
['83be2f16607d48d9b57ca2a0e15e3125']
I can personally vouch for Fastlink fixing this problem on our app that runs on Backbone/Marionette. We implemented it and our JavaScript click events worked as intended again, and there was no need to change from click to any touch method. I know that this is also affecting CSS drop-down menus (which our app doesn't have). Can anybody vouch for the CSS hacks mentioned above resolving the problem?
bc32927c233fd009ec83e8c67130954fbf281632de5d949dc8c0c4857072dc3b
['83be2f16607d48d9b57ca2a0e15e3125']
On my company's Drupal 7 site, I created a field for one of our content types through the admin UI. We decided to hide it from the user until some styling changes make it through to production. Is there a was to programmatically unhide the field via an update hook? I know get at least some of the field information through the field_info_field function, but I'm not sure how if it contains the setting needed to make the field visible to the user. Any help on this would be appreciated. I know I can unhide it through the UI once the changes hit production, but it would be nice to have an automated way of doing this.
3ca6226640f134897f0b4e24c4af72affad611d48ff7a482acafec0e1eacb02a
['83c31332652e4c92b73d989f731602a1']
Just re-arrange your code like this: def create(request): if request.method == "POST": title = request.GET["title"] des = request.GET["description"] bid = request.GET["startingBid"] imageurl= request.GET[ "imageUrl"] category = request.GET["category"] image = request.GET["image"] listing= Auctionlisting(request,title=title,description=des,startingBid=bid,imageUrl=imageurl,category=category) listing.save() # save before getting them from database return render(request, "auctions/index.html",{ "listing":Auctionlisting.objects.all() }) else: return render(request, "auctions/create.html")
d53f5ba901480be95bf36c389a24f8cbb63625cbd73e50ea0bc79d2f439f0bd9
['83c31332652e4c92b73d989f731602a1']
Maybe you forget to add your STATICFILES_DIRS (and put all your static files like css/js etc in this folder) in settings.py file. You can also check how to manage static files here in Django docs. In your settings.py add these lines. STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), 'static'] And in your .html file don't forget to add this in the first line. {% load static %} And to link your static files use {% static 'filename.css' %} <img src="{% static "my_app/example.jpg" %}" alt="My image">
36045932b78077503593e9527d353c1e470f74a06a57da3cf79cc28952a9dea0
['83cab4a3fe2243928deb5d6228a79c03']
When you say that groups are calculated properly, I suppose that you mean your dimension is 0 - 10, 10 - 20... But the value of each group is wrong. Try something like this : =Replace(Class(Age, 10), '<= x <', ' - ') Or better : =if(isnull(Age),<Null>,subfield(class(Age, 10),' ',1) & ' - ' & (num(subfield(class(Age, 10),' ',5))-1)) This one handle Null and make better groups. Class fonction return "0 <= x < 10" which should be translate 0-9 instead of 0 - 10. Subfield(X, ' ', Y) split X by space and return the Y part.
09225370ae605b96ce0c269948577f7326caadb6a9ac17ed45d3d8b3c8545a74
['83cab4a3fe2243928deb5d6228a79c03']
It will be complex to handle it with a single set analysis using your Quarter field. One way to do it : Data: LOAD * INLINE [ Region, Value, Quarter A, 1, Q1 18 B, 2, Q1 18 C, 3, Q1 18 D, 4, Q1 18 A, 1, Q1 17 B, 2, Q1 17 C, 3, Q1 17 D, 4, Q1 17 A, 1, Q2 17 B, 2, Q2 17 C, 3, Q2 17 D, 4, Q2 17 A, 1, Q3 17 B, 2, Q3 17 C, 3, Q3 17 D, 4, Q3 17 A, 1, Q4 17 B, 2, Q4 17 C, 3, Q4 17 D, 4, Q4 17 A, 1, Q4 16 B, 2, Q4 16 C, 3, Q4 16 D, 4, Q4 16 ]; Tmp: LOAD Distinct Quarter, Right(Quarter, 2) as Year, Left(Quarter, 2) as Q Resident Data ; Calendar: LOAD *, RowNo() as SeqNumber Resident Tmp ORDER BY Year DESC, Q DESC; DROP Table Tmp; Then using the following expression : Sum({<SeqNumber={"<=4"}>} Value)
b957c62342cdc15b572a478469cd27aaf681b57b47b967da2c496fa3f23aa71d
['83d5f8f8012f48eea40bdcafd96a199f']
Thanks for your feedback! I've made the following changes (and edited the code in the main question): 1. Added a header file. I don't know if I should make 3 header files (master Arduino constants, slave Arduino constants and common protocol) or one header like I made. 2. Changed constants and moved most to loop() function. 3. Changed indentation to four. Could you check if I did it correctly? Thanks again :)
d2adf92ec655a1447bc1325bcbd0a8ed280920ab571bf340c3bf1226fce6b9d3
['83d5f8f8012f48eea40bdcafd96a199f']
If memtest is showing errors after replacing RAM you have 5 possibilities: Memtest is not compatible with your motherboard (unlikely as your motherboard uses a common chipset and is not brand new) It's not your RAM that is faulty, it's the L1 or L2 cache (try running Memtest with cache off). One or more RAM sockets are faulty. There's something else broken in the memory pipeline. You are incredibly unlucky and the replacement RAM is bad also. If it's not 1 or 4 you are probably stuck replacing your motherboard and/or CPU. You might try running Memtest with less RAM if possible, or if there are 4 RAM sockets, putting the RAM in the unused sockets instead.
684bec064c929531214f202d95bcbcf81fc430cbd8d506070450fc09ae0c7b2e
['83d6211c53d7485aa60b427cd50b47a4']
I am only assumming to answer this question. SELECT u.email FROM users u INNER JOIN cart_dates cd ON cd.order_id = o.id GROUP BY u.email HAVING COUNT(DISTINCT Case when o.pre_order = TRUE then o.id else null end) > (COUNT(DISTINCT o.id)/2) I tried to making it more simpler.
890b92c80a6018677eb8cfd6760ebbccfeb11b8c8b8204a626ec22ea014a0534
['83d6211c53d7485aa60b427cd50b47a4']
Your Error are clear.. You cannot put Null value to Foreign Key or Serial.. Maybe you are wrong in the concept design your schema.. CREATE TABLE tablename ( colname SERIAL ); is equivalent to specifying: CREATE SEQUENCE tablename_colname_seq; CREATE TABLE tablename ( colname integer NOT NULL DEFAULT nextval('tablename_colname_seq') ); ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname; As noted by Documentation Serial data type hold Not Null so it can't be Null and Other answer really great tell about constraint foreign key.. As Documentation FK said We say this maintains the referential integrity between two related tables So.. The value in FK are referencing to Parents value which it is the PK.. PK cannot have Null so FK too..
1f14e91440d46778654469e880a07667d275a09bc4b6a6d18f521a69ef8b32e0
['83da0c15af524a33a2a53b40d8bfa93a']
You can create an HTTP Endpoint, configure the HTTP Method, provide the URI, save it. In your code, you to use a Call/Send mediator, and have to specify the endpoint you have created above inside the Call/Send mediator. If you already have a WSO2 EI code, please update your question, so that I can provide the exact answer. HTTP Endpoint
c25306cbb023a8edffc24d4f083ec4b8a3d9dfc437c1ab1c447bc174e3333a6e
['83da0c15af524a33a2a53b40d8bfa93a']
Is there a way to dynamically change the log levels in the API manager in a containerized environment, where the user cannot log in and change the values in log4j2.properties? I am aware that log4j2.properties gets hot deployed when we make changes, but how to do the same in a docker/K8s scenario.
61d2990c488ddb252b285cb649307db8d774f7bd6c7c244991cb5bd1ff9611df
['83db4c81bd3149ea9b5eaf220a2eea26']
If someone is interested, the solution I found is the next one: function execute(){ try { exeWindow.innerHTML = eval(editor.getValue()); errorWindow.innerHTML = ""; } catch(err){ var annot = editor.getSession().getAnnotations(); for (var key in annot){ if (annot.hasOwnProperty(key)){ errorWindow.innerHTML = annot[key].text + " Line " + " " + (parseInt(annot[key].row)+1); exeWindow.innerHTML = ""; } } } if (TogetherJS.running) { TogetherJS.send({type: "execute"}); } }; Simple as that :)
583a97ab2056be90bf814f41ca85307c6ec3e5871afb1546ad39c68b30b6d17d
['83db4c81bd3149ea9b5eaf220a2eea26']
I dont know why, but with this code: $(document).ready(function(){ $("#errorTitle").change(getErrors()); function getErrors(){ console.log($(".nombre").val()+"/"+$(".email").val()); if($("#nombre").val() === "" || $("#nombre").val() === "undefined"){ $("#nombre").addClass("error"); }else{ $("#nombre").removeClass("error"); } if($("#email").val() !== "" && $("#email").val() !== "undefined"){ $("#email").removeClass("error") }else{ $("#email").addClass("error"); } } }); The function executes before I change anything, and if I try with the click() event it happens exactly the same. I´m just trying to change the background color with the most simple way of validation to change the error at my wish. <form action="index.php" method="post" id="contact"> <div class="form-group"> <label for="exampleInputEmail1">Nombre*</label> <input type="text" class="form-control" id="nombre" name="NAME" placeholder="Nombre y Apellidos"> </div> <div class="form-group"> <label for="email">Email*</label> <input type="email" class="form-control" id="email" name="EMAIL" placeholder="@"> </div> <div class="checkbox"> <label> <input type="checkbox" name="aviso_legal"> <p>He leído y acepto la <a class="fancybox fancybox.iframe" href="../politica_es.html">política de privacidad</a></p> </label> </div> <p id="errorTitle"><?=$error?></p> <button type="submit" class="enviar">ENVIAR</button> </form>
7f0035c2ebc25e81cf293a600beabf395b68b1d9a5cbfa1f91275728e2750d06
['83dda8834054465db55315fabf4e2c15']
Here is an outline of a proof that if $G$ is a $p$-group, then $|G| \equiv c(G) \mod{(p-1)(p^{2}-1)}$: As noted before, this is already proven if $p=2$, so assume $p$ is odd. $(x,y)$ is a non-commuting pair iff $(y,x)$ is, and iff $(x^{k},y)$, where $k$ denotes a nonmultiple of $p$, is. These imply that $|G|-c(G)$ is a multiple of $2(p-1)^{2}$. Character-theoretically, $|G|$ is a sum of $c(G)$ powers of $p^{2}$. Reduce modulo $p^{2}-1$ and use complex conjugate pairing to conclude that $|G|-c(G)$ is a multiple of $2(p^{2}-1)$. These imply that $|G|-c(G)$ is a multiple of $(p-1)(p^{2}-1)$.
d3124856ba7d1c4b355e9e4f8f881c231ab8e368d0f218e015f1b4bb6d3a04d2
['83dda8834054465db55315fabf4e2c15']
A superficially different counting argument, which boils down to the same proof as before: If $H$ is a proper subgroup whose conjugates completely cover $G$, then let $G$ act on the right cosets of $H$ by right multiplication. This action is transitive. Since $H$ is a point stabilizer, the conjugates of $H$ are just all the point stabilizers. Then saying that the conjugates of $H$ cover $G$ is saying that every element of this permutation group has a fixed point. In a transitive permutation group, the average number of fixed points is $1$. The number of fixed points of the identity is the number of points, $[G:H]$. The only way every permutation can have at least the average number of fixed points is for every permutation to have exactly the average number of fixed points, so $[G:H]=1$ contradicting the assumption that $H$ is proper.
ca48e6d3135fc6f2e6ac49065bfd365a3e9577277604659a8579db5dc68e6258
['83ed140c3a0045cfab5e73282d315918']
Good Morning, I am struggling with a variable in Selenium IDE 3 and was hoping someone may be able to point me in the right direction. Basically, I've created a variable and stored the value's of a dropdown. This seems to have worked correctly for when I use the echo command, I can see the value of the variable. echo: Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming I wrote the echo command as the following: echo ${IssueState} Where I am stuck: I would like to compare the contents of this variable to a list of states (Depending on the product chosen, the list of states available in the dropdown can change. I've tried to verify text ${IssueState}=='my list of states' I've also tried assert with no luck. Any ideas how I can accomplish what I am looking to do? Thank you in advance.
4be44eecbaac75cafa883b697c3049c153a1973c22e7fe5bb971b9d05f523ae2
['83ed140c3a0045cfab5e73282d315918']
I am new to Selenium IDE but not to QA. I am trying to verify the values in simple dropdown but for some reason the verify text fails. On the page I am trying to test I have a dropdown with states that are available to select. I am simply trying to verify that all of the states that are expected are in fact displayed. I've recorded my steps and then added a verify text command, set the target and added my text (The text is the values in the drop down). I run that validation and the test fails saying actual value (Let's say X) does not match (let's say X). As far as I can see, the text matches exactly so I am not sure what else to do. Any help would be greatly appreciated.