This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _MyScreenState extends State<MyScreen> { | |
double _inputHeight = 50; | |
final TextEditingController _textEditingController = TextEditingController(); | |
@override | |
void initState() { | |
super.initState(); | |
_textEditingController.addListener(_checkInputHeight); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:validate/validate.dart'; | |
void main() => runApp(new MaterialApp( | |
title: 'Forms in Flutter', | |
home: new LoginPage(), | |
)); | |
class LoginPage extends StatefulWidget { | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modules | Directives | FAQ | Glossary | Sitemap | |
Apache HTTP Server Version 2.4 | |
<- | |
Apache > HTTP Server > Documentation > Version 2.4 > Rewrite | |
Redirecting and Remapping with mod_rewrite | |
Available Languages: en | fr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To hide the microsite directory in url, you can use the following rules: | |
<rewrite> | |
<rules> | |
<rule name="HideMicroSite" stopProcessing="true"> | |
<match url="^microsite/(.*)" /> | |
<conditions> | |
<add input="{HTTP_HOST}" pattern="^site\.com$" /> | |
</conditions> | |
<action type="Redirect" url="{R:1}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: This example contains Chinese text and a payload of nested JSON. The payload had to be encoded as a string before being passed on to the API. I found that using the flutter http package one has to use a workaround to decode the characters properly (dart-lang/http#243). The alternative is to use the dio package which encodes everything as utf-8 properly. When decoding the get request, one has to remember to also decode the nested json separately. | |
Fix for others having this issue: | |
Flutter has a new network profiler in the Dart tools. Using this I was able to see that an error returned that Field payload does not have a default value. | |
Solution: | |
Add a default NULL value to the payload field and with that inserts are now working. | |
My payload is a json field so I had to jsonEncode(payload) before adding it to the post (in my toJson method) | |
Also found that I could simply wrap the entire jsonEncode(post) with single quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NetworkService { | |
final JsonDecoder _decoder = new JsonDecoder(); | |
final JsonEncoder _encoder = new JsonEncoder(); | |
Map<String, String> headers = {"content-type": "text/json"}; | |
Map<String, String> cookies = {}; | |
void _updateCookie(http.Response response) { | |
String allSetCookie = response.headers['set-cookie']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Encode/Decode functions for Dart | |
* | |
* Copyright 2011 Google Inc. | |
* Neil Fraser (fraser@google.com) | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Csv $fullpath -Delimiter "`t" -Header Year, ParentID | | |
Select-Object -Skip 1 | | |
ForEach-Object { | |
$parent = $_.ParentID | |
$_.Year -replace '.*?"(.*?)".*', '$1' | Out-File "$path\$parent.txt" -Append | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#retains header | |
awk -F, 'NR==1 {h=$0; next} {f=$3".csv"} !($3 in p) {p[$3]; print h > f} {print >> f}' input.csv | |
#option 2 | |
HDR=$(head -1 input.csv); for fn in $(tail -n+2 input.csv | cut -f3 -d, | sort -u); do echo $HDR > $fn.csv; done | |
awk -F, '{print >> ($3".csv")}' input.csv | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open $fh, '<', $ARGV[0]; | |
while ($line = <$fh>) { | |
print $line; | |
if ($. == 1) { | |
$header = $line; | |
} else { | |
# $fields[2] is the 3rd column | |
@fields = split /,/, $line; | |
# save line into hash %c | |
$c{"$fields[2].csv"} .= $line; |