Ektbear's Posts
Nairaland Forum › Ektbear's Profile › Ektbear's Posts
1 2 3 4 5 6 7 8 ... 368 369 370 371 372 373 374 375 376 (of 485 pages)
the clothes do not make the man, the man makes the clothes nothing wrong with an agbada-wearing governor |
Very shameful mentality, GenBuhari |
Beaf:Are you able to do it in N steps rather than the 2N he uses? This is the only other substantial area of improvement. But I don't think it is possible to do it in N steps. . . you sort of have to double the original array one way or another (something akin to what he did.) If you (or anyone else) can do it in N steps, I'd want to see that. . . .and talking about ways of cheating and getting around the no nested loop requirement? Lol! Someone already attempted that with recursion!You could always manufacture a nested loop from a single one, just using the ceil function and the modulo function:
|
Blindcopy and I are mostly on the same page. Is Visual Basic really easier to learn than than Python (or Ruby)? Or is it the visualization/GUI stuff that I guess you find makes it superior? |
I think his solution is better if the search array is big. If we use N to denote the size of the original array and M the search array, his algorithm is still only of complexity 2N (he effectively just repeats the original array twice then does a search.) Otoh, mine has complexity NM, since if M is of arbitrarily length, since at each iteration I do M comparisons (you can imagine me having an additional loop inside the first to do comparisons. . . though of course as you stated the original problem, you don't want an additional loop. Though I should probably point out that there are ways to "cheat" and get effectively two [or three, or four, etc] loops out of one, circumventing this condition you placed ) So if M is say N/2, then my algorithm behaves poorly. . . . N^2 complexity.So I think my algorithm is only useful if M is much smaller than N. . . say searching for 5 in 1000. His is probably better (at least theoretically) for 500 in 1000. |
macomrades:What is up with this fascination of making things hard for new programmers? ![]() If you have a 13 or 14 year old kid and you want them to get into programming, you'd really want to start them off with low-level stuff like this that is only of interest to a small fraction of programmers? Only thing this will do is scare away people from programming, suck away their enjoyment. Anyway, you can do bitwise operations in almost every language. So no reason to choose C alone for that. I think you guys have the idea that getting as close to the metal as possible is a good way to teach someone programming. Imo, it is way better to treat it like a onion. . . keep things very high-level, then work your way in more deeply as time progresses. You don't want to lose sight of the big picture, imo |
birdman:Bah C sucks bro You spend too much time focusing on things that don't matter. Memory management in this day and age? Is that really what someone should be focusing on? I'd rather have someone master unit testing, design patterns, object oriented programming, concepts like that.C and C++ code is buggier imo. And the errors are more subtle and harder to catch. Also, kindly explain what bad habits one learns from a WELL DESIGNED scripting language like Python or Ruby (I'm not talking about a junk languages like PHP here). And in what way is Python less powerful for most applications? I'm not a fan of C at all for 99% of software that one writes. Now, if I have to write a compiler, operating system, things of that sort, sure, then use C. But for most software that beginners are likely to write (text processing, some GUI stuff, SQL database stuff), makes way more sense to use a scripting language, imo. |
^-- Thanks for posting pictures. I wish we could see a more detailed breakdown of the timeline to 114MW. Just buying the plants/gens alone doesn't take that long. So maybe it is the time they are spending wiring everything up (i.e., building the separate distribution network?) Anyway, cool as heck. Place I went to college also generated its own electricity to keep a separate grid from the city. I guess they did this to avoid situations where a power outage in the city destroys biological experiments, or something ![]() |
^-- On line 14:
|
The so-called Alhaji Harem is the biggest mystery on NL For all we know he is really Atiku Abubukar. He is definitely no ordinary mallam |
Let him experiment with this policy in Abuja, let them be the guinea pig and not Lagos |
I think the key conceptual thing to recognize is that if you are searching for the pattern:
In the arrays
Well, in arrays like the first one that don't wrap around, it is dead easy. . . . you do a single loop (of length N) and look for the first index where:
By a simple small trick, you can treat the second type of array like the first one. You'll invent some appropriately chosen function F(idx,N), and then instead just search for the first index where:
That way you can deal with wraparounds like "2BCA1" easily. |
My solution (written in Matlab/Octave): http://pastebin.com/hLs62DE9 And here is the result: https://i54.tinypic.com/11ay9o6.png The four test vectors look like:
We find the location of the correct starting "1" for V1, V2 and V3 (namely, entries 34, 10, and 30), and the code returns a -1 when it cannot find the pattern in V4. At least, I think this is the correct solution if I've understood the problem properly |
Segzy23:What do you mean by this? Why is it a bad idea to learn a scripting language as your first language? What disadvantage is there? |
If you are just starting out with learning how to program, I'd suggest first mastering a scripting language of some sort. I use Ruby personally, but I'd suggest Python for someone starting from scratch (Lisp and Scheme are also pretty popular in academic/"first course on computer science" circles.) So why a scripting language? Generally less code written to accomplish the same tasks as compiled languages like Java, C++ and C. Which means more time focusing on the big picture than on details, and thus more time actually learning important concepts. Reducing the amount of time it takes for you to go from "I'd like to write an application that does X" to actually rolling out that application I think is kind of important when you first start programming. . . it helps you stay motivated. And with the libraries available today, pretty much anything you want to do with a compiled language you can do with a scripting language. . . with Ruby I recently wrote some numerical linear algebra software. And you can also do GUIs, etc, etc. Of course, there is a downside with interpreted languages. . . they usually are a bit slower than compiled languages. But for you, since you are starting from scratch and mainly trying to teach yourself, performance doesn't really matter at this point. Now, if you get serious about programming or want to do it for a career, at some point you'll need to pick up additional languages. For example, if you follow my advice and master Python, your next job/project might end up using Java instead (for example.) From what I've seen, the first language you learn is very unlikely to be the one you end up using later in life ![]() Fortunately, once you master one programming language, to add the next one basically is just learning new syntax. I guess that is why I emphasize picking a relatively easy but expressive, well-designed language to start (like Python) so you can master the important ideas. |
Far from home May 20th 2011, 13:41 by S.B. | MONROVIA LEBANESE businessmen in west Africa like to tell how in the 19th century their forefathers arrived by accident, disembarking from ships en route to South America. Making money there is no easy feat and few would come by choice, they say. The sweltering corner of the continent is marked by instability—most recently in Côte d’Ivoire—feeble infrastructure and rampant corruption. But 250,000-odd Lebanese who live there—the largest non-African group in the region—are faring well. Since a second influx during the Lebanese civil war, their interests have expanded beyond small trading outlets. Today many oversee vast business empires involved in construction, telecommunications and industry which dominate import-export. Some have sidelines in diamond smuggling too. Ezzad Eid, a businessman and community leader in Liberia, home to around 4,000 Lebanese, sits in his glassy office in Monrovia sipping Rim water, one of many imports from his home country. His businesses—which include a chain of hardware stores, an aluminium factory and a plush hotel—turn over millions of dollars a year in a country where the government's annual budget is just $369m. Mr Ezzad claims that 60% of Liberia's economy is in Lebanese hands. His boast is probably too high—no accurate figures are available—but it certainly a sizeable chunk. Those in business say several factors have helped them to succeed. Most crucial are trade networks among the Lebanese diaspora and beyond, says Abdallah Shehny whose office-equipment business spans Sierra Leone, Liberia and Dubai. Contacts in countries Brazil to China—little trade is done with other African countries due to costs of overcoming poor infrastructure—are important for trade. But they also act as substitutes for the lack of local services such as access to finance. Family workers bring down costs. Thousands Lebanese fled Liberia's long civil war; those who stayed found plenty of opportunities for reconstruction. Many educated and well-off Liberians also left. But competition from businessmen from India and China is now growing. Flexible responses to the changing political and economical situation has been key to the diaspora's success, according to Mara Leichtman, an American academic who studies the Lebanese in Senegal. Easy relations with the political elites and the money to pay bribes also help. Liberia's Lebanese are unable to buy property and are banned from 26 industries, but simultaneous patronage by officials is common. "I budget for bribes," admits a Lebanese restaurateur. "Anyone wanting to do business here does." Widely visible success has fuelled local resentment. Protests over pay and job conditions in Lebanese-run companies occur. "The Lebanese mainly trade, sending money out of the country rather than investing," grumbles Sam Mitchell, the head of the Liberian Business Association. Others accuse the community of leaving little room for local businesses and collaborating to drive them out of the market. New Lebanese immigrants are unlikely to be deterred. Business is booming. As one businessman puts it: "Anywhere is easier to make money than Lebanon." http://www.economist.com/blogs/baobab/2011/05/lebanese_west_africa |
I hope this is an exaggeration. That is nearly as much debt as Lagos has. And Kano's economy is not comparable. |
Let me be real for a second. . . if this was in Igboland, I'd be hating on 'em a little bit. But it is not ![]() Really hard for me to hate on the success of the minority groups Plus I've never had anything but good interactions with the folks I've met in my life from AKS and Cross Rivers. My dad has a few on his staff. . . seem like good folk to me |
Ozin:It isn't a zero-sum game imo. If AKS prospers and develops, then all of Nigeria wins I don't think anyone benefits if any of the 36 states fails. Man I might have to check out your state next time I go to Nigeria |
Interesting: http://www.aksgonline.com/articlePage.aspx?qrID=886 $2 billion budget this year, $2.3 billion the year before. And a relatively small population. So Lagos, Rivers type of money, but with 1/5th of the population of Lagos. Makes sense that it'd be developing so rapidly. Kudos to them |
The more performing governors in Nigeria, the better. But definitely, we need to see some pictures |
hercules07:I understand that only a small fraction of transactions (8%) are above this 150k limit. But of these 8%, how many are (A) someone buying a brand new SUV with cash only, versus (B) some small shop owner selling N150K worth of rice in a day. I can see how it makes sense to encourage guy (A) to go cashless. . . whoever is selling the car won't accept cash again. But in the case of (B), what does the small shop owner do? Probably most of his customers buy rice from him with cash. If he has to pay additional fees to deposit the money he earns, he'll make up the difference through charging extra to his customers I guess (at least those who buy rice from him with cash.) You sort of see what I'm saying? How easy is it to do these small transactions in Nigeria (N1000 of rice) without cash? If it is hard, then guy (B) and his customers will suffer. |
It just feels to me that if you have any type of store that does more than N150K of business a day (or I guess N1 million is the corporate limit), then it means such businesses have to pay a a fee to deposit their cash into the bank. So I guess they'll encourage their buyers to go cashless. But if you are doing N1 million of rice, beans, t-shirts, etc per day, then how on earth will you convince your buyers to go cashless? Is it easy for your average Nigerian to buy say N1000 worth of stuff without cash? |
My intuition at first was that this is a bad idea, and will encourage people to keep more money outside of the banking system. Who wants to pay fees to deposit/withdraw money in the bank? I still think this is a bad idea. We shall see, I guess. |
on MAY 25, 2011 · in BUSINESS Abuja – CBN governor, Malam Sanusi Lamido Sanusi, said in Abuja on Tuesday that the bank would test-run its cash transaction limit policy in Lagos in the next six months. The policy, which pegs cash transactions at an initial N150,000 takes effect from June 2012. “What we are going to do for the next six months, we have what we call a project `Cashless Lagos’, we’ll bring Lagos up as a model; you’ll see the ATM density; we are going to work with telecoms companies and you find that you go to Lagos and do your business with cards. “The people complaining about the N150,000 go to England, and go to America, they use cards; they use the internet; they use telephone banking. When they come to Nigeria, they want to carry millions of Naira in `Ghana-must-go’ bags.’’ Sanusi stressed that measures must be put in place to fight money laundering and corruption to transform the economy. He said that the bank would continue to sensitise the people about the policy and be flexible about the limit. “It can be N150,000 or N300,000. We can talk about the charges, these are not things that are cast in stone, but the important thing is the principle. There will be cash limits and we are going to move transaction away from cash to electronic banking,’’ he said. He assured that there would be regular public discussions and that appropriate measures would be taken before the implementation time. Sanusi said that the policy was one aspect of the programme of mordernising the financial system in the country, adding that the only way to move the nation from cashless economy was to invest in it and make regulation to support it. He said: “this policy will take effect from June 2012; we did not say there is a limit to N150 000, we simply said that if you want to cash more than that, it is just more expensive. “We have looked at the data, throughout last year, less than eight per cent of cash transaction in Nigeria was more than N150, 000.’’ The governor said that it cost the bank about N200 billion to print money, secure, transport, destroy and process it. He noted that the top seven banks in the country spent about N100 billion on cash management annually. “This is a major drain to the economy,’’ he stressed. (NAN http://www.vanguardngr.com/2011/05/cbn-to-test-run-cash-transaction-limit-policy-in-lagos/ |
Nice post. I don't see the value in these almajiri schools, if all they teach you is memorizing the Koran. That isn't a very useful education for today's world. pleep:Good idea in theory. Bad in practice, since we don't have electricity. Provide electricity and then you can create manufacturing jobs. |
zstranger:Heh My activites on NL or reading of the economist in no way inhibit other aspects of my life. And while I'd like to be getting more from my gf, I'm not doing too badly right now |
By Edwin Olofu May 27, 2011 02:19AM The incoming governor of Kano State, Rabiu Musa Kwankwaso, is inheriting a debt portfolio of about N110 billion. This was disclosed by the transition committee constituted by Mr Kwankwaso to look into the books of the outgoing government of Ibrahim Shekarau. Addressing journalists in Kano on Wednesday, the spokesperson of the governor-elect, Jaafar Jaafar, said, based on the documents tendered before the transition committee by the state's accountant general, the outgoing administration incurred liabilities to the tune of N77,418,638,297.02, in addition to a foreign loan of $209,635,334. The state government, according to the committee, spent about N420 billion within eight years without leaving anything on the ground to justify the expenditure. "It gives us concern that despite the N420 billion they squandered, the incoming government will inherit N77 billion liabilities," he said. The spokesperson also noted that there was sharp disparity between the statutory allocation figures tendered before the committee and the one obtained from the Federal Ministry of Finance. Mr Jaafar further revealed that the offices of the head of service and the state accountant general gave conflicting figures of Kano workers' salary bills. "While certain office puts the figure of the workers at 40,000, the other office puts it at 42,000. This is an indication that something is wrong somewhere," he said. Nothing to show The spokesperson noted that despite the fact that the foreign loan was said to be used on healthcare delivery, education, and an independent power plant, among other things, the state was still lagging behind in these areas. He expressed displeasure over the enormous liabilities and foreign loans the outgoing administration of Mr Shekarau would bequeath to the incoming government "When Kwankwaso left office in 2003, he left over N4.3 billion in the state coffers, with which Governor Shekarau awarded the infamous fertiliser contract. Kwankwaso left this amount despite the fact that he received only N76 billion in four years," he said. When contacted, the state commissioner for information, youth and home affairs, Haruna Isa Dederi, said he had handed over to the permanent secretary in the ministry and would not speak on any issue. http://234next.com/csp/cms/sites/Next/News/Metro/Politics/5705247-146/story.csp |
Odunnu:Oh, I was expressing sympathy. . . sorry that you have to deal with that sort of stuff But you have to realize that the vast majority of dudes online aren't getting enough in RL (not that this is an excuse ) |
^-- ![]() |
1 2 3 4 5 6 7 8 ... 368 369 370 371 372 373 374 375 376 (of 485 pages)
) So if M is say N/2, then my algorithm behaves poorly. . . . N^2 complexity.

