How can I find max download rate of the connection by using Swift?
Erdinc27
Posts
-
How to find max download rate -
about images in ListViewhey all. I am new in android programming. i tried to fill a listview with the datas that i pull from a Xml. I did almost everything and it works fine for now. But the images(320 X 230) in Listview can be seen in some devices(Samsung Galaxy Note 2 but imitation one) and in some devices cant be seen(Samsung Galaxy Note 3, HTC One M7, Samsung Galaxy S4) Can it be because of resolution problems or any other reason ?
-
UIWebView Scroll delegatei think i found the solution. The commented UIview animation block locked the main thread i think that is why Scroll View couldnt response to the new touches. but with this new animation block it works well.
- (void) scrollViewDidScroll:(UIScrollView *)scrollView
{if (self.lastContentOffset > scrollView.contentOffset.y) { if (self.altView.frame.size.height + self.altView.frame.origin.y > self.screenHeight) {
// [UIView animateWithDuration:0.5f animations:^{
// self.altView.frame = CGRectMake(0, self.altView.frame.origin.y-1, 320, 48);
// self.tarayici.frame = CGRectMake(0, self.tarayici.frame.origin.y, 320, self.tarayici.frame.size.height-1);
// }];\[UIView animateWithDuration:0.5f delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ self.altView.frame = CGRectMake(0, self.altView.frame.origin.y-1, 320, 48); self.tarayici.frame = CGRectMake(0, self.tarayici.frame.origin.y, 320, self.tarayici.frame.size.height-1); } completion:^(BOOL finished) { }\]; } } else if (self.lastContentOffset < scrollView.contentOffset.y) { if (self.altView.frame.origin.y < self.screenHeight) {
// [UIView animateWithDuration:0.5f animations:^{
// self.altView.frame = CGRectMake(0, self.altView.frame.origin.y + 1, 320, 48);
// self.tarayici.frame = CGRectMake(0, self.tarayici.frame.origin.y, 320, self.tarayici.frame.size.height+1);
// }];
[UIView animateWithDuration:0.5f delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
self.altView.frame = CGRectMake(0, self.altView.frame.origin.y + 1, 320, 48);
self.tarayici.frame = CGRectMake(0, self.tarayici.frame.origin.y, 320, self.tarayici.frame.size.height+1);
} completion:^(BOOL finished) {}\]; } } self.lastContentOffset = scrollView.contentOffset.y;
}
-
UIWebView Scroll delegatehey all. i have an UIWebView(tarayici in my situation) in view controller. it works fine when its scroll view delegate is not assigned to view controller. but i need to know when it is scrolled that is why i wrote this code.
self.tarayici.scrollView.delegate = self;
but when i write this down then webview acts so weird. for example after this code when i want to scroll then it scrolls only once if i make 3 or 4 attempts. so how can make it work more efficient with that code ?
-
send to facebookhey guys..i am new in objective c..i am developing my first project and there i want to send a image and some texts there..for that i use sharekit.. i can send the texts but not image..it adds the image as an album..but i want to add image on left next to it title and under the title will be link..we can see it everyday when we check our facebook wall..so how i can do that..any help will be appreciated.
-
my program works very slowthanks for your suggestions guys..i will change something in my codes by your suggesstions
-
my program works very slowhi guys...i get some informations from a site Xml file and convert that file to DataTable and then save it in my form's load..it works well but the problem it works very very slow..when i clicked the button to open my form it takes one min almost to open it..how can i make it faster to work..here is the codes i wrote...
public XmlNodeList XmlListesi()
{
XmlDocument doc = new XmlDocument();
doc.Load("http://cekilis.millipiyango.gov.tr/haftalik\_loto\_bilgileri.xml");
XmlElement root = doc.DocumentElement;
XmlNodeList elemlist = root.GetElementsByTagName("haftalik_loto_bilgileri");
return elemlist;
}public DataTable ConvertXmlNodeListToDataTable(XmlNodeList xnl) { DataTable tablo = new DataTable(); int TempColumn = 0; foreach (XmlNode item in xnl.Item(0).ChildNodes) { TempColumn++; DataColumn dc = new DataColumn(item.Name, System.Type.GetType("System.String")); if (tablo.Columns.Contains(item.Name)) tablo.Columns.Add(dc.ColumnName = dc.ColumnName + TempColumn.ToString()); else tablo.Columns.Add(dc); } int ColumnsCount = tablo.Columns.Count; for (int i = 0; i < xnl.Count; i++) { DataRow dr = tablo.NewRow(); for (int j = 0; j < ColumnsCount; j++) { try { dr\[j\] = xnl.Item(i).ChildNodes\[j\].InnerText; } catch (Exception) { } } tablo.Rows.Add(dr); } return tablo; } public void InsertSayisal(DataTable dt) { cmd = dal.InsertSayisal(); cmd.Parameters.AddWithValue("@cek\_no", System.Data.SqlDbType.Int); cmd.Parameters.AddWithValue("@cek\_tarih", System.Data.SqlDbType.NVarChar); cmd.Parameters.AddWithValue("@num1", System.Data.SqlDbType.NVarChar); cmd.Parameters.AddWithValue("@num2", System.Data.SqlDbType.NVarChar); cmd.Parameters.AddWithValue("@num3", System.Data.SqlDbType.NVarChar); cmd.Parameters.AddWithValue("@num4", System.Data.SqlDbType.NVarChar); cmd.Parameters.AddWithValue("@num5", System.Data.SqlDbType.NVarChar); cm
-
bound datagridview new row problemhi again.. thanks for help and your time..i solved my problem like below.in my button's click event that i create new row
int rowCount = datagridview1.Rows.Count;
DataGridViewButtonCell buttonCell = (DataGridViewButtonCell)datagridview1.Rows[rowCount].Cells[6];
buttonCell.UseColumnTextForButtonValue = false;
buttonCell.Value = "Insert"; -
bound datagridview new row problemi couldnt find both events that u suggested...i have UserAddedRows and RowsAdded..i tried both
private void datagridview1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
datagridview1.CurrentRow.Cells[6].Value = "Insert";
}i cant catch Text Property here..that is why i used Value property but it gives error like "Object reference not set to an instance of an object." so what else i can try ?
-
bound datagridview new row problemhii Mark thanks for reply.. i am searching that u suggested...here the pic what i mean..i mean when i have empty row as in pic the buttons' text must be seen as Add and cancel instead of Update and Delete...and after the user click Add button the row will be added(here no problem) and the button's text must be seen like Update and Delete..like the other buttons..i hope it is more clear now..thanks for help again
-
bound datagridview new row problemhey guys..i have a bound datagridview in my form and i have two DataGridViewButtonColumn(Edit and Delete)...and the user can add new row..the problem is i want the DataGridViewButtonColumn to be seen as Insert and Cancel instead of Edit and Delete...after inserting process completed it must be seen like other datas..thanks for help
-
some questions about Chart controlhey guys..i have a chart control and a datagridview on my form..i want to show the values in a graphic which i have in datagridview..Here is how it looks..i have some questions about it. 1) how i can arrange YAxis increase rate as 1..it increases by 5. 2) how i can move the black lines on backround of my chart area? 3) there are two series(Series 1 and Sayilar) there..i couldnt find any example that i can use Series1..i mean the chart control already has..that is why i created new one(Sayilar)..my question is how i can use Series2 or how i can remove it..here is the codes i created and added it to my chart control 4) how i can add some texts of Chart control Axis to inform the user which columns means what
Series series = new Series("Sayilar");
series.Color = Color.DarkGoldenrod;
series.BackSecondaryColor = Color.OrangeRed;
series.BackGradientStyle = GradientStyle.LeftRight;series.XValueMember = "Sayilar"; series.XValueType = ChartValueType.String; series.YValueMembers = "Kaç Kere"; series.YValueType = ChartValueType.String; series.ChartType = SeriesChartType.Column; chart1.Series.Add(series);
than ks for your helps and answers
-
picturebox or any other toolok friend..thanks for your help and time
-
picturebox or any other toolthanks for the help..should i add them to resources File of my project..to use them when i make its exe ?
-
picturebox or any other toolhey guys..i have to add 19 icons to my form..but i dont know which tool i should use?..19 picturebox i should add to my form or one another tool can i use ?
-
clipboard pastes two timesi have 17 textboxes on my form and i want the user can copy from one box and paste to another...that is why i did so
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.V))
{
foreach (Control item in this.Controls)
{
if (item.GetType().Name == "TextBox")
if (item.Enabled)
item.Text = Clipboard.GetText();
}
}
}it works well..but after i saw your replies i wonder if there is better way or i am in wrong way ?
-
clipboard pastes two timeshey friend thanks for reply..i solved my problem ..i set my form's KeyPreview false and it works now..
-
clipboard pastes two timesits content is te selected text from the textbox..for example if i write 'w' in my textbox and paste it to my another box it appears 'ww'
-
clipboard pastes two timesi want to copy a tex from texbox and paste it another one in my form i copy it with that code
Clipboard.SetText(textBox1.SelectedText);
and paste it with that
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if ((e.Modifiers == Keys.Control)&&(e.KeyCode == Keys.V))
textBox2.Text = Clipboard.GetText();
}but the problem is it pastes selceted text two times but when i try like that
(e.Modifiers == Keys.Control)
it pastes one time what should i do now ?
-
making two different style of datagridview's one cellthanks for your asnwers guys..i will look at the examples and search more deeper.. because iam not that much professional yet to create a Custom DataGridView