Search Results

Search found 2396 results on 96 pages for 'alex kloss'.

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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Change image using jQuery

    - by alex
    I have a html-page where used jquery-ui accordion. Now I have to add in this page 2 image which should vary depending on the active section. How can I do it? HTML: <div id="acc"> <h1>Something</h1> <div>Text text text</div> <h1>Something too</h1> <div>Text2 text2 text2</div> </div> <div id="pic"> <img class="change" src="1.png"/> <img class="change" src="2.png"/> </div> JS: $(document).ready(function() { $("#acc").accordion({ change: function(event, ui) { /* I'm think something need here */ } }); });

    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

  • Invalid parameter number: number of bound variables does not match number of tokens

    - by Alex
    I have a table: 'objects' with few columns: object_id:int, object_type:int, object_status:int, object_lati:float, object_long:float My query is : $stmt = $db->query('SELECT o.object_id, o.object_type, o.object_status, o.object_lati, o.object_long FROM objects o WHERE o.object_id = 1'); $res = $stmt->fetch(); Pdo throw error: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens When i remove column object_lati or object_long query is work fine.

    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

  • Chain LINQ IQueryable, and end with Stored Procedure

    - by Alex
    I'm chaining search criteria in my application through IQueryable extension methods, e.g.: public static IQueryable<Fish> AtAge (this IQueryable<Fish> fish, Int32 age) { return fish.Where(f => f.Age == age); } However, I also have a full text search stored procedure: CREATE PROCEDURE [dbo].[Fishes_FullTextSearch] @searchtext nvarchar(4000), @limitcount int AS SELECT Fishes.* FROM Fishes INNER JOIN CONTAINSTABLE(Fishes, *, @searchtext, @limitcount) AS KEY_TBL ON Fishes.Id = KEY_TBL.[KEY] ORDER BY KEY_TBL.[Rank] The stored procedure obviously doesn't return IQueryable, however, is it possible to somehow limit the result set for the stored procedure using IQueryable's? I'm envisioning something like .AtAge(5).AboveWeight(100).Fishes_FulltextSearch("abc"). In this case, the fulltext search should execute on a smaller subset of my Fishes table (narrowed by Age and Weight). Is something like this possible? Sample code?

    Read the article

  • Objective-C member variable assignment?

    - by Alex
    I have an objective-c class with member variables. I am creating getters and setters for each one. Mostly for learning purposes. My setter looks like the following: - (void) setSomething:(NSString *)input { something = input; } However, in C++ and other languages I have worked with in the past, you can reference the member variable by using the this pointer like this->something = input. In objective-c this is known as self. So I was wondering if something like that is possible in objective-c? Something like this: - (void) setSomething:(NSString *)input { [self something] = input; } But that would call the getter for something. So I'm not sure. So my question is: Is there a way I can do assignment utilizing the self pointer? If so, how? Is this good practice or is it evil? Thanks!

    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

  • Modify shell script to monitor/ping multiple ip addresses

    - by Alex
    Alright so I need to constantly monitor multiple routers and computers, to make sure they remain online. I have found a great script here that will notify me via growl(so i can get instant notifications on my phone) if a single ip cannot be pinged. I have been attempting to modify the script to ping multiple addresses, with little luck. I'm having trouble trying to figure out how to ping a down server while the script keeps watching the online servers. any help would be greatly appreciated. I haven't done much shell scripting so this is quite new to me. Thanks #!/bin/sh #Growl my Router alive! #2010 by zionthelion73 [at] gmail . com #use it for free #redistribute or modify but keep these comments #not for commercial purposes iconpath="/path/to/router/icon/file/internet.png" # path must be absolute or in "./path" form but relative to growlnotify position # document icon is used, not document content # Put the IP address of your router here localip=192.168.1.1 clear echo 'Router avaiability notification with Growl' #variable avaiable=false com="################" #comment prefix for logging porpouse while true; do if $avaiable then echo "$com 1) $localip avaiable $com" echo "1" while ping -c 1 -t 2 $localip do sleep 5 done growlnotify -s -I $iconpath -m "$localip is offline" avaiable=false else echo "$com 2) $localip not avaiable $com" #try to ping the router untill it come back and notify it while !(ping -c 1 -t 2 $localip) do echo "$com trying.... $com" sleep 5 done echo "$com found $localip $com" growlnotify -s -I $iconpath -m "$localip is online" avaiable=true fi sleep 5 done

    Read the article

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