|
Why would you need an image that big, and why can't it be solved with several smaller images representing the same data?
It would still contain the same data, just not have the limitation that it needs to be read as a single entity.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The function of the tool is to load the file handling.meta and display the values of each parameters present in the file (handling.meta) for within each TexBox of the interface of the tool. So when a value (number) is edited in this TexBox will be saved manually by pressing the "Save" or "Save As" button.
With the following features:
* Open, save and save as...
* Interface localization
* Auto/manual application update
among others.
Example of a handling.meta file editing tool similar to the one I want to create:
GTA V Handling Editor - GTA5-Mods.com[^]
Soon, I'll give you more details about it.
|
|
|
|
|
|
KrazyMonkey Modding wrote: Soon, I'll give you more details about it.
No need really. It would appear that you have mistaken us for a free coding service and we are not. You need to go to a website like rentacoder or freelancer where you can hire someone to write your code for you.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
KrazyMonkey Modding wrote: Soon, I'll give you more details about it.
If you're trying to post something akin to an article in the forums, don't bother. It'll be removed in no time at all.
If you want to write an actual article and post that, fine. Just don't treat the forums as your advertising space.
If you wanted to start a discussion with your article, every article has its own forum at the bottom of the article. Post your article and the discussion will be held in that forum, dedicated to your article.
|
|
|
|
|
Are you the "XML flag editor" guy?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
In C#, I have a DataSet populated with about 40 tables.
I need to output the data in this DataSet to an SDF file.
How can I do this?
I’m using SqlCe and have its connection already defined.
Ideas?
Thanks so much :-/
-Mike
|
|
|
|
|
Simmerliner wrote: Ideas? The obvious idea is that you write the SQL statements to create the database and insert the records. What exactly is the problem?
|
|
|
|
|
I'm passing the value of a month over to my View but can't seem to figure out to display it inside my declared dropdown.
<th>Posting Month:</th>
<td>
@Html.DropDownListFor(m => m.PostingMonth, new SelectList(Model.PostingMonth))
@(Html.Kendo().DropDownList()
.Name("ddlPostingMonth")
.BindTo(new List<SelectListItem>()
{
new SelectListItem() { Text = "" },
new SelectListItem() { Text = "January" },
new SelectListItem() { Text = "February" },
new SelectListItem() { Text = "March" },
new SelectListItem() { Text = "April" },
new SelectListItem() { Text = "May" },
new SelectListItem() { Text = "June" },
new SelectListItem() { Text = "July" },
new SelectListItem() { Text = "August" },
new SelectListItem() { Text = "September" },
new SelectListItem() { Text = "October" },
new SelectListItem() { Text = "November" },
new SelectListItem() { Text = "December" },
}))
</td>
This is inside my Controller:
var result = CB.GetAgentDetail(orderNumber).FirstOrDefault();
model.PostingMonth = result.PostingMonth;
ViewBag.PostingMonth = result.PostingMonth;
ViewBag.Overflow = result.Overflow;
model.Tare1 = result.Tare1;
return View(model);
^^^^^^^ The value from the database actually shows when I step through using a breakpoint.
How do I get this value to appear in my dropdown control?
When I try something simple like: @Html.DisplayTextFor(m => m.PostingMonth), it shows the correct value in a textbox.
Please help!!
|
|
|
|
|
how to get data from one web register form at the time of submit button click.
& fill auto when use.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work from.
And without your code to give us a clue ... we can't help you much, if at all.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Message Closed
modified 26-Jan-17 4:35am.
|
|
|
|
|
What have you tried?
What does the debugger show?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
I don't understand exactly what the method "GetData" is doing ... but the method "existingFile" exactly work like you described :
it opens the Workbook, do something in GetData and finally save the changed Workbook (by overwriting the old version of the Workbook before).
So ... where is your Problem ?
|
|
|
|
|
It's really quite simple. If the file exists, then you need first to read the data from the Worksheet into the DataGridView. You can then allow the user to add or modify the data on display before saving it back to the file.
|
|
|
|
|
int lastRow_ = 3;
I fear you forgot to skip existing data before writing new data.
You need to detect existing data and write new data after existing data. you probably also want to not write headers again.
When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. It allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I have a form Form1 on which is a listbox and a button.
Consider the following code, and read the problem I am having with it below:
private async void button1_Click(object sender, EventArgs e)
{
listBox.Items.AddRange(new object[] {"Hello", "There", "Code", "Project."});
await PerformLengthyTask();
}
private async Task<bool> PerformLengthyTask()
{
Thread.Sleep(5000);
return true;
}
What I THOUGHT would happen when I clicked the button:
The new items would appear instantly in the listbox because while the UI thread is waiting for the PerformLengthyTask function, it is free to pump messages and keep the UI responsive.
What ACTUALLY happens when I click the button:
The new items do not appear in the listbox until after PerformLengthyTask returns.
And also, the form itself is frozen.
What is it that I do not understand about async methods that is causing me this confusion?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Well, it looks like you're firing of the thread.sleep on the UI (calling) thread so...that's expected.
A better test case might look like:
private async void button1_Click(object sender, EventArgs e)
{
listBox.Items.AddRange(new object[] {"Hello", "There", "Code", "Project."});
var task = Task.Run(() => PerformLengthyTask()).ContinueWith(s => DoSomethingWithBool(s));
}
private async Task<bool> PerformLengthyTask()
{
Thread.Sleep(5000);
return true;
}
This will push the method onto a different thread, will not block, and will take a callback.
Really async and await are ways to transition from an asynchronus context into a synchronous one. The await keyword ostensibly forces code execution into a synchronous context by marking a place where a Task.Result needs to be available.
Async and await make life much, much easier in terms of interacting with async code, but they are not a silver bullet on their own.
For detailed reading have a look at:
Task-based Asynchronous Pattern (TAP)
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Thank you for your post. I did indeed believe it was a silver bullet for making function calls asynchronous. I thought that the await keyword was all that was required to push a task onto a different thread.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
The async keyword doesn't make a function asynchronous. It gives you access to the await keyword. Await can be used on any call that returns a Task<T> or Task . Await checks whether the Task.IsCompleted is true then if not it captures the current context and sets the remaining code in the function as a continuation after the awaited task completes. Then the function returns control to its caller.
Since PerformLengthyTask is a function call executed in the UI context, when you sleep on the current thread it is sleeping the UI thread. async /await are used to easily allow asynchronous behavior when calling code which waits on something to complete execution. That something could be on a thread pool thread, an external server, another thread, or whatever. Also a method doesn't have to be async to return Task or Task<T> but an async method has to return either one of those or void .
This example will add the items to the listbox, return control back to the UI, and when the delay expires so the result gets set PerformLengthyTask will continue with return true which will set its result so button1_Click can continue with whatever it wants to do with the boolean.
private async void button1_Click(object sender, EventArgs e)
{
Task<bool> lengthyTask = PerformLengthyTask();
listBox.Items.AddRange(new object[] {"Hello", "There", "Code", "Project."});
bool result = await lengthyTask;
}
private async Task<bool> PerformLengthyTask()
{
await Task.Delay(5000);
return true;
}
private async Task<bool> PerformLengthyTask()
{
await DelayAsync(5000);
return true;
}
private Task DelayAsync(int delay)
{
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
ThreadPool.QueueUserWorkItem(_ =>
{
Thread.Sleep(delay);
tcs.SetResult(false);
});
return tcs.Task;
}
TaskCompletionSource<T> has no non-generic so a dummy TResult of bool is used in DelayAsync . Note that if you don't need to synchronize back to the captured context you can use await DelayAsync(5000).ConfigureAwait(false) . This is useful if you don't need to update any UI objects for example.
Your listbox might not be updating because your listbox view isn't refreshed
Bonus Edit: This doesn't use async /await but accomplishes the same thing.
private void button1_Click(object sender, EventArgs e)
{
PerformLengthyTask().ContinueWith(task =>
{
bool result = task.Result;
}, TaskScheduler.FromCurrentSynchronizationContext());
listBox.Items.AddRange(new object[] {"Hello", "There", "Code", "Project."});
}
private Task<bool> PerformLengthyTask()
{
DelayAsync(5000).ContinueWith(_ => true);
}
private Task DelayAsync(int delay)
{
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
ThreadPool.QueueUserWorkItem(_ =>
{
Thread.Sleep(delay);
tcs.SetResult(false);
});
return tcs.Task;
}
modified 25-Jan-17 1:39am.
|
|
|
|
|
Thank you for your detailed explanation. I feel better prepared to tackle this subject further.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
No need for your DelayAsync method - just call Task.Delay[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Well aware The comment above that says "//or not using Task.Delay" and immediately above that is an example using Task.Delay . I was simply showing how you could manually do that operation to provide another viewpoint 
|
|
|
|
|
It's worth pointing out that Task.Delay uses a Timer behind the scenes to trigger the completion. That's more efficient than your DelayAsync method, because it doesn't keep a thread-pool thread hanging around waiting for a Thread.Sleep call to complete.
The Task.Delay source code[^] uses some internal stuff, so if the method didn't exist, you'd want something like this:
private sealed class DelayPromise
{
private readonly TaskCompletionSource<bool> _taskCompletionSource = new TaskCompletionSource<bool>();
private readonly Timer _timer;
public DelayPromise(int millisecondsDelay)
{
_timer = new Timer(state => ((DelayPromise)state).Complete(), this, millisecondsDelay, Timeout.Infinite);
}
public Task Task
{
get { return _taskCompletionSource.Task; }
}
private void Complete()
{
if (_taskCompletionSource.TrySetResult(true))
{
_timer.Dispose();
}
}
}
public static Task DelayAsync(int millisecondsDelay)
{
var promise = new DelayPromise(millisecondsDelay);
return promise.Task;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|