Search Results

Search found 2403 results on 97 pages for 'alex peta'.

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

  • jquery slide to attribute with specific data attribute value

    - by Alex M
    Ok, so I have the following nav with absolute urls: <ul class="nav navbar-nav" id="main-menu"> <li class="first active"><a href="http://example.com/" title="Home">Home</a></li> <li><a href="http://example.com/about.html" title="About">About</a></li> <li><a href="http://example.com/portfolio.html" title="Portfolio">Portfolio</a></li> <li class="last"><a href="example.com/contact.html" title="Contact">Contact</a></li> </ul> and then articles with the following data attributes: <article class="row page" id="about" data-url="http://example.com/about.html"> <div class="one"> </div> <div class="two" </div> </article> and when you click the link in the menu I would like to ignore the fact it is a hyperlink and slide to the current article based on its attribute data-url. I started with what I think is the obvious: $('#main-menu li a').on('click', function(event) { event.preventDefault(); var pageUrl = $(this).attr('href'); )}; and have tried find and animate but then I don't know how to reference the article with data-url="http://example.com/about.html". Any help would be most appreciated. Thanks

    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

  • 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

  • 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

  • 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

  • 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

  • -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

  • Using a nHibernate wrapper with fluent nHibernate

    - by alex
    Is it possible to use something like this wrapper with fluent configuration? http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/ If so, where would I add the fluent config? Also, would this be suited to use in both asp.net and windows applications? I'm planning to use the repository pattern, using this to create my nHibernate session?

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • IPhone Dev: Activate the view of a tabBar button

    - by Alex N Sanchez
    Hi, I have an application that has a tabBar that handles all the views. In the first view I have a login process. When that process finishes I want to go automatically to the second tabBar view without making the user to click in its respective tabBar button. All I've got until now is to highlight the button with this: myTabBar.selectedItem = [myTabBar.items objectAtIndex:1]; But I have no idea about how to bring the second view related to that button to the front, automatically. Until now the user has to press the button when it gets lighted (selected). Any idea about how to do this? Is it possible? It would be much appreciated. Thanks.

    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

  • Problem with autocommit in ANT SQL task

    - by Alex Stamper
    I have an SQL script and want to apply it witn ANT task. This script clears out schema, creates new tables and views. The ANT defined task as follows: <sql driver="com.mysql.jdbc.Driver" url="jdbc:mysql://host:3306/smth" userid="smth" password="smth" expandProperties="false" autocommit="true" src="all.sql" > </sql> When this task launches, it shows in log that tables are cleared and created. But when it tries to create first view, it fails with: Failed to execute: CREATE VIEW component... AS SELECT component_raw.id AS MySQLSyntaxErrorException: Table 'component_raw' doesn't exist I have no idea why it fails here. Running this all.sql from MySQL query browser gives no errors. When I launched ANT with -v option, I didn't see any "COMMIT" messages.. Please, help to resolve the problem.

    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

  • 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

  • ajax response byte size

    - by Alex Pacurar
    Im using jQuery's getJSONP and I want to log the duration of the call and the size of the response to be able to have some statistics about the usage of my application. This is a cross domain ajax call, so I need to use JSONP, but as the JSONP call is not done with an XMLHttpRequest object, the complete callback from jquery's ajax doesnt pass the response content. So my question is how to get the response size (content lenght) from a JSONP call. $.ajaxSetup( { complete:function(x,e) { log(x.responseText.length, x.responseText); } } here x is a XMLHttpRequest object for a JSON call , but for JSONP call is undefined.

    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

  • How exactly is a PHP script executed?

    - by alex
    I was just thinking to myself "How exactly is a PHP script executed?" I thought it was parsed first for syntax errors etc, and then interpreted and executed. However, I don't know why I believe that is correct. I'm probably wrong. So, how exactly is a PHP file interpreted and executed? What stages does this involve? How do included files fit into the parsing of the script? This is just to help me get my head around it. I'm interested and can not find a good answer with Google. Thanks!

    Read the article

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