Jump to content
Xtreme .Net Talk

Varghjärta

Avatar/Signature
  • Posts

    27
  • Joined

  • Last visited

Varghjärta's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Maybe you are right. But then again, the whole point of me using subselects is to kind of do a query that is automatically used in another query (all in _one_ query), so that I won't have to _manually_ via coding (whatever programming language) actually do one query and then another one and insert the previous result (somehow it feels more dirty and hack'ish). I'm afraid I don't have any code since there is none, i'm doing all of this directly against the database so to test if it is even possible before I embark on designing the actual application -- I tend to do this, experiment and see what can be done if it is a territory I'm not _very_ comfortable in. So as to avoid future problems. This is driving me crazy since it _should_ all be so easy, I want to associate rows in a table with rows in another table. The thing is, I will have two tables (for example): _______________________________________ ## items #id(int) | path(string) | tags(string) 0|"item1"|"o,2," 1|"item2"|"1,2," ## tags #id(int) | name(string) 0|tag1 1|tag2 2|AnotherTag _______________________________________ In this example I wanted to associate tag1 with item1, and tag2 with item2. And "AnotherTag" with both all of the items. What I will get from user input (via a GUI), is the name of the tag(string). So if I want to fetch all items associated with the tag "AnotherTag", it would be sweet if I could make the query work having only knowledge of the Tag name, and not already knowing it's _actual inner id_. Is this overkill, and is there an easier more elegant way of making association in this fashion?. I imagine the most _elegant_ approach would be to have a third table where I would store all the associations. BUT, it feels as though that could add to the complexity and it would be nice if I could make due with as little fuss as possible, namley somehow using The already existing and fast pattern matching ('%' for instance) to match against the content in the "tags" field of the items. Thank you! P.S. The more elegant approach of a third table would increse the size of the db too. There will be well over (minimum) of 300 000 items. The size of the db(my test-server so to speak) is at present about 20Mb. Having double that or tripple the amount of rows in a third table due to each tag association with each item, feels as if it might become something overwhelming, and not necessary if using SubSelects the way I want to would work :( .
  2. Hey, I'm having problems using LIKE when using a SELECT within the main SELECT. items.tags might contains something to the effect of "1,2,3,". The subquery returns one result in form of id which will be a number. To make my main select work I would idealy insert a wildcard before and after the injection from subquery so that the actual injection beomes "%1,%". Would make things real easy. But I can't get it working. How would I form such a query so that it actually works lol ? Any help appreciated, having googled for an hour i'm no smarter. Thanks. # Psuedo code SELECT items.path FROM items WHERE items.tags LIKE "%" + (SELECT tags.id FROM tags WHERE tags.name='one') + ",%"
  3. Thank you! :) This application thing I need is ment for a friend, yes truly; a friend. Whom I just now got to install .net 2 runtime. The problem I forsee at the moment though might be that it is not enabled in her XP. And she is using XP Home and appearently MS have hidden alot of things. Not even running: "%SystemRoot%\system32\secpol.msc /s" directly works. Any programatic way of enabling it? Thanks in advance!
  4. Hi!. Does anyone know how one would go about monitoring or fetching info in some system log about login attempts that has failed. The application would be running, where upon the user would "lock" Windows. And I need to be able to keep track of login attempts. For instance if someone were to try and log on to my computer i'd later be able to see the time and such for the event. Is this possible somehow? EDIT: On Windows XP systems.
  5. Well, I stole the php blowfish from: http://pear.php.net/package/Crypt_Blowfish And in c# I used "XCrypt" from : http://www.codeproject.com/csharp/XCrypt.asp Now, it has come to my attention that it's no guarantee that different implementations of blowfish will be cross-compatible. But then, I need to find one that _is_ for php+c# *sigh This kind of feels impossible, now if only I had c# support on my webhost I could have used the same dll.
  6. Hey peeps! Alright my problem is as follows, for whatever reason I may have (a clever one trust me :) ) I _need_ to be able to open up binary files(or text, but binary should be faster so i'm going with that) containing encrypted text in Unicode. My problem is more specifically that in my recent try runs I've been unable to encrypt a file from C# and then via PHP decrypt it. The stuff I get back from php is just mumbojumbo (same key has been used). I've attempted this with the Blowfish algorithm, one that I found to .net and one which I found to PHP. NOW, correct me if i'm wrong but shouldn't the 'same' algorithm be able to open whatever data made by any software as long as it's _that_ algorithm.. is not Blowfish == Blowfish?? Any ideas? I would also appreaciate any pointers to other algorithms that _should_ work and exists to both c# and php, but I'd prefer to use the ones I have counted on for many years. Which is mainly Blowfish, Twofish & Rijndael (in that order) and I count them as very strong and safe. Thanks in advance!
  7. This is a large concern for me as well, and have made me gone over to c++ many a times. But for all you are rewarded using .net (the ease of development etc etc) comes with that price, that you gotta have the .net runtime installed to use the application. There's no way around that I know of. One can only hope that Windows will ship with the runtime preinstalled in the near future so that soon everyone will have it, which I think is MS's idea. But until that time you gotta get it some other way. I'm not sure about the possibility to embed the runtime with ones program but do you really want your application to be 23+mb? But perhaps somehow it's possible to embed only those libraries one uses and thus lessen the size needed. Pehaps... I doubt it though!. But I wish it was possible as I seldom use very many "system.*" classes as I make my own collections etc etc to suite the application in question.
  8. Sounds like what I wanted to for an application long time ago. I could never find any ready made code for it (though there probably is something, dealing with formating in some class). Can't you do a loop that inserts a comma into the string at appropiorate places WHILE we're not at the end of the string. And it might be easier code-wise to reverse the string before doing it so one loops form beginning to end so that the commas ends up in the right places(so we don't need to know anything about the number to still insert into the right place), then reverse it again so it's back to normal. Well atleast that's what you could do if you want to have them in groups of three(say: "1284"->"1,284", "1284999"->"1,284,999" etc). If that's something you need lemme know and I'll try to find the code snippet of mine.
  9. Umm.. You mean right click on the icon in systray and be presented with a context menu?.. Simply assosiate a context menu with the tray thingy whatever it's called, then that menu will show with right clicking in the tray.
  10. Sure. If it was just the encryption part your asking about: http://www.codeproject.com/csharp/XCrypt.asp And download the sample/source. But perhaps you were asking about the encryption of data in your specific situation. But then again, I can't think of a reason why it would differ. Encrypting traffic that would be sent over a network/internet simply entails putting a wee bit of encryption on the transmitting end just before the data is sent and decryption in the reciving end decrypting the data before the data is delt with as usual(by the application, whatever it is supposed to do). No changes should really be needed other than adding that little layer. I might be missing something though, but I can't think of what in that case.
  11. Depends on what kind of data yer sending and how paranoid you are ;).. I would encrypt it... but then again, I encrypt everything. I implement encryption into my applications weather or not it's necessary or not. Those black vans outside my house won't get my recipes for apple pie no siree bob!
  12. Have you solved the problem yet btw?.. -- been a while since I've been here. PS.. Why don't you just create your _own_ version of a control-array or whatever it's called. Make a class with a hashtable in it to wrap and hold references to all controls of a partiqular type. Make methods to edit the controls like setText("MyTxtBox","new text") and have it change the text in the textbox that is references/stored in the hashtable -- via key of textbox's name. Hashtable's are insanly fast, and if you for each textboxadded to the control add it to the hashtable -- by means of listening for added controls, start listening _before_ all the textboxes is added -- you won't even have to manually add them.. which if I'm not incorrect was the whole point?.. since your gonna have so many of them.. That's what I think i'd do..... if you have already cracked it then feel free to ignore this :).
  13. I only speak C# unfortunatly :). But what I guess you need to do is provide a way of hosting a control in a SubItem. I've nver done such personally, but I know there's articles on the subject over at CodeProject(.com), I know there's C# code there atleast. But if you need it badly perhaps you could try and port it. Or use the control as a dll and load it into your VB project. I myself will be needing somethign simular in the near future, but I want a progressbar, and my first stop will be to search over there for clever ideas.
  14. You could listen for every control added to the form and then add it's reference to a hashtable. Then simply ((TextBox)hashTable["textbox1"]).Text = "bla bla bla"; Computers are pretty fast, I can't belive there should be an een noticible performance hit even if you had over 1000 textboxes. And Hashtable itself is _extremly_ fast.
×
×
  • Create New...