|
I used to be a fan of Object-Oriented design and programming to the extent I divided code to good (OO) and bad (Not OO)! At some point, however, I learned that some excellent OO designs of mine were not sound architectural choices i.e., were actually bad!! Sometimes, in very specific situations gaining performance is worth sacrificing beautiful maintainable code. I have encountered cases where non-OO code is more maintainable so OO does NOT necessarily means good! but what does? What is good code?
In daily life our choices are based on reasoning by weighing possible options. For example, if faced with the question what is the proper means of transportation? One would immediately ask “how far is your destination?” that is the piece of information that helps choose say between a flight or a ride. Now, if I say the distance is 3 KM then either walking, riding a bike, and driving a car could be valid choices but using an airplane is not a good (or even sane!) choice. Further questions help making the best choice among remaining options: “how much time do you have?”, “How is the weather?”. The funny part is that for many daily tasks (probably depending how much they will cost us) we spend time, we think and choose the most appropriate options.
What about software development choices? Do we think whether we should use a switch/case statement or a class hierarchy or we just write the code? Most probably whenever choices will be too expensive to change down the road or perhaps when there are not way too many factors involved, we do think and consciously choose. But even when we do, I believe, we rely on experience rather than data! Much like other choices in life, however, in the engineering world one must be way too smart and lived too long to remember all possible options and their characteristics! If I was not looking for benchmark results of existing web servers I did not even believe we have tens of available options(!): Round 20 results - TechEmpower Framework Benchmarks
Now performance is just one piece of information to help make a decision. I believe in our industry there are NOT enough reliable data (based on proper research) to make proper engineering choices. GOF created a catalog of patterns for common problems but there not one for technologies / platforms. To give an example, let’s say we are going to deal with high concurrency, it would have been awesome to have this sort of a table:
Context: Concurrenc
┌──────────────────────────────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────────┬────────────────┐
│ characteristics↓ Tech/Style → │ Thread │Coroutine│ FUTURE │ PLinQ │ TPL │ Map/Reduce │ Actor Model │
├──────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────────┼────────────────┤
│ Learning Difficulty │Moderate │ ... │ ... │ ... │ ... │ ... │ ... │
│ Implementation Difficulty │Easy │ ... │ ... │ ... │ ... │ ... │ ... │
│ Performance │Medium │ ... │ ... │ ... │ ... │ ... │ ... │
│ Platforms │Not in JS│ ... │ ... │ ... │ ... │ ... │ ... │
│ Sample code, etc. │ ... │ ... │ ... │ ... │ ... │ ... │ ... │
└──────────────────────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────────┴────────────────┘
Have we had such data, we wouldn’t choose by taste or personal experience rather we used reliable data to make the best choice for the job.
|
|
|
|
|
Message Removed
modified 16-Mar-21 15:08pm.
|
|
|
|
|
Message Removed
modified 16-Mar-21 15:08pm.
|
|
|
|
|
Setting up a relatively reliable backup plan for my data. Testing AOMEI Backupper and (since data can become rotten(!)) MultiPar...
|
|
|
|
|
If you have worked with layered architecture and an ORM for a while you probably have a set of repository classes with some GetSomething methods to return records (probably mapped to objects) from database. To prevent loading all objects you probably have some conditional statements that are applied to query before linq executes them like this:
public SomeObjectList RepoMethod(bool includeRelatedRecordSet1)
{
...
vr query = context.AllObjects.Where(condition);
if (includeRelatedRecordSet1) query = query.Include(q => q.RelatedRecordSet1);
}
The problem is that as time passes and applications get more and more complex the list of parameters increases and we endue recreating LINQ albeit in an ugly way!
We don't want to return query and execute it + map results using LINQ outside repository for design reasons, we don't want to return all mapped records and then execute LINQ on objects outside the repository for performance reasons. What should we do? Should we accept linq to object queries as input parameter (lambda) and map these queries to ORM queries? Seems like too much work. Looking for a solution...
Update:
A class that is somewhat dumber than Linq but more flexible than Repository produces better results. For example this is the code using the class:
var friends =
myFriends
.WhereNameIs("Ross")
.WhereAgeIsGreaterThan(25)
.MapWith(new PersonMapper());
modified 25-Feb-18 10:01am.
|
|
|
|
|
Microsoft already has the best programming languages in the world; C# and F#. They have the best IDE too (Once installed and ran though! Installer of the latest version (14 AKA 2015) really sucks and also it is becoming too slow to start but once started, and especially if Resharper is installed too, it cannot be beaten.)
However, all of these might become obsolete in no time. IF desktop programming becomes obsolete, these tools won't be of much use in such a future either.
Microsoft could create the best cross-platform solution for developing mobile apps and it's not the way Xamarin has done it. Xamarin has made it way too complex. The genius designer of "CodeName One" has done it though, IMO.
Regardless of the idea that Web will rule the future (advocated of that idea believe it will happen the same way web ate large portion of native desktop app market-share), for native app development I see no better solution than CodeName One.
CodeName One has done the difficult part of the job and actually has done it in a very efficient way! The GUI is rendered using OpenGL. That means creating UI has become easy because we no longer deal with two or more distinct native platforms and especially we no longer deal with crap set of apis that Google has created for Android. We can focus on one easy to use framework. Customization is possible and sometimes not that difficult either.
Microsoft could use this idea and empower C# developers this way. They could win developers developers developers again!
|
|
|
|
|
.Net Core is the COOLEST idea out of redmond ever! I LOVE THE IDEA!
To see my .Net app on Linux, Mac, and also as a Windows UWP on whatever device Windows can run on, IS UNDOUBTEDLY the best news I've heard recently. I wish one day it can run on Android or iOS too!!
But let's not get excited and dream too much just yet!
|
|
|
|
|
One of my fantasies has been to read a mysterious lyric inside of which there are lines referring to other songs (probably by mentioning their name or a line of their lyrics).
I know advertisement experts would misuse that and it will eventually be a "music as a service" thing in which a lyric earns money by introducing songs of others (others who pay to be introduced of course!) inside songs of the most famous ones but still the initial lyric would be extremely fun. Figuring out what is the hidden lyric would be kinda of fun too.
This means connecting lyrics, and in a way, songs to each other!
|
|
|
|
|
Trying to create a little project with Asp.Net 5 preview I noticed a project I have moved into another virtual machine can't run in IIS Express. The problem turned out to be a path to the old directory somewhere stored inside a directory called ".vs". Deleting the directory and reopening the project fixed everything.
Just delete the ".vs" directory in case you moved your solution to another drive. VS can build it again.
|
|
|
|
|
After over 20 years of being a user of Microsoft Windows OS and related products and over 10 years of programming for it professionally, I decided to check out latest status of Linux again. I did and it is frightening!
Last time I tried Linux was when I was still studying in college. I was interested in exploring all options (I still am!) and then choosing (and sticking to) the best one (I no longer do though!) so I played with Redhat from version 6 to 9 and then Fedora. I also tried a few other distros. My experiments showed me that Linux is in general way too fat for my desktop machine, besides, I had to fight with they system to get it to work the way I wanted it, in comparison Windows was flying like a free bird (!) and drivers were easy to install. Moreover, Windows had applications with MUCH higher quality. (apart from a consistent, fast, and responsive GUI, I recall the pleasant experience of JetAudio, sharp and vivid colours of PowerDVD, excellent games when I was a regular user and then quality of Visual Studio IDE along with a comprehensive offline version of MSDN.) I chose Microsoft because they had the best quality software.
Fast forward 11 years and same is the reason to move to Linux. Ubuntu just worked even before installing! (Live CD) In fact I was listening to a great song while installing it on my main machine! There were zero issues with drivers. (Actually, I didn't install anything!) and best of all, nearly all the applications I have been using are open source and have a version on Linux and to install them, I don't need to head to tens of websites; there's a repository much like Google Play app store but for desktop. GUI is not as good as Windows but after experiencing Windows 10, I can say it's even more consistent than Windows now! And, FORTUNATELY for me, everything is not flat here!
The only missing things are VisualStudio and Photoshop, however, there's VirtualBox in the app repository.
It's hard to believe an OS with this quality is free. I used to laugh at Apple fans because they have been spending ridiculous amounts of money over cr@ppy products, yet wasn't able to see my own bias towards Microsoft. Don't get me wrong, Microsoft was the best software company in the world. (In fact I have always dreamed of working at Microsoft, who hasn't right?!) But unfortunately they have lost their position and worse is that they don't seem to decide to go back.
Microsoft has turned their back to some of the best quality and really cool products they have created (like .Net platform and C# and F# languages) in favour of the closed system of Universal apps and an ugly basic interface they call 'minimalistic design', 'modern', 'metro', etc. It's not art. Not every ugly thing someone famous but illiterate has in mind is art. I don't understand why some people think a futuristic GUI is made of flat lines and rectangles? I believe a futuristic GUI is the one that has been evolved over time the way nature works, evolution rather than revolution. Moreover, I am in favour of science over ideology.
But that unfortunately is not all the story. Beneath the GUI, Linux is actually working better than Windows. For one thing, my hard disk LED is now almost always switched off while in Windows it was almost always on. I don't understand why applications and the OS uses hard disk that bad. I know that Linux file system doesn't need de-fragmentation, but it's not like Windows is de-fragmenting all the time, is it? Moreover, how can Linux run this fast? I mean it was ready to work in a fraction of the time Windows 8.1 needs to load to desktop (FAKE load by the way because after a few years past the installation Windows wasn't responsive to even keyboard interrupts minutes after a boot).
I couldn't imagine a day in which Linux become the faster OS with prettier GUI yet that day has arrived.
BTW, if you are a programmer and have a look at the Linux stack, they almost already have "write once - run everywhere"; Python has Kivy, Qt supports Android and iOS, RoboVM (with insanely high performance on Android) does that using Java, and the list continues.
I will certainly continue using Visual Studio because I really love C# and to an extent I like Web Api and MVC (Apart from Identity, it sucks! One of the worst releases from Microsoft) but for most of my tasks I will be using Ubuntu instead of Windows 10. I will sure miss Windows. I wish they get back where they used to be, after all I used to love the company and their products.
|
|
|
|
|
Why should we inject dependencies?
Why shouldn't we hide them?!
What is dependency anyway?
Almost everywhere people use IOC containers and DI frameworks to inject dependencies to classes, often by adding all "dependencies" to a class's constructors as parameters. Apparently the rule is that any class we use inside another class is dependency and shall not be instantiated internally but to be provided as constructor parameter (or a property of that class).
The funny thing is that classes themselves have been created with the intention of hiding their states. In fact libraries and modules in programming languages allow us to no longer think about internals of services but to be users of those services. However, when it comes to class composition these days we shouldn't hide ANYTHING!
There's a problem that's been overlooked, IMO, and it's the amount of complexity we accept by introducing these (often) useless flexibilities.
First of all passing dependencies as parameters makes all the layers that need to pass these dependencies to lower layers more coupled to those dependencies of lower level classes! I don't understand how design legends justify this coupling really!
Then comes all sort of solutions for a problem we created ourselves! One common solution is using factories, then when there are a lot of them, use factories of factories. What a mess!
This much complexity is not worth it, IMO.
Unfortunately dependency injection is not the only commandment sent to poor developers by gods of design. Think about it: when was the last time you decided to replace you Domain layer in an app entirely?! When was the last time you could afford it? When was the last time you really went ahead and did that? I am not saying nobody needs that, I'm just saying do we have any valid number/statistics that tells us the real value of the price we pay? On how many project this has been useful and on how many has it been useless extra cost?
Don't get me wrong, I really like layered design but not because of Dependency Inversion principle that allows us create decoupled changeable layers, but because it helps my mind to deal with only one topic inside each layer. It kinda helps me focus on the task at hand.
Dependency injection, however, is not something I can always like. Sometimes I like to hide classes I use inside another class. I prefer no one on higher levels even know how a class is doing what it does!
|
|
|
|
|
Playing around with Asp.Net 5 today. It's still not ready and not worth the time that's going to be wasted fighting with the framework. I spent like two hours getting an upgrade to beta 5 to work but was not successful. Apparently there was an issue with DNX versions.
It's fine to have bugs at this point but what's not cool is the fact that for a simple project we have to edit 2 files as well as the project properties to set the target .Net framework version, moreover, all the three version must match. (Even though in my case VS couldn't find a beta5 of Core framework).
IMO, it's a serious design issue that the version is going to be read from 3 sources.
|
|
|
|
|
Decided to install VS 2015 RC in a virtual machine, OS has to be at least Win 8.1. Win 8.1 must have update 1, BTW. While trying to install Windows8.1-KB2919355-x64 I got an error message indicating nothing!
"This update is not applicable to your computer"
Event viewer didn't provide any clue either. It turned out that this KB is dependent to another KB: Windows8.1-KB2919442-x64. After installing the dependency it all went fine.
Note to self: all application errors must guide user what to do. General errors aren't helpful.
|
|
|
|
|
I wish there were 5 buttons instead of three for every window in Windows; Close, Restore, Minimize, Minimize to Tray, z-index button or control (keep a window in front or bring it to the front, etc.).
Moreover, I wish there was a way to reopen the window I just mistakenly closed, cause let's face it, the Taskbar is kinda similar to Tab control (BTW, IMHO, Firefox has created the best solution for opening many of them simultaneously, restoring them (Ctrl+Shift+T), etc.)
In fact, I have recently used file explorer in Ubuntu and it's cool to have a tab control for that too per every open window. Cool ideas, not Modern style perhaps but very usable.
|
|
|
|
|
Services need to be more aware of each other. In my mobile, for example, I have a list of SMS messages, a list of contacts, multiple apps for email, socialization, etc. Can I find answer to this question while I have all related data: "With which contact of mine am I communicating the most?"? No!
Data of all these apps are separated and these apps won't communicate; even in unified platforms like MS Windows. I believe if our apps could communicate more effectively, we could have a much richer experience. Imagine I could ask my phone to go through all the history I've had with some contact person in all my apps, in any form, and search content of all of them for a specific phrase.
Imagine a statistics app could communicate with all these other apps and count for me how long have I spent with each friend of mine or what are we often talking about, i.e. what are our interests or cool stuff like that.
Imagine an app that could tell me what am I doing with my life by showing me a pie chart of the amount of time I spent on each of my digital activities.
Imagine what a fully connected software world could provide humans...
|
|
|
|
|
I was working on my very first SignalR application. I completed everything and hit F5 waiting for the magic to begin! But instead, I had this strange exception:
JavaScript runtime error: Unable to get property '...' of undefined or null reference
Apparently $.connection.MyHub was null. $.connection was all good, but the hub wasn't there; generated Hubs.js did not contain any proxies, but why?
I decided to forget auto generated proxies and write JavaScript code manually. Hit F5 again and the exception turned into this error: “Hub could not be resolved.”
I tried almost everything I could find on-line, nothing worked. I enabled logging and saw this in my browser Console:
"Failed to load resource: the server responded with a status of 500 (Internal Server Error)"
This was happening at negotiation:
localhost:8090/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B"name"%3A"notificationhub"%7D%5D&_=1427975920368
A refresh didn't help!
GET localhost:8090/signalr/negotiate?... 500 (Internal Server Error)
I was hosting it in Owin and I thought it is the root of the problem, but it wasn't! I had to waste hours to find the bug.
The problem? So silly! The Hub class was defined internal!! Defining it as Public solved the issue.
Some days just out to be less productive! I hope this blog post saves someone some time.
|
|
|
|
|
Default .Net configuration framework is not good, IMO, because it pushes us to have one file per project, but then when it comes to libraries we aren't allowed to have one per library because libraries won't load any configuration file.
The result is often mess in most projects I have faced. Some settings are duplicated in multiple projects, some go a long way (through a set of layers and classes) to reach their destination. Moreover, updating settings file (let's say the app has a new feature that requires adding new items to user settings file) is a big trouble (I have even spotted strange uncertain behaviors); besides, it can be located in multiple directories which makes updating the file manually a nightmare.
I took a different approach in two projects recently. I created one "Settings" project for my solution and forbid adding any "settings" file to any individual project. Any other project that needed to load/save settings had to add a reference to this new "Setting" project.
To make it easier to access settings I created kind of a Service Locator in this project called "SettingsMan" which can load any of the requested settings like this:
(new SettingMan()).LoadSettings<IRabbitSettings>()
I also used Nini to have an "ini" as my setting file. The end result is much better structured and cleaner code.
|
|
|
|
|
Enjoying from reading design books and many online (and even offline in books) debates, I was wondering which of the following is a better design?
if ((new Username("AUsername")).IsValid())...
if (Username.IsValid("AUsername"))...
if (Validators.UsernameValidator.IsValid("AUsername"))...
if ((new UsernameValidator).IsValid("AUsername"))...
if ((new UsernameValidator("AUsername")).IsValid())...
Or this one:
if ((new SupportedCountries).Contains("Canada"))...
if (Countries.Where(x=>string.IsEqual(x.Name, "Canada")).IsSupported)...
As far as opinions are the driving force in this field we wouldn't see a real improvement. I believe, design, more than a new book or article, requires real scientific research.
|
|
|
|
|
I have studied MS Sync framework a bit and I think I have an idea of a better solution.
The problem:
Sync frameworks that I know of, so far, work on data. They are coupled either with client side databases (like SQLite on mobile), server side databases, or even both. Moreover, they add fields to our database tables. That's error prone, costly and doesn't allow any easy or cheap way of implementing transactions.
Solution:
I think a better approach is possible; instead of syncing 'data', we can sync 'events'. Using 'event sourcing' pattern, applications can keep track of changes they make to data. If these events are sent to server instead of data, server can recreate database instead of replicating client side data. No longer has server database needed to be bound to a syncing technology, heck it doesn't even need to know what sort of store each client is using. Server can optimize events before applying them on database or check them for possible conflicts. In case of a real conflict, the set of events can easily be rolled back so it gives a cheaper transaction implementation possibility. Furthermore, no table will need to be touched in order to create such a synchronization mechanism.
Just some ideas and a very basic raw untested theory, need to research more on the subject. As soon as I find a bit of free time, I’ll try implementing this. If it works, it might actually become big, IMO.
modified 7-Dec-14 3:51am.
|
|
|
|
|
Type in a search engine REST VS. and the first result is 'SOAP'! Then there are lengthy blog entries explaining the difference. This makes me close my eyes for some seconds and dream about a world in which Internet could be cleaned up of all sorts of useless words, so real pros voices could be heard.
Nevertheless, here's my 2 cents on the subject:
REST(Representational state transfer) is an architectural style. On the other hand, SOAP (Simple Object Access Protocol) is a protocol. So it is really comparing apples and oranges.
The thing is, for writing and consuming services, we can follow guidelines/restrictions of REST, which by the way says nothing about the protocol (No, it doesn't need to be over http) and thus create a RESTful (why should it be written in such an ugly way, I don't know!) service or use other approaches. One of the other most popular approaches is message based SOAP protocol, often implemented by following guidelines of SOA(Service-oriented architecture).
If you dig deeper, you'll notice that in order to implement SOA, lots of patterns and standards are used. There are many SOA books available if you are interested to understand it better, or if you enjoy design patterns like I do, it's worth to take one and read a few pages to see what patterns are evolved over time to shape SOA.
As a programmer who invested on Microsoft technologies for the past ten years, what I know as an implementation of SOAP for communication is WCF and the one using REST style is called WebAPI.
I found one of the properties of REST to contradict some restrictions. The property is "Performance" and restrictions are "Self-descriptive messages" and "Manipulation of resources through these representations" which basically say that each message and also each piece of data must be self explanatory so without the need of any metadata or contract, client can manipulate data or access related information. Just imagine how much relationship/manipulation (I'm not talking about known URLS for manipulation like GET/PUT/DELETE) data each record should hold. How then it will have high performance?
Nevertheless, most web based RESTful services aren't RESTful based on those restrictions and prefer performance over those restrictions when it comes to implementation.
|
|
|
|
|
<DIV> is a nightmare for many website programmers. Compared to that, WPF layout tools ROCK!
I think it might be because they are tailored.
While <DIV> is the one magical layout tool which is going to do everything, its behavior can be interpreted differently (and it actually does by different browsers), WPF comes with a set of tailored tools (StackPanel, Grid, LayoutPanel, etc.), each of which does one simple thing that cannot easily be interpreted otherwise.
Interestingly, same is happening in hardware world. All-in-one desktop PCs are being threatened (not by tablets alone but) by the sheer volume of different devices, each of which are tailored to do one thing and doing it better than PC does.
Planning to move to Germany, looking for a job there!Looking for a Windows desktop programmer? I look forward to hearing from you!
|
|
|
|
|
If I want to name main issues with Win 8, on desktop, I'd say:
1. Lost control
This was the main issue I had with Metro style apps. Not knowing where to expect to click/right-click/touch for magic to happen. Even default applications did NOT use exactly same layout and if they did, they were so frighteningly incomplete in number of features. I couldn't adjust simple things like detailed quality settings of my Webcam!
Not having old multi-tasking features, made my daily works slower. It felt like it was forcefully limiting me.
2. Unorganized, Untidy and Chaos.
Some items on the right, some on the left. Path to commonly used settings are going further and further away. (Try changing IPv4 settings in XP, then try it on Win 8!).
Newly installed applications appeared all over the start screen and it was impossible to organize them the way I wanted.
Some windows settings would open in desktop, some seemed to be accessible only via Metro.
3. Look and feel
It felt incomplete, like designs of a new graduate graphic student while Windows 7 looked really mature.
I am back, and unlike my journey back from Vista to XP, now I don't feel in an outdated world, but a different world, a better one to be honest, one with more freedom!
Update:
Couldn't resist again! A few weeks ago I installed 8.1 + ClassicShell. It's like 7, stable and everything, only faster. I like this OS on desktop, still don't like Metro GUI. Hope next Build event brings good news to all of us.
Planning to move to Germany, looking for a job there!Looking for a Windows desktop programmer? I look forward to hearing from you!
modified 10-Mar-14 14:15pm.
|
|
|
|
|
Introduced in 1999, Web 2.0 was a set of new features, namely dynamic vs. static pages.
For me, as a user, it was the time when people started providing content. There are two main problems with this approach which I experienced while being a member of Facebook, or reading comments under books of Amazon.com.
1. Inaccurate, sometimes completely wrong and very harmful data:
Everybody talks, mainly based on their ideas, and ideas are often result of over generalization of past experiences in our own lives or other reliable or unreliable sources.
Just recently I began a small research in my own profession, programming and noticed many issues in Wikipedia articles, in comparison to reliable sources.
Just read reviews underneath Amazon books, I find some reviews that belong to a completely different book, or reviews that seem to be written after spending 10 minutes with a book.
2. People work for free for Web 2.0!
After I left addiction to Facebook, I noticed that I was wasting invaluable hours of life doing something that wasn't actually worth it! I don't know how many people will give up, stop and think about how they are living their lives but if the number increases, Web 2.0 will die eventually.
A question
A good question to ask would be, is it worth spending so much time, producing a content that many times isn't worth and sometimes are even harmful?! A side effect of this move is that the Internet is filled with huge volume of useless content that even separating it from useful ones is becoming an issue and many apps are being written to automatically sensor useless data!
To have a successful future, I believe data shall become reliable.
A suggestion
I believe it is best that only experts produce data, but on the other hand, freedom of speech shall be preserved. So I was thinking that maybe in the future, applications can produce metadata around users data. Metadata that will help readers to weigh value of the published data they face everyday. Metadata that is gathered as part of daily lives of users. Data in this scenario isn't solely result of a users work, but a result of a service given to a user, during which users opinion and monitored actions data are gathered.
For instance, imagine a book store website that only allows comments via an e-book reader application. Very restricting, but one can say, comments on this website must be much more reliable. (Quantity vs. quality)
An e-reader application that will monitor readers actions (with permission of course) and when a reader asks to delete a book, asks why? This app, keeps track of books a reader has read and can be viewed by the user as a database to refer to, next time he wants to pick up a book from same author for instance(giving service to user), but also, it can ask user to share her/his experience (producing content).
This experience becomes a review of the book and also metadatas like:
* How many hours this reviewer spent with the book?
* How many pages she/he read?
* How many minutes she/he spent on each page?
* What is the total number of books this user has read and on which subjects?
* etc.
It can be completely anonymous, by omitting real readers identity, and at the same time creating useful quality content to guide future buyers of the product (book in this example)
I believe if the service of the application is good enough, users will install it voluntarily, just as many users are now installing Android apps that ask permission to access a lot of private stuff.
Just an idea, in a holiday! 
|
|
|
|
|
My WiFi router died a few days ago, before I buy a new one, I needed internet on my android phone, there seemed to be a solution, Microsoft Virtual WiFi; unreliable online information indicate that some Wireless LAN interface manufacturers have added a feature to their boards that allow the normally receiver board act as a transmitters too. Sounds interesting! Let's try it!
There's like a million blog entries and tens of applications on how to create and run it.
In short:
Run these commands as administrator:
netsh wlan set hostednetwork mode=allow ssid="WiFiName" key="WiFiPassword" keyUsage=persistent
netsh wlan start hostednetwork
Note: I actually had to go to Device Manager, refresh list of Network adapters and enable 'Microsoft Hosted Network Virtual Adapter' before these commands could work correctly.
and then share my pc internet with the newly added virtual adapter (LAN adapter Properties>Sharing>VirtualWiFi).
After I went through all the steps, I faced another problem:
Android device could see the new Wireless network, but couldn't get an ip from it. 'ip config /all' reported DHCP to be disabled on my VirtualWiFi adapter. Why? I have no idea, after all network isn't my specialty. I decided to go the easy way of assigning IPs manually.
At first it seemed impossible in Android ICS! After half a day I figured, it is possible!
- First, on my LG phone, it can only be assigned upon first connection to a WiFi.
- Second, even though 'Static IP' fields are grayed out and already filled with some numbers that can't be deleted, it's just an android GUI bad decision, I accidentally typed a new set of digits, it worked!! It wasn't disabled! I believed it's disabled so hard that I didn't even try to enter digits. Kinda frightening how I live based on prior assumptions though!
So here's my static IP assignments:
DSL Router (DHCP but I actually am not using it anymore!):
192.168.1.1
Lan Internet:
IPV4:192.168.1.2
Subnet:255.255.255.0
Gateway:192.168.1.1
DNS:8.8.8.8
My Virtual WiFi adapter:
192.168.137.1
255.255.255.0
NO DEFAULT GATEWAY
My Android device:
192.168.137.10
255.255.255.0
192.168.137.1
Planning to move to Germany, looking for a job there!Looking for a Windows desktop programmer? I look forward to hearing from you!
|
|
|
|
|
Nearly a decade ago I became a member of this website! Back then, a young man with crazy dreams, many of which are fulfilled!!
After graduation, I worked hard, creating as many apps as possible. Most of them were for others and the money spent on food. I didn't pursue game development, but I learned C#, ASP.Net MVC, WinAVR and firmware programming, a little bit JavaScript, WCF and WPF. I'll not learn F# unless I have to. I might learn Java (Yes, for Android!) and I'll definitely play more with Entity framework.
In a few days, I'll be 32. I can say, in past ten years I learned more about our world and life than about programming. I wish I knew all the things that I know now, back then, when I started my journey as a programmer. If I marry one day and have kids, I'll teach them these lessons. They'll call me a boring dad I guess!!
Time goes real fast and life is hard. This year I decided that it's time for change. I started working mostly on improving my skills again. I (FINALLY!!) read GOF book on patterns completely, I finished HeadFirst design patterns book too, read some parts of the GitPro book to learn its command line better and now I'm reading Martin Fowlers' book; 'Patterns of enterprise application architecture', YES I'm going to be a better Object Oriented designer!
Three crazy dreams remained unfulfilled, most important of them, to live in a free country. I prepared for it, I'm almost ready! A few more steps remaining...
|
|
|
|
|