id
stringlengths
3
6
prompt
stringlengths
100
55.1k
response_j
stringlengths
30
18.4k
187726
I am using Retrofit 2.6.0 with coroutines for my web service call. I am getting the API response properly with all response codes (success & error cases). My Issue is when I disconnect the internet(Wifi/mobile data) in between an API call, from the code that I have written, the error is not getting caught properly. The...
Well, that's what I do, just to reduce try-catch junk copypaste Declare our API call methods like this ``` @GET("do/smth") suspend fun doSomething(): SomeCustomResponse ``` In a separate file ``` suspend fun <T: Any> handleRequest(requestFunc: suspend () -> T): kotlin.Result<T> { return try { Result.su...
187906
**How can I threshold this blurry image to make the digits as clear as possible?** In [a previous post](https://stackoverflow.com/questions/13391073/adaptive-threshold-of-blurry-image), I tried adaptively thresholding a blurry image (left), which resulted in distorted and disconnected digits (right): ![enter image de...
Some hints that you might try out: * Apply the morphological opening in your original thresholded image (the one which is noisy at the right of the first picture). You should get rid of most of the background noise and be able to reconnect the digits. * Use a different preprocessing of your original image instead of m...
187967
I'm trying to get Django and Apache working together using Mod\_wsgi and currently I'm getting the following errors: ``` [Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] mod_wsgi (pid=4803): Target WSGI script '/home/webdev/websites/virtualenvs/polaris/polaris_project.py' cannot be loaded as Python module. [Th...
It looks like you're using a virtualenv - you need to activate that within your WSGI script to set up the paths correctly. ``` activate_this = os.path.join("path/to/my/virtualenv", "bin/activate_this.py") execfile(activate_this, dict(__file__=activate_this)) ```
188563
Hi Im involved with tourist lodges in Namibia. We record water readings ect. every day and input to an Excel file and calculate consumption per Pax , the problem is not every staff member understands Excel. So I wrote a simple Python program to input readings into excel automatically. It works the only problem is I wan...
You're depending on getting the active worksheet instead of accessing it by name. Simply using something like: ``` try: sheet = wb[Day] except KeyError: sheet = wb.create_sheet(Day) ``` is probably all you need.
189097
**Problem description:** I want to create a program that can update one whole row (or cells in this row within given range) in one single line (i.e. one single API request). This is what've seen in the **documentation**, that was related to my problem: ```py # Updates A2 and A3 with values 42 and 43 # Note that updat...
The error indicates that the data you are trying to write has more rows than the rows in the range. Each list inside your list represent single row of data in the spreadsheet. In your example: ``` [['068222bb-c251-47ad-8c2a-e7ad7bad2f60'], ['urlLink'], ['100'], ['250'], ['20'], [''], [' ,'], ['0']] ``` It represent...
189117
First of all. Please bear with my questions. What I am doing is just performing an ajax request which will return a response data of string. Here's my php ``` <?php header('Access-Control-Allow-Origin: *'); echo 'Peenoise Crazy'; ?> ``` Http request ``` let headers = new Headers({ 'Content-Type': 'appl...
Inject Spring Boot properties ----------------------------- You can inject the values in your code this way: ``` @Value("${server.port}") private int port; @Value("${server.contextPath}") private String contextPath; ``` Hateoas ------- Alternatively, you could take a look at the Hateoas project, which can generat...
189140
I'm working on a WinRT application that for now consists of two pages. While in the first page the user clicks a button that directs him/her to the second page where he makes a choice that needs to be passed back to the calling page. How can I pass data back to the calling page?
This expression selects *all* nodes, but does not include in the result set any nodes that are `RejectedRecords` or that have `RejectedRecords` as an ancestor: ``` //*[not(descendant::RejectedRecords) and not(ancestor-or-self::RejectedRecords)] ``` Here is a link to the result in [XPath Tester](http://www.xpathteste...
189523
When working with Terraform, what features of Azure services are there that cannot be scripted in Terraform or require embedding ARM?
This works (see <https://swish.swi-prolog.org/p/gMgNaCKQ.pl> for a working example): ``` suffix(L,S) :- append(_,S,L). ``` This also works (see <https://swish.swi-prolog.org/p/XqCXArvz.pl> for a working example): ``` suffix( L , L ) . % every list is a suffix of itself, with the empty list [] as ...
189617
Working with breeze backed by SharePoint, as described [here](https://stackoverflow.com/q/15497258/1014822), and using TypeScript rather than JS. In a DataService class I create an EntityManager and execute a Query: ``` private servicePath: string = '/api/PATH/'; private manager: breeze.EntityManager; constructor() ...
If Breeze can't find a matching type in its metadata to what it receives as a result of a query, it simply returns the "raw" json object. The reason that your metadata is not available is usually due to one of two explanations: 1) You are not serializing the type information in the query response. The [BreezeControl...
189749
I run this command from the CLI and it works fine... ``` curl -H Content-Type:text/plain -vLk https://10.42.0.197/exec/show%20ver --user chartley:<pw omitted> ``` Now when I put it into a bash script I get the following... ``` * About to connect() to 10.42.0.197 port 443 (#0) * Trying 10.42.0.197... connected * C...
The answer was to add "eval" to the curl command. ``` #!/usr/bin/bash set -x echo "Gimme yo password foo!!" IFS=$'\n' read -r -s -p 'Password:' pass pass=$(echo $pass | sed 's/[(\!|\@|\#|\$|\%|\^|\&|\*|\(|\))&]/\\&/g' | sed "s/'//g") if [[ "$2" =~ [:space:] ]]; then CMD=`echo $2 | sed 's/ /\%20/g'` #...
190087
I've discovered that my Phonegap/Cordova app on iOS is saving all the pictures I take with the camera and uploading them to a server. In iPhone settings under the "use" tap there is my app and the disk size it needs is increasing, even after quitting the app. So how could I delete these temporary files, or the pictur...
You should be able to take the picture URI and pass it to [window.resolveLocalFileSystemURI](http://docs.phonegap.com/en/1.8.1/cordova_file_file.md.html#LocalFileSystem_resolve_local_file_system_uri_quick_example) and then in the success callback of this method you will get a [FileEntry](http://docs.phonegap.com/en/1.8...
190186
I have programmed a Neural Network in Java and am now working on the back-propagation algorithm. I've read that batch updates of the weights will cause a more stable gradient search instead of a online weight update. As a test I've created a time series function of 100 points, such that `x = [0..99]` and `y = f(x)`. ...
<http://francky.me/faqai.php#otherFAQs> : **Subject: What learning rate should be used for backprop?** In standard backprop, too low a learning rate makes the network learn very slowly. Too high a learning rate makes the weights and objective function diverge, so there is no learning at all. If the objective funct...
190189
I have a MainActivity where I replace the fragments in a FrameLayout using getSupportFragmentManager().beginTransaction.replace() and the PositionsFragment as given below. When I open PositionFragment initially, data is perfectly displayed, but when I switch to dashboard and then again switch to PositionsFragment, th...
You can clear the list in Adapter constructor as: ``` public PositionsRecyclerAdapter(Context context,ArrayList<Products> productList,Context context) { //local product list in adapter if(mProductList!=null){ mProductList.clear(); mProductList.addAll(productList); } } ``` Or can create the method in y...
190828
How can I make this code faster? the string can contain characters such as ", .?#" and possibly others. ``` Const Nums = ['0'..'9']; function CleanNumber(s: String): Int64; Var z: Cardinal; begin for z := length(s) downto 1 do if not (s[z] in Nums) then Delete(s,z,1); if s = '' then Result := 0 else Re...
Here are two examples that for sure are faster than the one you have (deleting a character from a string is relatively slow): This one works by pre-allocating a string of the maximum possible length and then filling it out with the digits as I come across them in the source string. No delete for every unsupported char...
190908
I am using the following code to display an image preview. In the below code the image preview and choose button are separate but I want both them to be the same like in the below image: [![enter image description here](https://i.stack.imgur.com/dTeXr.png)](https://i.stack.imgur.com/dTeXr.png) As shown in the image ...
1. Hide the input 2. Attach `.onclick()` to image placeholder 3. Trigger input click manually HIH ```js $(function() { $("#uploadFile").on("change", function() { var files = !!this.files ? this.files : []; if (!files.length || !window.FileReader) return; // no file selected, or no FileRead...
191224
I am using a selector to build a custom @Html.EditorFor (called @Html.FullFieldEditor). It determines the type of input to generate (textbox, drop down, radio buttons, check boxes, etc.). I have been trying to hook it into one for a radio button list, thusly: ``` @Html.FullFieldEditor(m => m.MyModel.MyRadioButton, new...
**UPDATE3** First good call on the underscore bit, I totally forgot about that. Your bit of code looks almost right, but should actually be this: ``` @Html.FullFieldEditor(m => m.MyModel.MyRadioButton, new Dictionary<string, object> { { "data_bind", "checked:myRadioButton" } }) ``` So since you are dynamically sele...
191280
I have been tasked with writing a winforms c# application that allows the users to run ad-hoc queries. I have searched online and found a lot of tools that can be purchased ([EasyQuery](http://devtools.korzh.com/query-builder-net/)) but at this time buying it is out of the question. So I am trying to write this mysel...
I can appreciate your urge to write this from scratch, after all it's challenging and fun! But don't make the mistake of wasting valuable resources writing something that has already been written many times over. Creating a functional and secure query tool is much more complex then it may seem on the surface. [SQL Ser...
191357
Two different ways to define a Kähler metric on a complex manifold are: 1) The fundamental form $\omega = g(J\cdot,\cdot)$ is closed, ie, $d\omega=0$; 2) The complex structure $J$ is parallel with respect to the Levi-Civita connection of $g$, ie $\nabla J=0$. Using the formula $$d\omega(X,Y,Z) = X\omega(Y,Z) - Y...
A complete proof is given in Voisin's book: Hodge Theory and Complex Algebraic Geometry: [Theorem 3.13](http://books.google.com/books?id=dAHEXVcmDWYC&q=Theorem+3.13#v=snippet&q=Theorem%203.13&f=false).
191791
I am having trouble using the RestSharp client in a Windows service. When the API is down the connection is lost. But once the API runs again, the rest client keeps throwing the same error. Even if I set up a new instance of the RestClient. Anyone with the same problem and a working solution or proposal?
Since your `li`elements are floated, you have to add `overflow: auto;` to the `ul` so that it will wrap the floated `li` s (otherwise it will have 0px height and therefore not be visible). Also, you have to apply the background color to the `ul`: ```css nav li { list-style-type: none; display: inline-block; p...
191890
After setting up WinQual and WER for the first time, I intentionally inserted a crash in a release build expecting\hoping to get the WER dialogue but instead still get the dialogue containing "runtime error! The application has requested the runtime to terminate in an unusual way...". Everything seems to be working co...
It's good to know I may not be (completely) crazy. You're right that external issues were causing problems for the WER dialogue. I changed the crash to the code above, just in case my version was too brutal, and ran the application on three machines and it appears that the presence of Visual Studio and/or just-in-time...
191984
I have this code. I enter the project key from the Google console as the snederId and get an error: service not available. which steps would you recommend for me to double check in setting up the registration key? ``` private void registerInBackground() { new AsyncTask<Void, Void, String>() { @Ove...
Your port name is wrong. Windows CE requires port names to be suffixed with a colon. The exception message probably told you that the requested port name was not found. Change the code to this: ``` mySerialPort.PortName = "COM2:" ```
192567
I am reading values from something in Python. The values come in a strange format. The documentation says: > > > ``` > Color is represented by a single value from 0 to 8355711. The RGB(r,g,b) function calculates > ((R*127 x 2^16) + (G*127 x 2^8) + B*127), where R, G and B are values between 0.00 and 1.00 > > ``` > ...
The [PnP Configuration Manager API](http://msdn.microsoft.com/en-us/library/windows/hardware/ff549717(v=vs.85).aspx) is your friend here: * [CM\_Locate\_DevNode](http://msdn.microsoft.com/en-us/library/windows/hardware/ff538742%28v=vs.85%29.aspx) opens a device handle given a device ID; * [CM\_Get\_Parent](http://msdn...
192719
![THIS IS WHAT IT LOOKS LIKE](https://i.stack.imgur.com/0VwLT.png) I would like there to be space in between the navigation bar and the image but it isnt seeming to work. Any help would be much appreciated! Here is my code: ``` addSubview(profileImageView) profileImageView.anchor(top: topAnchor, left: self.leftAnc...
Seems like you have missed to add your service in providers array on module. ```js @NgModule({ imports: [], providers: [FormsLibService], declarations: [FormsLibComponent, FormsLibService], exports: [FormsLibComponent, FormsLibService], }) ```
192768
So the Radiance skill says that your abilities are boosted, but which abilities are boosted? ![Radiance skill](https://i.stack.imgur.com/xQzCd.png) Is it just melee? Does it include grenades? What use is this skill on it's own without any upgrades?
Radiance greatly speeds up cooldown times for your melee ability (energy drain, scorch) and grenade. You also drop at least one light orb for every enemy you kill while Radiance is active. I believe cooldown times are the only thing boosted by the base Radiance ability. I've never noticed any damage boost per grenade ...
195047
How can one optimize this query: ``` declare @MyParam nvarchar(100) = 25846987; select top 100 * from MySelectTable where (MyParam = @MyParam) OR (@MyParam = 0 and MyParam in (SELECT MyParam FROM aMassiveSlowTable WHERE Id = 'random1')) OR (@MyParam = 1 and MyParam in (SELECT MyParam FROM aMassiveSlowTable WHERE Id =...
You're right that you should be adding the onClicks to your SVGs after the DOM is rendered, and that that work should be done in a directive. The hard part (and this is a recurring issue) is that there's no event that tells you when you should start adding those onClicks. Angular has no way of telling you, since it do...
195959
I'm implementing react app with redux-toolkit, and I get such errors when fetching data from firestore. > > A non-serializable value was detected in an action, in the path: `payload.0.timestamps.registeredAt` > > > A non-serializable value was detected in an action, in the path: `payload.0.profile.location`. > > ...
Check it out at [Getting an error "A non-serializable value was detected in the state" when using redux toolkit - but NOT with normal redux](https://stackoverflow.com/questions/61704805/getting-an-error-a-non-serializable-value-was-detected-in-the-state-when-using) accordingly with Rahad Rahman answer I did the follo...
195992
I'm stuck with an error using mongoose and mongodb that won't let me locate things in my database beause of cast errors. I have a user schema ``` const schema = new mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, name: { type: String, min: 1, required: true } }); export default mongoose.model('user',s...
Try the following: ``` User.findById('5a952adf327915e625aa0fed') .then(user => console.log(user)) // user can be undefined .catch(e => console.error(e)) ``` or ``` User.findOne({name: 'testing'}) .then(user => console.log(user)) // user can be undefined .catch(e => console.error(e)) ```
196187
I have a situation whereby an Oracle Standby (managed by data guard) is really out of date. The redo logs are now being properly sync'd however there is a big gap. I have the current SCNs for primary and standby but cannot find out how to get RMAN 9.2 to create an incremental backup from the specific SCN. Does anyone...
### Correct results? First off: correctness. You want to produce an array of unique elements? Your current query does not do that. The function `uniq()` from the [**intarray** module](https://www.postgresql.org/docs/current/intarray.html) only promises to: > > remove adjacent duplicates > > > Like [instructed in...
196954
A friend and I want to book a house for Labor Day weekend and we found a place on Craigslist that looks pretty nice. I'm pretty well-traveled myself, but neither of us have rented out a house before. Before you all suggest sites like Airbnb or HomeAway, I've been to them and others. Craigslist is just another outlet, o...
It sounds fishy to me too. Not as fishy as Western Union or MoneyGram, because I could just *guarantee* those are scams. For a transaction done on a site that doesn't offer assurances of their own (so this wouldn't apply to AirBnB) I don't think I would do anything other than a credit card, which I could reverse-charge...
197201
I was hoping that someone might be able to shed some light on a problem I'm having. I have a lab that I created that is a multi-region Hub and Spoke network. There are 5 Regional Hubs along with one central hub. Each Region has 4 spokes. My problem comes when I try to use Phase 3 for DMVPN. I think I know what is happ...
So we got CenterHubx1->RegionHubx5->Spokesx4->Computer Computer pings -> Hub , does nhrp lookup on Spoke, set's up new tunnel to CenterHub. Problem Spoke vpn in subnet 172.16.1/24 and Hub 172.16.0/24 The Spoke should not try to setup the direct connection to the CenterHub, only to other spokes of it's RegionHub To...
197281
I'm a new learner on Python and SQLAlchemy, and I met a curious problem as below. ``` user = Table('users', meta, autoload=True, autoload_with=engine) ``` then I ``` print(user.columns) ``` it works fine, the output are user.ID, user.Name, etc. But then: ``` Session = sessionmaker(bind=engine) session = Session(...
You could use: ``` session.query(user).order_by(user.c.id) ```
197368
I think I've done everything listed as a pre-req for this, but I just can't get the instances to appear in Systems Manager as managed instances. I've picked an AMI which i believe should have the agent in by default. ``` ami-032598fcc7e9d1c7a PS C:\Users\*> aws ec2 describe-images --image-ids ami-032598fcc7e9d1c7a {...
Besides the role for ec2 instances, SSM also needs to be able to assume role to securely run commands on the instances. You only did the first step. All the steps are described in [AWS documentation for SSM](https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-restrict-access-quickstart.html). ...
197445
I m new to Jboss, but I have multiple web applications each using spring-hibernate and other open source libraries and portlets, so basically now each war file includes those jar files. How do I move these jars to a common location so that I don't have to put these in each war file? I guess location is `server/default/...
**Classloading:** You're right, put the `.jar`s to `JBOSS/server/<configuration>/lib`, or `JBOSS/lib`. JBoss AS comes with bundled Hibernate libs which are tested with that AS version. See `jboss-6.0.0-SNAPSHOT\server\default\conf\jboss-service.xml`: ``` <server> <!-- Load all jars from the JBOSS_HOME/server/<con...
197585
I am doing the following equation [![enter image description here](https://i.stack.imgur.com/9N5dR.png)](https://i.stack.imgur.com/9N5dR.png) ``` \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} \begin{equation} \left\{\begin{array}{l} x_{i+1}=\left\{\begin{array}{ll} \left(4 a x_{i}\...
A bit off-topic, however: * Fahrenheit are not standard unit, instead it is correct to use Celsius degrees. * If you for some reason persist to use it, than is sensible to define them as part od `siunitx` package: ``` \documentclass{article} \usepackage{siunitx} % <--- \DeclareSIUnit{\fahrenheit}{^\circ\mkern-1mu...
197727
I'm trying to convert a Fahrenheit temperature into Celsius. doing the following I'm always getting zero: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Celcius_Farenheit_Converter { class Program { static double Celcius(double...
`5/9` performs an integer division—that is, it always discards the fractional part—so it will always return 0. `5.0/9.0` performs floating-point division, and will return the expected 0.55555... Try this instead: ``` static double Celcius(double f) { double c = 5.0/9.0 * (f - 32); return c; } ``` **Furth...
197750
I want to replace the selected values through "RandomChoice" by 1 and all other values in matrix with 0. I want output in binary form matirx. ``` mat = Table[Subscript[m, i, j], {i, 6}, {j, 3}]; mat // MatrixForm n = 18*0.5; k = RandomChoice[{mat[[1, 1]], mat[[1, 2]], mat[[1, 3]], mat[[2, 1]], mat[...
I think, your question is as much about techniques of evaluation control, as it is about code generation. I will show several different methods to achieve the first result you asked for, which would illustrate different approaches and techniques of evaluation control. ### Working with unevaluated parts You can, if yo...
197897
I would like to change the `GridView` item background in `onCreateView()`, after setting the adapter. I tried this way: ``` final int numVisibleChildren = gv_categories.getAdapter().getCount(); for ( int i = 0; i < numVisibleChildren; i++ ) { int positionOfView = i + 1; try { ...
I think that your problem arises from the fact that you are trying to reference the grid's views before your ImageAdapter had created them, if you wish really to set the background color at the time of `onCreateView()` and not at the time of calling `getView()`, I would suggest that you use `getViewTreeObserver().addOn...
198065
The following is done comparing Coldfusion 9.0.1 against Railo 4.0.2.002 I have the following (truncated) as the init for a cfc ``` component { public myComponent function init( required string inSetting1, required string inSetting2 ) { return this; } } ``` If I run the following...
A simpler workaround than what you are currently using: ``` try { // standard function call } catch (expression e) { if ( NOT refind('The parameter \S+ to function \S+ is required but was not passed in',e.message) ) rethrow; } ``` Of course, this relies on the wording of the error message, so is some...
198152
``` int main() { srand((unsigned)time(0)); int random_integer; int lowest=0, highest=10; int range=(highest-lowest)+1; for(int index=0; index<20; index++){ random_integer = (rand() % range) + lowest/(RAND_MAX + 1.0); cout << random_integer << endl; } } ``` I am getting the output from 0 ...
Modulo operation `x % c;` returns the remainder of division of number `x` by `c`. If you do `x % 10` then there are `10` possible return values: `0 1 2 3 4 5 6 7 8 9`. Note that generating random numbers by using `rand()` with `%` produces skewed results and those numbers are not uniformly distributed. Here's the si...
198753
EDIT: No longer getting an undefined URI once I passed $(this).attr('red') to a variable. Still getting the 500 Server error though. EDIT: [Here is all the code on github](https://github.com/WayneHaworth/nodetest2.git) (just in case I have missed something!) EDIT: Here is the how the function is called in global.js ...
You are pulling the `id` from the body, when it's in the url. So replace `var userToEdit = req.body.id;` with: ``` var userToEdit = req.params.id; ``` Or you can use `req.param('id')` which goes through [all the methods](http://expressjs.com/api#req.param) to find the value. Also do `res.json(..)` instead of `res....
198796
I'm using Rails 3.0.10 and I'm currently using CanCan for determining the different abilities that users have within the application. I am using Devise for the user authentication itself. Is there a good way for an admin user to "become" another user temporarily using CanCan? This would be especially useful to become...
I found what I was looking for, and there's a gem for it! [switch\_user](https://github.com/flyerhzm/switch_user) It was really easy to use. I just have to add `gem switch_user` to my Gemfile. Then add `<%= switch_user_select %>` to my layout. Exactly what I wanted!
199011
I am working with a dataset which contains two tables: one that gives the value of a number of variables at the lowest level, and one that shows all child-parent relations which I should use to calculate the totals. My data looks something like this: ``` > # table that shows child-parent relation > ID <- c(5, 10, 20,...
It looks like you need to use recursion here: ``` sum_children <- function(ID, data) { result <- 0; children <- which(data$PARENT_ID == ID) if(length(children) == 0) return(data$VALUE[which(data$ID == ID)]) else for(i in seq_along(children)) result <- result + sum_children(data$ID[children[i]]...
199299
Here's my scenario: I'm a developer that inherited (unbeknownst to me) three servers located within my office. I also inherited the job of being the admin of the servers with a distinct lack of server administration knowledge and google / ServerFault as a reference point. Luckily, I've never actually had to come into c...
It's quite difficult to tell and borderline "too broad" for our format. The most important thing you need to check is if you need to reconfigure your network in any way of if they can keep running with the same addresses. Even if they can keep the same addresses, make sure they are not configured via DHCP and/or verify...
199312
I am writing a program in java that works with Postgresql. Records in database have different languages, such as English, french and Spanish. While using searching I'm getting nullPointerException when a program comes to converting of the record from database (customer name) toLowerCase(). My problem is that I don't kn...
`.equals()` does what you want. You must be trying to call a method (`toLowerCase()`?) on a `null` string.
200076
I want to search all names that start with a particular letter, that means when I type one character in search bar it will show all names that start with that character but unfortunately it also shows the names that contain this character.I want to show only those names that start with a particular character that I typ...
Change the name check to a prefix check. Replace the nameRange variable with a BOOL that only indicates whether the stringName begins with the search string... ``` /// ... BOOL nameMatches = [[stringName lowercaseString] hasPrefix:[search lowercaseString]]; if(idRange.location!=NSNotFound || nameMatches){ //.. `...
200688
My route config looks like this ``` public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParamete...
Here is an alternative with a stored proc that uses `Loop`: ``` DROP PROCEDURE IF EXISTS proc_loop_test; CREATE PROCEDURE proc_loop_test() BEGIN DECLARE int_val INT DEFAULT 0; test_loop : LOOP IF (int_val = 10) THEN LEAVE test_loop; END IF; INSERT INTO `user_acc`(`playRegion`, `firsttimelogin`) ...
200751
I have one table: ``` A B --------- 1 Date1 1 Date1 1 Date1 1 Date2 2 Date1 3 Date3 4 Date2 4 Date1 1 Date3 SELECT A, count(A) FROM `table` WHERE B BETWEEN 'Date1' AND 'Date2' GROUP BY A ORDER BY A ``` When I do normal query: ``` A B ---------- 1 ...
Seems you need count(distinct B) ``` SELECT A, count(distinct B) FROM `table` WHERE B BETWEEN 'Date1' AND 'Date2' GROUP BY A ORDER BY A; ```
200901
I am trying to align each child DIRECTLY after one another (vertically). Apparently `align-items: flex-start` doesn't do that completely because there is some auto-spacing between each child. Below is a snippet of the result I get. The children align themselves along their parent's available space, which is not what I...
You need to set [`align-content: flex-start`](https://developer.mozilla.org/en/docs/Web/CSS/align-content) on parent element because initial value is `stretch`. > > **stretch** > > > If the combined size of the items along the cross axis is less than the size of the alignment container, any auto-sized items have th...
201368
I am receiving long string of checked html checkbox values (Request.Form["mylist"] return Value1,Value2,Value3....) on the form post in ASP.NET 2.0 page. Now I simply want to loop these but I don't know what is the best practice to loop this array of string. I am trying to do something like this: ``` foreach (string...
You have to split the comma separated string. Try ``` string myList = Request.Form["myList"]; if(string.isNullOrEmpty(myList)) { Response.Write("Nothing selected."); return; } foreach (string Item in myList.split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries)) { Response.Write(item + "<hr>"); } ``...
201981
I'm just starting out with Python web data in Python 3.6.1. I was learning sockets and I had a problem with my code which I couldn't figure out. The website in my code works fine, but when I run this code I get a 400 Bad Request error. I am not really sure what the problem with my code is. Thanks in advance. ``` impor...
> > > ``` > GET http://data.pr4e.org/romeo.txt HTTP/1.0 \n\n > > ``` > > Welcome in the wonderful world of HTTP where most users think that this is an easy protocol since it is a human readable but in fact it can be a very complex protocol. Given your request above there are several problems: * The path should b...
202052
How do you solve mixins with reflux using ES6? Like this: ``` mixins: [Reflux.listenTo(myStore, "onChange")] ^ ``` Results in error "Unexpected token" with arrow shown above. React v 0.14.7 Reflux v 0.4.0
Because the Edit button is disabled with : ``` event.target.disabled = true; ``` You can add in the .cNeD click event : ``` $(".editBtn").prop('disabled', false); ``` [DEMO from codepen.io](http://codepen.io/anon/pen/VajRbj) **Edit :** To enable only one edit button (see u\_mulder comment): ``` $(this).closest...
202110
> > **Possible Duplicate:** > > [Loading from JAR as an InputStream?](https://stackoverflow.com/questions/2614095/loading-from-jar-as-an-inputstream) > > > Is it possible for me to load a jar file from an input stream (from a url connection, for example), load it into a classloader, and execute it? Thanks for ...
Yes; [`URLClassLoader`](http://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html) is intended for this purpose. It can load classes from an array of URLs. ``` URL externalJar = new URL("http://example.com/app.jar"); URL localJar = new URL("C:/Documents/app.jar"); URLClassLoader cl = new URLClassLoader(URL...
202201
I am not sure whether I have a correct model of Java initialization mechanism in my head. Each class follows the following: 1. Initialize superclass, if there exists one 2. Initialize yourself Initialize follows the following: 1. Initialize static and instance variables which have their values set outside of initial...
Two problems: `sin` and `cos` take arguments in *radians*, not degrees; and you probably want to rotate your polygon about its centre, not about (0, 0). To fix the first problem, change: ``` angle = 45; ``` to: ``` angle = 45.0 * 2.0 * M_PI / 360.0; ``` To fix the second problem you need to first calculate the ...
202266
I have been using Latex (with TexStudio) for some time to keep a research notebook and made some observations: * After the overall style of a document has more or less settled, one wants to worry about formatting as little as possible. All the Latex markup for even simple tasks (like including an image) becomes tediou...
You might want to take a look at [Pandoc](http://johnmacfarlane.net/pandoc/), which describes itself as the "swiss-army knife" of document conversion. With Pandoc, you're able to create documents in various languages, most notable ones with Markdown-style syntax and are able to easily create LaTeX documents from them. ...
202397
I have the following script to recursive copy data and create a log file of the destination, could any assist please, I would like to pause for 10 seconds after each file is copied so each file allocated a different created time stamp. ``` $Logfile ='File_detaisl.csv' $SourcePath = Read-Host 'Enter the full path conta...
`Copy-Item` has a `-PassThru` parameter that outputs each item that is currently processed. By piping to `ForEach-Object` you can add a delay after each file. ```sh Copy-Item -Path $SourcePath -Destination $TargetPath -recurse -Force -PassThru | Where-Object PSIsContainer -eq $false | ForEach-Object { Start-S...
202520
Fresh install of Magento 1.9.1. Magento is ignoring the attribute position set in Catalogue->Attributes->Manage Attributes->Manage Labels/Options for a configurable product drop down. Instead it is using the Product ID to determine list order. Have compared the following files/functions and, apart from a small tax ca...
The answer by Meogi works but is not the perfect answer as it will only sort the options on the frontend. Try creating an order from the admin panel for a configurable product. You will still get the incorrectly sorted attribute option list. Instead, you can copy app/code/core/Mage/Catalog/Model/Resource/Product/Type/...
202543
I have written that seems to not be working, but MySQL does not return any error. It is supposed to get data from `database1.table` to update `database2.table.column` ``` <?php $dbh1 = mysql_connect('localhost', 'tendesig_zink', 'password') or die("Unable to connect to MySQL"); $dbh2 = mysql_connect('localhost...
You can't just issue a cross-database update statement from PHP like that! You will need to execute a query to read data from the source db (execute that on the source database connection: `$dbh2` in your example) and then separately write and execute a query to insert/update the target database (execute the insert/up...
202713
I am using Azure AD for user authentication, and using user flows for singup and login, we also have some custom attributes which are set through the user flow itself. I am trying to update those custom attributes for a user using his access token Now reading through the azure ad documentation i came across Azure Ad g...
This is one option using `dplyr` based on the output of your code: ``` df %>% group_by(File) %>% mutate(ID_new = seq(1, n()) + first(ID_raw) - 1) # A tibble: 18 x 5 # Groups: File [3] ID_raw Val File ID_diff ID_new <int> <int> <fct> <int> <dbl> 1 1 1 A 4 1 2 1 1 A...
202822
I have an object list that retrieves multiple values from a database, like so: ``` List<Object> listRequest = daoManager.getLaptopsForRequest(BigInteger.valueOf(itemTransItem.getAssetType().getId()), BigInteger.valueOf(approverId)); ``` The result of which looks like this (printed out on the console, via for each): ...
You have to create a new class, usually called a ViewModel and pass the data in that class: ``` public class MyViewModel { public IEnumerable<Telephone_Search.Models.tbl_users> users; public IEnumerable<OtherType> otherThings; public string SomeOtherProp {get;set;} } ``` In the view: ``` @model MyViewModel f...
202920
I am upgrading to a 400 Amp service in Washington State. My power company is Mason County PUD 1. The AHJ is Washington State L&I. The panel I'm planning on using is the Siemens MC0816B1400RLTM. What size/type wires should I use between the mast head and the line side of the meter? How do I connect these wires to the po...
First off, the utility generally makes the hookups at the service masthead -------------------------------------------------------------------------- The first order of business is a point of clarification. According to what I have been able to find, your utility is conventional in that they make the final connection ...
203145
What I want to achieve is to have a static Container in the left half and a scroll-able list of items on the right half of the screen: ``` |----------------------| | | | | Container | ListView | | | | |----------------------| ``` It is for a desktop app, so I like this layout. M...
``` Row( children: [ Container(height: 400, width: 400, color: Colors.green), Expanded( child:SizedBox( width:100, heigth:100, child:L...
203445
I'm trying to build a React Native app with the following file structure: ``` Kurts-MacBook-Pro-2:lucy-app kurtpeek$ tree -L 1 . ├── README.md ├── __tests__ ├── android ├── app.json ├── assets ├── index.js ├── ios ├── node_modules ├── package.json ├── src └── yarn.lock ``` The `package.json` is ``` { "name": "a...
Try this - * In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project). * Click on the 'Build' option at the left pane. * Uncheck 'Parallelize Build' under Build Options. * Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'. * 'React...
203688
I want `mimetypes` library to return mimetype from file name. For example: ```py >>> mimetypes.types_map['.docx'] 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ``` But, currently I got an exception: ```py >>> mimetypes.types_map['.docx'] Traceback (most recent call last): File "<consol...
You need to pass a "name" before dot. ``` >>> mimetypes.guess_type('.docx') (None, None) >>> mimetypes.guess_type('filename.docx') ('application/vnd.openxmlformats-officedocument.wordprocessingml.document', None) ``` Docs: <https://docs.python.org/3/library/mimetypes.html>
203745
I have line this, I want to replace spaces with-in the quot with underscore. ``` "Hello How are you" Mr. John ``` with ``` "Hello_How_are_you" Mr. John ``` I like to have the perl one-liner for this. Thanks SR
When you use `cPickle.load()` you are trying to unpickle (deserialize) a previously pickled file into a Python object. To pickle (serialize) an object to a file you should use `cPickle.dump()`.
203909
Lately I've been reading a little bit (mostly here and on Wikipedia) about [exotic matter](http://en.wikipedia.org/wiki/Exotic_matter), particularly matter with a [negative mass](http://en.wikipedia.org/wiki/Negative_mass). [This question](https://physics.stackexchange.com/q/44934/) appears to be the original question ...
Mostly it's to throw physics at the wall and see what sticks. You see, there are several important [energy conditions](http://en.wikipedia.org/wiki/Energy_condition) in GR. These energy conditions allow you to derive several important theorems, see [here](http://strangebeautiful.com/papers/curiel-primer-energy-conds.p...
204781
I have an animating set of UIImageView's that represent a current value and continually keeps ticking upwards...ideally never stopping, also in the view is a scrollView or to and whenever I'm scrolling or zooming in the scrollView, the animation stops, and starts up again when the scrollView stops moving completely. I ...
As [danypata](https://stackoverflow.com/users/2315974/danypata/ "danypata") pointed out in my comments via this thread [My custom UI elements are not being updated while UIScrollView is scrolled](https://stackoverflow.com/questions/4109898/my-custom-ui-elements-are-not-being-updated-while-uiscrollview-is-scrolled/41369...
204876
In Python 3.3.1, this works: ``` i = 76 def A(): global i i += 10 print(i) # 76 A() print(i) # 86 ``` This also works: ``` def enclosing_function(): i = 76 def A(): nonlocal i i += 10 print(i) # 76 A() print(i) # 86 enclosing_function() ``` But this doesn't work: `...
The search order for names is LEGB, i.e Local, Enclosing, Global, Builtin. So the global scope is not an enclosing scope. **EDIT** From the [docs](http://docs.python.org/3/reference/simple_stmts.html#nonlocal): > > The nonlocal statement causes the listed identifiers to refer to > previously bound variables in th...
205342
I'm currently working on a MySQL query, but I've been having a bit of trouble with it and am looking for help. I have been struggling with it for a while now and have searched for the solution from the Internet and from different coding forums, but, alas, still nothing. Basically, I have a MySQL table as follows: ```...
What you'll need is `GROUP BY` and `COUNT`. ``` SELECT `value_1`, COUNT(`value_1`) AS `count` FROM `data` WHERE `value_2` != '0' GROUP BY `value_1` ORDER BY `count`; ``` For more information, see: <http://dev.mysql.com/doc/refman/5.1/en/counting-rows.html>.
205812
I want to use AzCopy to copy a blob from account A to account B. But instead of using access key for the source, I only have access to the Shared Access Key. I've tried appending the SAS after the URL, but it throws a 404 error. This is the syntax I tried ``` AzCopy "https://source-blob-object-url?sv=blah-blah-blah-so...
You're correct. Copy operation using SAS on both source and destination blobs is only supported when source and destination blobs are in same storage account. Copying across storage accounts using SAS is still not supported by Windows Azure Storage. This has been covered (though one liner only) in this blog post from s...
206748
Is @react-native-firebase/admob deprecated? or just.. Why it doesn't work? I am using @react-native-firebase/admob (<https://rnfb-docs.netlify.app/admob/usage>). Everything works fine before to use "admob()". When I add admob() to the code appears this error: "TypeError: (0, \_admob.default) is not a function" Do so...
Despite @CodeJoe Answer, I still got confused by different Documentations for the React Native Firebase that where around, hence I spend lots of time and energy to get around it. I open an issue [here](https://github.com/invertase/react-native-firebase/issues/5580) where is confirmed that Google removed the AdMob Pack...
207041
I have JSON like below, how to make it correct with javascript or some php script? I think it should have quotation marks on arrays. like ``` { "1":[ {"id":"171113524", "title":"xxxx", "category":"4", { 1:[ {id:"171113524", title:"xxxx", category:"4", start:"20160913062500", stop:"20160913093000"} , {id:"17...
I was working on a similar requirement, I did try out a number of combinations before resolving the exception. I am not sure why liberty is not providing with client implementation classes.. you could try including jersey-client through maven pom.xml.. ``` <dependency> <groupId>org.glassfish.jersey.core</g...
207102
For reasons that aren't worth going into here, Google have been indexing one of my sites with an unnecessary query string in the URL. I'd like to modify my htaccess file to 301 redirect all those requests to the URL without the unneeded part of the query string, but retain any other parts of the query string which may ...
Try this (i tested it with your examples and it is working fine): ``` RewriteEngine on RewriteCond %{QUERY_STRING} ^(.*)&?query=[^&]+&?(.*)$ [NC] RewriteRule ^/?(.*)$ /$1?%1%2 [R=301,L,NE] ``` Also, you should add a condition to apply this rule only on existing files (that's up to you). If you want it: ``` Rewr...
207518
Is it possible to use IF ELSE inside WHERE clause something like this... ``` WHERE transactionId like @transactionId AND transactionType like @transactionType AND customerId like @customerId IF(@transactionType='1') AND qTable.statusId like 'SIGNED' ELSE AND rTable.statusId like 'ACTIVE' ```
``` WHERE transactionId like @transactionId AND transactionType like @transactionType AND customerId like @customerId AND ((@transactionType='1' AND qTable.statusId like 'SIGNED') OR (@transactionType <> '1' AND like 'ACTIVE') ) ```
207737
I've got this little ServiceStack message: ``` [Route("/server/time", "GET")] public class ServerTime : IReturn<ServerTime> { public DateTimeOffset DateTime { get; set; } public TimeZoneInfo TimeZone { get; set; } } ``` And its respective service handler is as follow: ``` public object Get(ServerTime reques...
There does not seem to be an elegant way to pass `TimeZoneInfo` to the client, so I just created a DTO for it unsurprisingly named `TimeZoneInformation` ``` [Serializable] public class TimeZoneInformation { public string Id { get; set; } public TimeSpan BaseUtcOffset { get; set; } public string DisplayName...
207999
I just set up Datatorrent RTS (Apache Apex) platform and run the pi demo. I want to consume "avro" messages from kafka and then aggregate and store the data into hdfs. Can I get an example code for this or kafka?
Here is code for a complete working application uses the new Kafka input operator and the file output operator from Apex Malhar. It converts the byte arrays to Strings and writes them out to HDFS using rolling files with a bounded size (1K in this example); until the file size reaches the bound, it will have a temporar...
208133
As is known, some blocking calls like `read` and `write` would return -1 and set `errno` to `EINTR`, and we need handle this. My question is: Does this apply for non-blocking calls, e.g, set socket to `O_NONBLOCK`? Since some articles and sources I have read said non-blocking calls don't need bother with this, but I ...
I cannot give you a definitive answer to this question, and the answer may further vary from system to system, but I would expect a non-blocking socket to never fail with `EINTR`. If you take a look at the man pages of various systems for the following socket functions `bind()`, `connect()`, `send()`, and `receive()`, ...
208166
Is there a real way to get Netbeans to load and work faster? It is too slow and gets worse when you have been coding for some time. It eats all my RAM. --- I am on a Windows machine, specifically Windows Server 2008 Datacenter Edition x64, 4Gb of RAM, 3Ghz Core 2 Duo processor, etc. I am using the x64 JDK. I use the...
Very simple solution to the problem when your **NetBeans** or **Eclipse** IDE seems to be using too much memory: 1. **Disable the plugins you are not using.** 2. **close the projects you are not working on.** I was facing similar problem with Netbeans 7.0 on my Linux Mint as well Ubuntu box. Netbeans was using > 700...
208441
As my client software uses lat/lon coordinates when communicating with my (spherical mercator) postgis database i decided to ST\_Transform every geometry to WGS-84. However i noticed that ST\_Distance for WGS-84 returns units as degrees (i need meters). So i decided to use ST\_DistanceSpheroid(geom1, geom2, 'SPHEROID[...
WGS-84 is unprojected data. It uses a geodetic coordinate system, which means points are located on a spherical (ellipsoidal to be exact) modelisation of the earth. As a consequence, euclidian geometry is not valid for this kind of data. PostGIS «geometry» data type and associated functions work with planar coordinate...
208442
I am relatively new to Backbone.js and having difficulty rendering a subView. I have subViews in other parts of the app working properly, but I cant even render simple text in this one. View: ``` Feeduni.Views.UnifeedShow = Backbone.View.extend({ template: JST['unifeeds/show'], tagName: "section", class...
addition to another answer just single quotes to the variable names used in the query ``` DECLARE @IO_dy AS VARCHAR(100) = '>9C604-M' DECLARE @style_dy AS VARCHAR (100) = 'S1415MBS06' DECLARE @query AS VARCHAR(8000) DECLARE @con AS VARCHAR(8000) SET @con = STUFF((SELECT distinct ',' + QUOTENAME(Size_id) ...
208818
Lets say I have a Mongoose model like this: ``` var AdSchema = new mongoose.Schema({ vehicleDescription: String, adDescription: String, ... }); ``` I want to search both fields for the same key word, for example find all WHERE vehicleDescription contains the word TEST, OR adDescription contains the word...
You can search for more than one fields at the same time by specifying the field and value in a `{field 1: value 1}, {field 2: value 2},...,{field n: value n}`format in the `find()`function. Additionally, you can also specify various conditions that the results must satisfy, such as AND, OR etc. In your case, a sample...
208845
``` /** * A JavaScript value representing a signed integer. */ class V8_EXPORT Integer : public Number { public: static Local<Integer> New(Isolate* isolate, int32_t value); static Local<Integer> NewFromUnsigned(Isolate* isolate, uint32_t value); int64_t Value() const; V8_...
There are two types of handles. One of them is a "Local" handle. As shown in the code, local handles have the class `Handle<SomeType>`. <https://developers.google.com/v8/embed> > > Note: The handle stack is not part of the C++ call stack, but the > handle scopes are embedded in the C++ stack. Handle scopes can onl...
209885
I am trying to change one bit of an unsigned char variable to 1. I keep getting a segmentation fault though. Here is the code fragment that fails: ``` unsigned char bitvector[16]; int addbit(unsigned char *bitv,int bit){ int a = bit/CHAR_BIT; //part of char array we want. CHAR_BIT is 8 bitv[a] |= 1 <<bit...
As your question is not clear, I made the assumption you wanted to change the bit n of a word of (16x8bits). Here is a working example : ``` #define CHAR_BIT 8 int addbit(unsigned char *bitv,int bit) { int a = bit/CHAR_BIT; //part of char array we want. CHAR_BIT is 8 bitv[a] |= 1 <<(bit%CHAR_BIT); r...
209996
I am trying to send activation email and reset email in Django. I am using Django registration module but after registration, the page returned back to the registration page and did not send any email to me. Part of **settings.py** : ``` DEBUG = False ALLOWED_HOSTS = ['mysite.com', 'www.mysite.com'] EMAIL_BACKEND ='...
You forget to add ``` EMAIL_HOST = 'smtp.mysite.com' ``` to send email.
210099
Is there any way to use `dispatch_after` within a loop? I have the delay function below: ``` func delay(delay:Double, closure:()->()) { dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)) ), dispatch_get_main_queue(), closure) } ```...
Use a timer-type dispatch source to call the closure repeatedly. Example: ``` import Cocoa import XCPlayground func withTimerInterval(seconds: NSTimeInterval, block: dispatch_block_t) -> dispatch_source_t { let source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()) let in...
210491
[![Here is a picture of the module](https://i.stack.imgur.com/LwuPs.jpg)](https://i.stack.imgur.com/LwuPs.jpg) I am trying to get the right pinout to this module from a Canon MX492. I would like to know which one is goes to red, black, green and white for a usb connector. I don't have the whole printer to test what goe...
So - the pages of the datasheet you're posted don't show any USB interface pins ... but: - [this Marvell Databrief](https://www.marvell.com/wireless/assets/marvell_avastar_88W8782.pdf) says is has a USB 2.0 interface - [this Panasonic module](https://na.industrial.panasonic.com/sites/default/pidsa/files/panason...
210839
I want to have `FormData` ([documentation](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.formdata.html#get)) interface with specified required fields. So I want to use TypeScript to check if my formData has all required fields. ``` export interfa...
As @Fabian Lauer said: > > The approach of multiple .append() calls means the code can only be checked at runtime, not compile time (this means TS can't check it) > > > Now, there are some ways runtime type-check can be achieved with TS. Check out this blog <https://levelup.gitconnected.com/how-we-use-our-typesc...
210911
I've created 2 projects: 1. Normal, basic ASP.NET MVC 4 application 2. Basic ASP.NET WebAPI application What I did is I added my custom message handler, derived from `DelegatingHandler` to both of them. Here it is: ``` public class MyHandler : DelegatingHandler { protected override Task<HttpResponseMessage> Send...
As shown below in the famous `ASP.NET Web API: HTTP Message LIFECYLE` diagram by Microsoft, the ASP.NET Web API has an additional extensibility point known as `Message Handlers` (section `HTTP Message Handlers`). So far ASP.NET MVC (5 currently) doesn't provide such extensibility point. [[Link to the full size PDF ...
211049
I have a file `index.txt` with data like: ``` 2013/10/13-121 f19f26f09691c2429cb33456cf64f867 2013/10/17-131 583d3936c814c1bf4e663fe1688fe4a3 2013/10/20-106 0f7082e2bb7224aad0bd7a6401532f56 2013/10/10-129 33f7592a4ad22f9f6d63d6a17782d023 ...... ``` And a second file in CSV format with data like: ``` 2013/10/13-121,...
I am summarizing the comments to a complete answer. Note that [@MarkPlotnick](https://unix.stackexchange.com/users/49439/mark-plotnick) was the first to point toward the right solution. As you can see in `ls -lL` output, the file pointed by you link is a **socket**, non a regular file or a pipe. ``` ~$ ls -lL /dev/lo...
211129
I am trying to use GameObject.Find within a prefab to reference an object that exists in the scene. The name of the object is exactly the same as the actual object. ``` LoseLives loseLives; GameObject loseLivesing; private void Awake() { loseLivesing = GameObject.Find("MasterManager"); } ...
First at all I need to admit, I'm not familiar with the `arma` framework or the memory layout; the least if the syntax `result += slice(i) * weight` evaluates lazily. Two primary problem and its solution anyway lies in the memory layout and the memory-to-arithmetic computation ratio. To say `a+=b*c` is problematic be...
211166
So this is one of my methods which fetches a user's profile: ``` public static UserProfile getUserProfile(String uid) { if (StringUtils.isBlank(uid)) { return null; } Session session = HibernateUtil.getSession(); UserProfile userProfile = null; try { user...
The issue is that right here: ``` this.div.innerHTML += content; ``` When you assign a value to `.innerHTML`, the entire previous value is overwritten with the new value. Even if the new value contains the same HTML string as the previous value, any DOM event bindings on elements in the original HTML will have been ...
211280
I've got a `mailto:` link in a page here including `subject=` and `body=` parameters but I'm not sure on how to correctly escape the data in the parameters. The page is encoded in `utf-8` so I guess all special chars like German umlauts should be encoded into `utf-8` representations for the URL too? At the moment I'm...
You just need to `rawurlencode()` the link at the end of the email address according the the W3C standards. There is an example on the PHP Manual for urlencode (search for mailto on that page): <http://php.net/manual/en/function.urlencode.php>
212343
I want to use loadash debounce in my text input (React Native App). Why isn't my debounce working correctly?? the input value inside the textInput disappears/re-appears as I hit backspace. ``` handleSearch(text, bool){ // search logic here } <TextI...
You're not using the callback the way it was meant. If you keep it like this, every time your component is rendered that piece of code is being executed, besides if that render was fired because that event. You should move that code to and method/function, and asign that method/function as callback. Something like thi...
212367
A few years back I used UCINET for some social network analysis. Theese days I'd like to use SNA again - but this time I prefer a unified analysis framework - which for me is R. I have looked at the sna and statnet documentation but am a bit overwhelmed. What I'd like to do: First: Load an bipartite/incidence matrix ...
This is a good question, and provides some opportunity for further exploration of SNA in R. I am more familiar with the [igraph package](http://igraph.sourceforge.net/index.html), so I will answer your question using the the functions in that library. The first part of your question has a fairly straightforward soluti...
212655
I have to show progress graphs exactly in following way where percentage would be in center of circular graph ![circular progress indicator](https://i.stack.imgur.com/iouR5.png) How can i do this using javascript/jQuery? Can it be done using Google Chart?
There's a plugin for this at: <http://anthonyterrien.com/knob/> > > [Demo](http://anthonyterrien.com/demo/knob/) > > > ### jQuery Knob > > > * canvas based ; no png or jpg sprites. > * touch, mouse and mousewheel, keyboard events implemented. > * downward compatible ; overloads an input element... > > >
212752
Hi frnds i am new to thread concept. Why threadTask.IsAlive always false; i have tried with threadstate but i got "Unstarted" always. ``` foreach (DataRow TaskRow in dtCurrentTask.Rows) { sTaskId = TaskRow["TaskId"].ToString(); sTaskAssigned = TaskRow["TaskAssigned"].ToStri...
In the loop for threadTask variable, each time you are creating a new instance. So whenever you check for isAlive, it will refer to the newly created instance in the current loop and not the previously created thread, therefore it always return false.
212835
I want to decode **.pcap** file using **jnetpcap** library. I am using eclipse to run project and i have set all the environments. When i call java class separably then i am able to decode pcap file but when i am calling that java class throw JSP, then i am getting below error.. ====================================...
Do it this way: 1. Iterate the whole list, noting down the last node you found worth saving (init with the structure saving the list head). 2. Remove all following nodes. That means two iterations, though none nested. O(#oldlist + #removed) Your current approach cannot work.
212910
I have a via with some jQuery function to get value from HTML element (to access element available and element not yet available). On of these element is a dropdown, when I select a value an another vue is added in the bottom of the page in a div. When I try to access an element added by this view, I received "undefine...
Base on your comment response: You still need the `#` to reference an element by ID like this: ``` function getDVDNameVO() { return $('#MyNewElement').val(); } ```
213068
In my rails application I need to display a large number of outputs, by using will\_paginate. But since the controller code calls a definition which is defined in models I cant use pagination since the condition to fetch the queries is defined in my models. My models file ``` class Tweets<ActiveRecord::Base attr_ac...
Call paginate on the results, not in the `Model` ``` (Tweets.for_coordinates(city_coordinates.first) & Tweets.where("tweet_text LIKE?" , "%#{search_term}%")).paginate(page: params[:page], per_page: 50) ``` You will have to call `require 'will_paginate/array'`
213241
As I'm designing my node.js application, I'm having trouble figuring out why my anchor links are not working/not clickable. The code itself was working fine before I designed the app. Is there a CSS property I need to configure to fix this? This is for the .player ul li links. HTML: ``` <!DOCTYPE html> <html lang="e...
upload the image to a folder and insert the path into database. If logo is the path of the image. then program will work.
213314
I am having some issues on `<tr>` background color, having the same `<tr id="">` Here is my Table. ``` <table class="table"> <tr id="2552"> <td>Roll No 1</td> <td>800</td> </tr> <tr id="2552"> <td>Roll No 1</td> <td>700</td> </tr> <tr id="4444"> <td>Roll No 11</td> <td>800</td> </tr> <tr id="4444"> <td>Roll No 11</td>...
I Developed Dynamic table row id based color set and i hope its solve your problem. [Code Reference](http://jsfiddle.net/a2pq65hL/1/) ``` var table = document.getElementsByTagName("table")[0]; var secondRow = table.rows[1]; var count=0; var trid =[]; var clr =[]; for(var i=0;i<table.rows.length;i++) { trid.push(table....