Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 47/96 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Does using ReadDirectoryChangesW require administrator rights?

    - by Alex Jenter
    The MSDN says that using ReadDirectoryChangesW implies the calling process having the Backup and Restore priviliges. Does this mean that only process launched under administrator account will work correctly? I've tried the following code, it fails to enable the required privileges when running as a restricted user. void enablePrivileges() { enablePrivilege(SE_BACKUP_NAME); enablePrivilege(SE_RESTORE_NAME); } void enablePrivilege(LPCTSTR name) { HANDLE hToken; DWORD status; if (::OpenProcessToken(::GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) { TOKEN_PRIVILEGES tp = { 1 }; if( ::LookupPrivilegeValue(NULL, name, &tp.Privileges[0].Luid) ) { tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; BOOL result = ::AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL); verify (result != FALSE); status = ::GetLastError(); } ::CloseHandle(hToken); } } Am I doing something wrong? Is there any workaround for using ReadDirectoryChangesW from a non-administrator user account? It seems that the .NET's FileSystemWatcher can do this. Thanks!

    Read the article

  • jquery thickbox not working in 2005 ASP.NET

    - by Alex
    public void DisplayThickBox(Page page, int width, int height) { string script = "<script type='text/javascript'>"; script += "$(document).ready(function(){"; script += "tb.show('null', 'auto-insurance-redirect.aspx?keepThis=true&TB_iframe=true&height=" + height.ToString() + "&amp;width=" + width.ToString() + "',null);"; script += "});"; script +="</script>"; ScriptManager.RegisterStartupScript(page, page.GetType(), "", script, true); } ^^^Method to display the thickbox...^^^ DisplayThickBox(this, 518, 321); ^^^Call to method in the click event of the button that fires it...^^^ Page is just refreshing and the thickbox is never displayed. I'm trying to call the javascript manually since im doing some other stuff before i display the thickbox in the code behind...

    Read the article

  • Use modrewrite to redirect a url with querystring

    - by Alex
    I am trying to redirect an old URL that uses a query string to the new url that does not.. /tripinfo.cfm?RiverNameID=1&AdventureID=6 Now needs to go to /trips/big-ass-river/overnight.html So I am trying.. RewriteRule ^tripinfo.cfm?RiverNameID=1&AdventureID=6$ /trips/big-ass-river/overnight.html [R=301] But this is not working. . I can redirect the main page no problem using RewriteRule ^tripinfo.cfm$ /trips.html [R=301] If any one could tell me what Im missing that would be great.

    Read the article

  • Is it approproate it use django signals withing the same app

    - by Alex Lebedev
    Trying to add email notification to my app in the cleanest way possible. When certain fields of a model change, app should send a notification to a user. Here's my old solution: from django.contrib.auth import User class MyModel(models.Model): user = models.ForeignKey(User) field_a = models.CharField() field_b = models.CharField() def save(self, *args, **kwargs): old = self.__class__.objects.get(pk=self.pk) if self.pk else None super(MyModel, self).save(*args, **kwargs) if old and old.field_b != self.field_b: self.notify("b-changed") # Sevelar more events here # ... def notify(self, event) subj, text = self._prepare_notification(event) send_mail(subj, body, settings.DEFAULT_FROM_EMAIL, [self.user.email], fail_silently=True) This worked fine while I had one or two notification types, but after that just felt wrong to have so much code in my save() method. So, I changed code to signal-based: from django.db.models import signals def remember_old(sender, instance, **kwargs): """pre_save hanlder to save clean copy of original record into `old` attribute """ instance.old = None if instance.pk: try: instance.old = sender.objects.get(pk=instance.pk) except ObjectDoesNotExist: pass def on_mymodel_save(sender, instance, created, **kwargs): old = instance.old if old and old.field_b != instance.field_b: self.notify("b-changed") # Sevelar more events here # ... signals.pre_save.connect(remember_old, sender=MyModel, dispatch_uid="mymodel-remember-old") signals.post_save.connect(on_mymodel_save, sender=MyModel, dispatch_uid="mymodel-on-save") The benefit is that I can separate event handlers into different module, reducing size of models.py and I can enable/disable them individually. The downside is that this solution is more code and signal handlers are separated from model itself and unknowing reader can miss them altogether. So, colleagues, do you think it's worth it?

    Read the article

  • Animating View.scrollTo(...)

    - by alex
    How to implement scrolling animation? I'm ok with setting a simple AlphaAnimation that triggers at scrollTo(...) but what kind of animation is required for one screen to replace another in a sophisticated manner?

    Read the article

  • -moz-linear-gradient with PNG baclground over top

    - by Alex
    So Firefox supports gradient Backgrounds. Also supports multiple Background images.. So why does this not work?? background:-moz-linear-gradient(top, #5989bd,#336296), url(Active-Arrow.png) right center no-repeat; Also tried: background-color:-moz-linear-gradient(top, #5989bd,#336296); background:url(Active-Arrow.png) right center no-repeat; Can this be done??

    Read the article

  • Speed up SQL Server Fulltext Index through Text Duplication of Non-Indexed Columns

    - by Alex
    1) I have the text fields FirstName, LastName, and City. They are fulltext indexed. 2) I also have the FK int fields AuthorId and EditorId, not fulltext indexed. A search on FirstName = 'abc' AND AuthorId = 1 will first search the entire fulltext index for 'abc', and then narrow the resultset for AuthorId = 1. This is bad because it is a huge waste of resources as the fulltext search will be performed on many records that won't be applicable. Unfortunately, to my knowledge, this can't be turned around (narrow by AuthorId first and then fulltext-search the subset that matches) because the FTS process is separate from SQL Server. Now my proposed solution that I seek feedback on: Does it make sense to create another computed column which will be included in the fulltext search which will identify the Author as text (e.g. AUTHORONE). That way I could get rid of the AuthorId restriction, and instead make it part of my fulltext search (a search for 'abc' would be 'abc' and 'AUTHORONE' - all executed as part of the fulltext search). Is this a good idea or not? Why?

    Read the article

  • How to bundle a native library and a JNI library inside a JAR?

    - by Alex B
    The library in question is Tokyo Cabinet. I want is to have the native library, JNI library, and all Java API classes in one JAR file to avoid redistribution headaches. There seems to be an attempt at this at GitHub, but It does not include the actual native library, only JNI library. It doesn't work (for me): when I use this JAR, the JVM does not even seem to find the JNI library which is packaged inside the JAR: java.lang.UnsatisfiedLinkError: no jtokyocabinet in java.library.path (tokyo_cabinet.clj:19)

    Read the article

  • Algorithm to detect how many words typed, also multi sentence support (Java)

    - by Alex Cheng
    Hello all. Problem: I have to design an algorithm, which does the following for me: Say that I have a line (e.g.) alert tcp 192.168.1.1 (caret is currently here) The algorithm should process this line, and return a value of 4. I coded something for it, I know it's sloppy, but it works, partly. private int counter = 0; public void determineRuleActionRegion(String str, int index) { if (str.length() == 0 || str.indexOf(" ") == -1) { triggerSuggestionList(1); return; } //remove duplicate space, spaces in front and back before searching int num = str.trim().replaceAll(" +", " ").indexOf(" ", index); //Check for occurances of spaces, recursively if (num == -1) { //if there is no space //no need to check if it's 0 times it will assign to 1 triggerSuggestionList(counter + 1); counter = 0; return; //set to rule action } else { //there is a space counter++; determineRuleActionRegion(str, num + 1); } } //end of determineactionRegion() So basically I find for the space and determine the region (number of words typed). However, I want it to change upon the user pressing space bar <space character>. How may I go around with the current code? Or better yet, how would one suggest me to do it the correct way? I'm figuring out on BreakIterator for this case... To add to that, I believe my algorithm won't work for multi sentences. How should I address this problem as well. -- The source of String str is acquired from textPane.getText(0, pos + 1);, the JTextPane. Thanks in advance. Do let me know if my question is still not specific enough.

    Read the article

  • Unable to create index because of duplicate that doesn't exist?

    - by Alex Angas
    I'm getting an error running the following Transact-SQL command: CREATE UNIQUE NONCLUSTERED INDEX IX_TopicShortName ON DimMeasureTopic(TopicShortName) The error is: Msg 1505, Level 16, State 1, Line 1 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.DimMeasureTopic' and the index name 'IX_TopicShortName'. The duplicate key value is (). When I run SELECT * FROM sys.indexes WHERE name = 'IX_TopicShortName' or SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DimMeasureTopic]') the IX_TopicShortName index does not display. So there doesn't appear to be a duplicate. I have the same schema in another database and can create the index without issues there. Any ideas why it won't create here?

    Read the article

  • Help with animating an element in jQuery

    - by alex
    I have an unordered list with a few list elements. #tags { width: 300px; height: 300px; position: relative; border: 1px solid red; list-style: none none; } #tags li { position: absolute; background: gray; } I have also started writing a jQuery plugin to animate the list elements. So far, I place the list elements randomly in the parent container, and choose a random font size for the text. My next step (which I am a bit stuck on) is to animate the list elements... essentially, I want the list elements to do something like this Slide from left to right whilst getting slightly larger up to the middle and then dropping in size back to normal when it hits the right border. Then, it should do the same in reverse, however it should also set a negative 'z-index' and maybe fade in opacity a bit. The first bit I'm really stuck on, is how to determine if the element is near the middle, in a way that I can have a value that starts at 0.1 on the far left hand size and is 1 in the middle and then back to 0.1 on the far right hand size. Basically, I want them to appear as if they are going around in a faux 3D circle into the page. Then I could do something like this $(this).css({ fontSize: percentageTowardsMiddle * 14, }); Do you know how I could do this? Thanks

    Read the article

  • What should a PHP generate to give back to a jQuery AJAX request?

    - by Alex Mcp
    Perhaps it's a syntax error, but I never assume that. I have a -dead- simple AJAX test set up: http://www.mcphersonindustries.com/bucket/api.php is a file with simply: <?php echo "test"; ?> And I have Apache as localhost with this jQuery bit running: $(document).ready(function() { function doAjaxPost() { $.ajax({ type: "POST", url: "http://www.mcphersonindustries.com/bucket/api.php", data: "null", success: function(resp){ console.log("Response: '" + resp + "'"); }, error: function(e){ console.log('Error: ' + e); } }); } doAjaxPost(); }); So Firebug spits out Response: '' each time, but nothing's coming through the request. Do I need to declare a header in PHP? Am I making a boneheaded mistake somewhere? Thanks for the insights, as always.

    Read the article

  • Use Objective-C without NSObject?

    - by Alex I
    I am testing some simple Objective-C code on Windows (cygwin, gcc). This code already works in Xcode on Mac. I would like to convert my objects to not subclass NSObject (or anything else, lol). Is this possible, and how? What I have so far: // MyObject.h @interface MyObject - (void)myMethod:(int) param; @end and // MyObject.m #include "MyObject.h" @interface MyObject() { // this line is a syntax error, why? int _field; } @end @implementation MyObject - (id)init { // what goes in here? return self; } - (void)myMethod:(int) param { _field = param; } @end What happens when I try compiling it: gcc -o test MyObject.m -lobjc MyObject.m:4:1: error: expected identifier or ‘(’ before ‘{’ token MyObject.m: In function ‘-[MyObject myMethod:]’: MyObject.m:17:3: error: ‘_field’ undeclared (first use in this function) EDIT My compiler is cygwin's gcc, also has cygwin gcc-objc package: gcc --version gcc (GCC) 4.7.3 I have tried looking for this online and in a couple of Objective-C tutorials, but every example of a class I have found inherits from NSObject. Is it really impossible to write Objective-C without Cocoa or some kind of Cocoa replacement that provides NSObject? (Yes, I know about GNUstep. I would really rather avoid that if possible...)

    Read the article

  • Display real time years, months, weeks and days between 2 days in JavaScript

    - by alex
    This is what I've coded it up, and it appears to work. window.onload = function() { var currentSpan = document.getElementById('current'); var minute = 60000, hour = minute * 60, day = hour * 24, week = day * 7, month = week * 4, year = day * 365; var start = new Date(2009, 6, 1); setInterval(function() { var now = new Date(); var difference = now - start; var years = Math.floor(difference / year), months = Math.floor((difference - (years * year)) / month), weeks = Math.floor((difference - (months * month + years * year)) / week), days = Math.floor((difference - (weeks * week + months * month + years * year)) / day); currentSpan.innerHTML = 'Since has passed: ' + years + ' years, ' + months + ' months, ' + weeks + ' weeks and ' + days + ' days'; }, 500); }; This seems to update my span fine, and all the numbers look correct. However, the code looks quite ugly. Do I really need to set up faux constants like that, and then do all that math to calculate what I want? It's been a while since I've worked with the Date object. Is this the best way to do this?

    Read the article

  • System.Design cannot be referenced in Class Library?

    - by Alex Yeung
    Hi all, I have a very strange problem that I cannot fix and don't know what's going on... I am using VS 2010 Premium and .NET 4.0. Here are my steps to simulate the problem. Step 1. Create a new VB class library project named "MyClassLib" Step 2. Create a new class named "MyTestingClass". Public Class MyTestingClass Inherits System.ComponentModel.Design.CollectionEditor Public Sub New() MyBase.New(GetType(List(Of String))) End Sub End Class Step 3. Add two .net reference. "System.Design" and "System.Drawing". Step 4. Create a new VB console application named "MyClassExe" Step 5. Add "MyClassLib" reference to "MyClassExe". Step 6. Open Module1.vb in "MyClassExe" project Step 7. In the Main method, type Dim a = New MyClassLib.MyTestingClass() Step 8. Try to compile "MyClassLib". It doesn't have problem. Step 9. Try to compile "MyClassExe". It cannot compile because the WHOLE MyClassLib cannot be found!!! I have no idea what's going on? Moreover, the same case happens in C#. Does anyone know what's the problem with "System.Design"? Thank!!!

    Read the article

  • Invert bitmap colors

    - by Alex Orlov
    I have the following problem. I have a charting program, and it's design is black, but the charts (that I get from the server as images) are light (it actually uses only 5 colors: red, green, white, black and gray). To fit with the design inversion does a good job, the only problem is that red and green are inverted also (green - pink, red - green). Is there a way to invert everything except those 2 colors, or a way to repaint those colors after inversion? And how costly are those operations (since I get the chart updates pretty often)? Thanks in advance :) UPDATE I tried replacing colors with setPixel method in a loop for(int x = 0 ;x < chart.getWidth();x++) { for(int y = 0;y < chart.getHeight();y++) { final int replacement = getColorReplacement(chart.getPixel(x, y)); if(replacement != 0) { chart.setPixel(x, y, replacement); } } } Unfortunetely, the method takes too long (~650ms), is there a faster way to do it, and will setPixels() method work faster?

    Read the article

  • nHibernate session - Using repository pattern in Web, windows, wcf etc...

    - by alex
    I recently posted a question which was answered by Bryan Watts, regarding generic repository for nHibernate. I'm trying to design my data access to allow various facets - from ASP.net, WCF and Windows Forms / Windows services. I'm a bit confused re: session management etc.. How would I handle this? I've been checking out code such as: http://membranecms.googlecode.com/svn/ and questions such as: http://stackoverflow.com/questions/1207833/nhibernate-linq-session-management But what do i do if i don't just do things in a web based environment..? Do i need to create different repositories for each client? Or do i pass in the ISession into the (for example) UserRepository constructor..? ... as a side note I'm using nHibernate.Linq Also using fluent nHibernate to config my mapping

    Read the article

  • Qt double click check left button mouse

    - by Alex Ivasyuv
    I need to run slot only on doubleClick with left button mouse, instead of both. connect(this -> myComponent, SIGNAL (doubleClicked (const QModelIndex & )), this, SLOT (performSomeAction(const QModelIndex & ))); With this event, double click works in both cases, but needed only with left button click. How I can do it? this - myComponent = QTableView

    Read the article

  • Slow motion tween text isn't smooth

    - by Alex
    Hi! i have to create a movie where a text string move in horizontal. the problem is that in the movie (800px wide) the text should go from right to left in about 7 seconds (so it have to go about 400px to the left in 7 sec). i created a motion-tween with ease for my "text" and the tween is long (at 30fps) 30*7=210 frames. the result is that the text DON'T MOVE FLUID... it's not a uniform movement... it's too visible the fact that it moves X pixel each x frames. it's the exact opposite of SMOOTH MOVEMENT. How can i obtain a smooth slow-motion text movement?

    Read the article

  • Trouble with using ActiveX control in .net windows application

    - by alex dee
    C#, visual studio 2005 I have several 3rd party activeX control. I need to use them in my .net windows application. These controls are graphical. I created a wrapper with aximp.exe for them. But it seems that something wrong. When I call some methods of wrapped activeX control == targetinvocativeexception occured. Or visual studio writes "you are attempting to write or read protected memory". I know that something wrong. But what is exactly wrong - i don't know. I find out about method CreateControl() or STAthread attribute. but it doesn't help me. What is the common problem and common solution for my type of problem ? These activex control from big and trusted company, other developers work with them.

    Read the article

  • Alternative to sql NOT IN?

    - by Alex
    Hi, I am trying to make a materialized view in Oracle (I am a newbie, btw). For some reason, it doesn't like the presence of sub-query in it. I've been trying to use LEFT OUTER JOIN instead, but it's returning different data set now. Put simply, here's the code I'm trying to modify: SELECT * FROM table1 ros, table2 bal, table3 flx WHERE flx.name = 'XXX' AND flx.value = bal.value AND NVL (ros.ret, 'D') = Nvl (flx.attr16, 'D') AND ros.value = bal.segment3 AND ros.type IN ( 'AL', 'AS', 'PL' ) AND bal.period = 13 AND bal.code NOT IN (SELECT bal1.code FROM table2 bal1 WHERE bal1.value = flx.value AND bal1.segment3 = ros.value AND bal1.flag = bal.flag AND bal1.period = 12 AND bal1.year = bal.year) And here's one of my attempt: SELECT * FROM table1 ros, table2 bal, table3 flx LEFT OUTER JOIN table2 bal1 ON bal.code = bal1.code WHERE bal1.code is null AND bal1.segment3 = ros.value AND bal.segment3 = ros.value AND bal1.flag = bal.flag AND bal1.year = bal.year AND flx.name = 'XXX' AND flx.value = bal.value AND bal1.value = flx.value AND bal1.period_num = 12 AND NVL (ros.type, 'D') = NVL (flx.attr16, 'D') AND ros.value = bal.segment3 AND ros.type IN ( 'AL', 'AS', 'PL' ) AND bal.period = 13; This drives me nuts! Thanks in advance for the help :)

    Read the article

  • How to delete multiple files with msbuild/web deployment project?

    - by Alex
    I have an odd issue with how msbuild is behaving with a VS2008 Web Deployment Project and would like to know why it seems to randomly misbehave. I need to remove a number of files from a deployment folder that should only exist in my development environment. The files have been generated by the web application during dev/testing and are not included in my Visual Studio project/solution. The configuration I am using is as follows: <!-- Partial extract from Microsoft Visual Studio 2008 Web Deployment Project --> <ItemGroup> <DeleteAfterBuild Include="$(OutputPath)data\errors\*.xml" /> <!-- Folder 1: 36 files --> <DeleteAfterBuild Include="$(OutputPath)data\logos\*.*" /> <!-- Folder 2: 2 files --> <DeleteAfterBuild Include="$(OutputPath)banners\*.*" /> <!-- Folder 3: 1 file --> </ItemGroup> <Target Name="AfterBuild"> <Message Text="------ AfterBuild process starting ------" Importance="high" /> <Delete Files="@(DeleteAfterBuild)"> <Output TaskParameter="DeletedFiles" PropertyName="deleted" /> </Delete> <Message Text="DELETED FILES: $(deleted)" Importance="high" /> <Message Text="------ AfterBuild process complete ------" Importance="high" /> </Target> The problem I have is that when I do a build/rebuild of the Web Deployment Project it "sometimes" removes all the files but other times it will not remove anything! Or it will remove only one or two of the three folders in the DeleteAfterBuild item group. There seems to be no consistency in when the build process decides to remove the files or not. When I've edited the configuration to include only Folder 1 (for example), it removes all the files correctly. Then adding Folder 2 and 3, it starts removing all the files as I want. Then, seeming at random times, I'll rebuild the project and it won't remove any of the files! I have tried moving these items to the ExcludeFromBuild item group (which is probably where it should be) but it gives me the same unpredictable result. Has anyone experienced this? Am I doing something wrong? Why does this happen?

    Read the article

  • How to catch mousewheel up/down event using RaphaelJs

    - by alex.dominte
    I need to implement a horizontal scrollable timeline. I've drawn the timeline/grids/rulers etc. I just need to catch mousewheel up/down to scroll the timeline (backward - past/forward - future). First I need to catch the event: but nothing I've found seems to work. Need browser support only for chrome/firefox (latest versions). These 2 won't listeners won't work: var paper = new Raphael('raphael-paper'); // ... paper.canvas.on('mousewheel', function(event) { console.log(event); }); // ... paper.canvas.addEventListener('mousewheel', function(event) { console.log(event); });

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >