Search Results

Search found 1588 results on 64 pages for 'pure'.

Page 50/64 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Why I am getting a Heap Corruption Error?

    - by vaidya.atul
    I am new to C++. I am getting HEAP CORRUPTION ERROR. Any help will be highly appreciated. Below is my code class CEntity { //some member variables CEntity(string section1,string section2); CEntity(); virtual ~CEntity(); //pure virtual function .. virtual CEntity* create()const =0; }; I derive CLine from CEntity as below class CLine:public CEntity { // Again some variables ... // Constructor and destructor CLine(string section1,string section2); CLine(); ~CLine(); CLine* Create() const; } // CLine Implementation CLine::CLine(string section1,string section2):CEntity(section1,section2){}; CLine::CLine(); CLine* CLine::create()const{return new CLine();} I have another class CReader which uses CLine object and populates it in a multimap as below class CReader { public: CReader(); ~CReader(); multimap<int,CEntity*>m_data_vs_entity; }; //CReader Implementation CReader::CReader() { m_data_vs_entity.clear(); }; CReader::~CReader() { multimap<int,CEntity*>::iterator iter; for(iter = m_data_vs_entity.begin();iter!=m_data_vs_entity.end();iter++) { CEntity* current_entity = iter->second; if(current_entity) delete current_entity; } m_data_vs_entity.clear(); } I am reading the data from a file and then populating the CLine Class.The map gets populated in a function of CReader class. Since CEntity has a virtual destructor, I hope the piece of code in CReader's destructor should work. In fact, it does work for small files but I get HEAP CORRUPTION ERROR while working with bigger files. If there is something fundamentally wrong, then, please help me find it, as I have been scratching my head for quit some time now. Thanks in advance and awaiting reply, Regards, Atul

    Read the article

  • jQuery filename manipulation

    - by Adi
    Hi all, I am trying to do a fancy blur/fade effect (which means i need 2 images) but I only want to load 1 in the HTML (in case js is not active) and add the other filename via jQuery (copying and renaming the file/src) The pure html is along the lines of: <div id="work"> <div> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> But the html after jquery has manipulated the DOM needs to be like: <div id="work"> <div> <img src="css/images/abc0.jpg" width="360" height="227" alt="" /> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz0.jpg" width="360" height="227" alt="" /> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> The question is, what is the jQuery to clone/copy the relative images and then rename the src? Any help would be much appreicated. A.

    Read the article

  • User Control SiteMap Provider Rendering Error

    - by Serexx
    I have created a Custom Server Control that renders the SiteMap as a pure UL for CSS styling. At run-time it renders properly but in VS2008 Design View VS shows this error: Error Rendering Control - menuMainAn unhandled exception has occurred. The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection. I have 'AspNetXmlSiteMapProvider' specified in web.config as per here : link text While I am happy that the code runs properly, the Designer error is bothersome if the underlying issue might cause the code to break in some circumstances so I need to understand what is going on... The code explicitly references the sitemap in the Render Method with : int level = 1; string ul = string.Format("<div class='{0}' id='{1}'>{2}</div>", CssClassName, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level)); output.Write(ul); and the recursive method called referrences SiteMap.CurrentNode. Otherwise there are no explicit sitemap references in the code. Does anyone have any ideas why Deisgner is complaining?

    Read the article

  • JSF 2.0: Validate equality of 2 InputSecret Fields (confirm password) without writing Code?

    - by yournamehere
    I'm developing a pure JavaEE6 application with JSF 2.0 and Glassfish. My JSF implementation is Primefaces (beside Mojarra provided by Glassfish). I want to verify if the values of 2 password fields in a JSF form are equal. With Seam, there is the neat component <s:validateEquality for="pw1"/>. I want do to the same without Seam, just using JSF (or maybe a component of a JSF library). Until now i only saw examples which validate the form with a custom validator. But i would like to compare the fields without writing Java code or Javascript code. Is that possible? This what it looks like with Seam: ... <h:inputSecret id="passwort" value="#{personHome.instance.password}" redisplay="true" required="true"> <f:validateLength minimum="8"/> <a:support event="onblur" reRender="passwortField" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... <h:inputSecret id="passwort2" required="true" redisplay="true"> <!-- find the JSF2.0-equivalent to this tag: --> <s:validateEquality for="passwort"/> <a:support event="onblur" reRender="passwort2Field" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... Any help is appreciated. Thanks!

    Read the article

  • Guice, JDBC and managing database connections

    - by pledge
    I'm looking to create a sample project while learning Guice which uses JDBC to read/write to a SQL database. However, after years of using Spring and letting it abstract away connection handling and transactions I'm struggling to work it our conceptually. I'd like to have a service which starts and stops a transaction and calls numerous repositories which reuse the same connection and participate in the same transaction. My questions are: Where do I create my Datasource? How do I give the repositories access to the connection? (ThreadLocal?) Best way to manage the transaction (Creating an Interceptor for an annotation?) The code below shows how I would do this in Spring. The JdbcOperations injected into each repository would have access to the connection associated with the active transaction. I haven't been able to find many tutorials which cover this, beyond ones which show creating interceptors for transactions. I am happy with continuing to use Spring as it is working very well in my projects, but I'd like to know how to do this in pure Guice and JBBC (No JPA/Hibernate/Warp/Reusing Spring) @Service public class MyService implements MyInterface { @Autowired private RepositoryA repositoryA; @Autowired private RepositoryB repositoryB; @Autowired private RepositoryC repositoryC; @Override @Transactional public void doSomeWork() { this.repositoryA.someInsert(); this.repositoryB.someUpdate(); this.repositoryC.someSelect(); } } @Repository public class MyRepositoryA implements RepositoryA { @Autowired private JdbcOperations jdbcOperations; @Override public void someInsert() { //use jdbcOperations to perform an insert } } @Repository public class MyRepositoryB implements RepositoryB { @Autowired private JdbcOperations jdbcOperations; @Override public void someUpdate() { //use jdbcOperations to perform an update } } @Repository public class MyRepositoryC implements RepositoryC { @Autowired private JdbcOperations jdbcOperations; @Override public String someSelect() { //use jdbcOperations to perform a select and use a RowMapper to produce results return "select result"; } }

    Read the article

  • How do I correctly install dulwich to get hg-git working on Windows?

    - by Joshua Flanagan
    I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed. I followed the instructions on http://hg-git.github.com/ to install the extension. The initial easy_install failed because it was unable to compile dulwich without Visual Studio 2003. I installed dulwich manually by: git clone git://git.samba.org/jelmer/dulwich.git cd dulwich c:\Python25\python setup.py --pure install Now when I run easy_install hg-git, it succeeds (since the dulwich dependency is satisfied). In my C:\Users\username\Mercurial.ini, I have: [extensions] hgext.bookmarks = hggit = When I type 'hg' at a command prompt, I see: "* failed to import extension hggit: No module named hggit" Looking under my c:\Python25 folder, the only reference to hggit I see is Lib\site-packages\hg_git-0.2.1-py2.5.egg. Is this supposed to be extracted somewhere, or should it work as-is? Since that failed, I attempted the "more involved" instructions from the hg-git page that suggested cloning git://github.com/schacon/hg-git.git and referencing the path in my Mercurial configuration. I cloned the repo, and changed my extensions file to look like: [extensions] hgext.bookmarks = hggit = c:\code\hg-git\hggit Now when I run hg, I see: * failed to import extension hggit from c:\code\hg-git\hggit: No module named dulwich.errors. Ok, so that tells me that it is finding hggit now, because I can see in hg-git\hggit\git_handler.py that it calls from dulwich.errors import HangupException That makes me think dulwich is not installed correctly, or not in the path. Update: From Python command line: import dulwich yields Import Error: No module named dulwich However, under C:\Python25\Lib\site-packages, I do have a dulwich-0.5.0-py2.5.egg folder which appears to be populated. This was created by the steps mentioned above. Is there an additional step I need to take to make it part of the Python "path"?

    Read the article

  • Drawing Color Spectrum with Waveform

    - by TheDarkIn1978
    i've come across this ActionScript sample, which demonstrates drawing of the color spectrum, one line at a time via a loop, using waveforms. however, the waveform location of each RGB channel create a color spectrum that is missing colors (pure yellow, cyan and magenta) and therefore the spectrum is incomplete. how can i remedy this problem so that the drawn color spectrum will exhibit all colors? // Loop through all of the pixels from '0' to the specified width. for(var i:int = 0; i < nWidth; i++) { // Calculate the color percentage based on the current pixel. nColorPercent = i / nWidth; // Calculate the radians of the angle to use for rotating color values. nRadians = (-360 * nColorPercent) * (Math.PI / 180); // Calculate the RGB channels based on the angle. nR = Math.cos(nRadians) * 127 + 128 << 16; nG = Math.cos(nRadians + 2 * Math.PI / 3) * 127 + 128 << 8; nB = Math.cos(nRadians + 4 * Math.PI / 3) * 127 + 128; // OR the individual color channels together. nColor = nR | nG | nB; }

    Read the article

  • Javascript Detect Control Key Held on Mouseup

    - by Michael Mikowski
    I've searched a good deal, and can't seem to find a satisfactory solution. I hope someone can help. While I am using jQuery, I am also writing many thousands of lines of Javascript. So a "pure" javascript solution is just fine. I'm trying to determine if the control key is physically held down on a mouseup event. That's it; there are no other preconditions. Does anyone know how to do this reliably, cross-browser? I've tried storing this in a state variable by noting when the key is pressed and released: // BEGIN store control key status in hash_state $().bind('keydown','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = true; console.debug( hash_state.sw_ctrldn ); }); $().bind('keyup','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = false; console.debug( hash_state.sw_ctrldn ); }); // END store control key status in hash_state However, this really doesn't work. If you test this using firebug and watch the console, you will see that auto-repeat seems to happen, and the value toggles. I inspected the mouseup event to see if there is anything useful there, but to no avail: var debugEvent = function( arg_obj_e ){ var str = ''; for ( var attr in arg_obj_e ){ str += attr + ': ' + arg_obj_e[attr] + '\n'; } console.debug(str); } Any help would be appreciated.

    Read the article

  • Some general C questions.

    - by b-gen-jack-o-neill
    Hello. I am trying to fully understand the process pro writing code in some language to execution by OS. In my case, the language would be C and the OS would be Windows. So far, I read many different articles, but I am not sure, whether I understand the process right, and I would like to ask you if you know some good articles on some subjects I couldn´t find. So, what I think I know about C (and basically other languages): C compiler itself handles only data types, basic math operations, pointers operations, and work with functions. By work with functions I mean how to pass argument to it, and how to get output from function. During compilation, function call is replaced by passing arguments to stack, and than if function is not inline, its call is replaced by some symbol for linker. Linker than find the function definition, and replace the symbol to jump adress to that function (and of course than jump back to program). If the above is generally true and I get it right, where to final .exe file actually linker saves the functions? After the main() function? And what creates the .exe header? Compiler or Linker? Now, additional capabilities of C, today known as C standart library is set of functions and the declarations of them, that other programmers wrote to extend and simplify use of C language. But these functions like printf() were (or could be?) written in different language, or assembler. And there comes my next question, can be, for example printf() function be written in pure C without use of assembler? I know this is quite big question, but I just mostly want to know, wheather I am right or not. And trust me, I read a lots of articles on the web, and I would not ask you, If I could find these infromation together on one place, in one article. Insted I must piece by piece gather informations, so I am not sure if I am right. Thanks.

    Read the article

  • Extending spring based app

    - by pitr
    I have a spring-based Web Service. I now want to build a sort of plugin for it that extends it with beans. What I have now in web.xml is: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/*-configuration.xml</param-value> </context-param> My core app has main-configuration.xml which declares its beans. My plugin app has plugin-configuration.xml which declares additional beans. Now when I deploy, my build deploys plugin.jar into /WEB-INF/lib/ and copies plugin-configuration.xml into /WEB-INF/classes/ all under main.war. This is all fine (although I think there could be a better solution), but when I develop the plugin, I don't want to have two projects in Eclipse with dependencies. I wish to have main.jar that I include as a library. However, web.xml from main.jar isn't automatically discovered. How can I do this? Bean injection? Bean discovery of some sort? Something else? Note: I expect to have multiple different plugins in production, but development of each of them will be against pure main.jar Thank you.

    Read the article

  • (jQuery) javascript setTimeout clearTimeout

    - by Tillebeck
    Hi I try to make a page to go to the startpage after eg. 10sec of inactivity (user not clicking anywhere). I use jQuery for the rest but the set/clear in my test function are pure javascript. In my frustation I ended up with something like this function that I hoped I could call on any click on the page. The timer starts fine, but is not reset on a click. If the function is called 5 times within the first 10 seconds, then 5 alerts will apear... no clearTimeout... function endAndStartTimer() { window.clearTimeout(timer); var timer; //var millisecBeforeRedirect = 10000; timer = window.setTimeout(function(){alert('Hello!');},10000); } Any one got some lines of code that will do the trick? - on any click stop, reset and start the timer. - When timer hits eg. 10sec do something. BR. Anders

    Read the article

  • Pros & Cons of Google App Engine

    - by Rishi
    Pros & Cons of Google App Engine [An Updated List 21st Aug 09] Help me Compile a List of all the Advantages & Disadvantages of Building an Application on the Google App Engine Pros: 1) No Need to buy Servers or Server Space (no maintenance). 2) Makes solving the problem of scaling much easier. Cons: 1) Locked into Google App Engine ?? 2)Developers have read-only access to the filesystem on App Engine. 3)App Engine can only execute code called from an HTTP request (except for scheduled background tasks). 4)Users may upload arbitrary Python modules, but only if they are pure-Python; C and Pyrex modules are not supported. 5)App Engine limits the maximum rows returned from an entity get to 1000 rows per Datastore call. 6)Java applications may only use a subset (The JRE Class White List) of the classes from the JRE standard edition. 7)Java applications cannot create new threads. Known Issues!! http://code.google.com/p/googleappengine/issues/list Hard limits Apps per developer - 10 Time per request - 30 sec Files per app - 3,000 HTTP response size - 10 MB Datastore item size - 1 MB Application code size - 150 MB Pro or Con? App Engine's infrastructure removes many of the system administration and development challenges of building applications to scale to millions of hits. Google handles deploying code to a cluster, monitoring, failover, and launching application instances as necessary. While other services let users install and configure nearly any *NIX compatible software, App Engine requires developers to use Python or Java as the programming language and a limited set of APIs. Current APIs allow storing and retrieving data from a BigTable non-relational database; making HTTP requests; sending e-mail; manipulating images; and caching. Most existing Web applications can't run on App Engine without modification, because they require a relational database.

    Read the article

  • Data sharing amongst JPA Entities

    - by Nick
    Setup: I have a simple web app that has a handfull of forms, each on a separate page. These forms represent patient data. There is a one-to-one relationship between patient and all these forms/entities. Each form maps directly to a db table and a JPA entity, maybe not the best architecture but it works and is simple. Question: If form/entity A and form/entity B share a common chunk of data (one of more fields), what is the best way to handle that in JPA. I.E. - If the data gets inserted via form A, I need it to show up in form B as existing data and vice versa. In other words its logical for both entities to contain that data. I believe I will have to move the common data into its own entity and define the relationships that way, but I have tried many different ways and none gets me all the way, at least with basic JPA. Can this be done through pure JPA relationships or will I have to write a bunch of code to make this happen manually. Not looking for code specifically, just the correct way to model this data. Thanks.

    Read the article

  • Wrappers/law of demeter seems to be an anti-pattern...

    - by Robert Fraser
    I've been reading up on this "Law of Demeter" thing, and it (and pure "wrapper" classes in general) seem to generally be anti patterns. Consider an implementation class: class Foo { void doSomething() { /* whatever */ } } Now consider two different implementations of another class: class Bar1 { private static Foo _foo = new Foo(); public static Foo getFoo() { return _foo; } } class Bar2 { private static Foo _foo = new Foo(); public static void doSomething() { _foo.doSomething(); } } And the ways to call said methods: callingMethod() { Bar1.getFoo().doSomething(); // Version 1 Bar2.doSomething(); // Version 2 } At first blush, version 1 seems a bit simpler, and follows the "rule of Demeter", hide Foo's implementation, etc, etc. But this ties any changes in Foo to Bar. For example, if a parameter is added to doSomething, then we have: class Foo { void doSomething(int x) { /* whatever */ } } class Bar1 { private static Foo _foo = new Foo(); public static Foo getFoo() { return _foo; } } class Bar2 { private static Foo _foo = new Foo(); public static void doSomething(int x) { _foo.doSomething(x); } } callingMethod() { Bar1.getFoo().doSomething(5); // Version 1 Bar2.doSomething(5); // Version 2 } In both versions, Foo and callingMethod need to be changed, but in Version 2, Bar also needs to be changed. Can someone explain the advantage of having a wrapper/facade (with the exception of adapters or wrapping an external API or exposing an internal one).

    Read the article

  • GWT forced height HTMLPanel

    - by Nils
    Hello, I'm developing a GWT project, and I encountered a problematic cross-browsering problem. When using firefox, there are problems with the display of all the pages. I found the reason why : In UIBinder, each of my pages are wrapped by a "g:HTMLPanel" : at start and at the end of the xml file, to wrap the content of all the pages When doing this, the generated code of the panel goes like this : div style="width: 100%; height: 100%; .... The problem is that "height : 100%". If I remove it with firebug, the display is perfect. So my goal is to programatically remove that generated 100% height.. But no way to do it ! I tried everything : setHeight, setSize, working on the Element itself with getElement().methods()... I tried to do things like style.clear(), everything that could have a chance to work.. But in the generated code that "height: 100%" will ALWAYS be there. If I set it's height to "50%" or "50px" it has no effect at all. I even tried to give it an ID, then with pure javascript to change it's style, but no solution either.. Note : I'm sure that I'm working on the right element : adding a styleName, for example, works well. Any idea ? Your help would be really appreciated, I have no clue of how to remove this bit of generated code, and I've been looking for hours already :(:(:(:( Best regards, Nils

    Read the article

  • Non RBAC User Roles and Permissions System: checking the user's City

    - by micha12
    We are currently designing a User Roles and Permissions System in our web application (ASP.NET), and it seems that we have several cases that do no fit within the classical Role-Based Access Control (RBAC). I will post several questions, each devoted to a particular case, this being the first post. We have the following case: not to allow a user view a certain page if the user lives in a particular city. This is a simple case that is coded in the following way: if (User.City == “Moscow”) // Allow the user to view the page. else // Do not allow the user to view this page. Though this case is very simple and straightforward, it has nothing to do with the RBAC. On StackOverflow, someone called this an Attribute-based Access Control. Under the classical RBAC, it seems that this case should be designed like this: introduce a permission “City where the person lives”, this permission will have a property City. Then create a role, add a permission of type “City = Moscow” to it and the assign the role to the user. Looks extremely cumbersome. The question is whether it is acceptable to introduce such non-RBAC approaches to our permissions system – does that break the design or not? This might seem a primitive question, but we found that most applications use pure RBAC, and we started to think that we might be doing something wrong. Thank you.

    Read the article

  • Bash Templating: How to build configuration files from templates with Bash?

    - by FractalizeR
    Hello. I'm writting a script to automate creating configuration files for Apache and PHP for my own webserver. I don't want to use any GUIs like CPanel or ISPConfig. I have some templates of Apache and PHP configuration files. Bash script needs to read templates, make variable substitution and output parsed templates into some folder. What is the best way to do that? I can think of several ways. Which one is the best or may be there are some better ways to do that? I want to do that in pure Bash (it's easy in PHP for example) 1)http://stackoverflow.com/questions/415677/how-to-repace-variables-in-a-nix-text-file template.txt: the number is ${i} the word is ${word} script.sh: #!/bin/sh #set variables i=1 word="dog" #read in template one line at the time, and replace variables #(more natural (and efficient) way, thanks to Jonathan Leffler) while read line do eval echo "$line" done < "./template.txt" BTW, how do I redirect output to external file here? Do I need to escape something if variables contain, say, quotes? 2) Using cat & sed for replacing each variable with it's value: Given template.txt: The number is ${i} The word is ${word} Command: cat template.txt | sed -e "s/\${i}/1/" | sed -e "s/\${word}/dog/" Seems bad to me because of the need to escape many different symbols and with many variables the line will be tooooo long. Can you think of some other elegant and safe solution?

    Read the article

  • Parsing Lisp S-Expressions with known schema in C#

    - by Drew Noakes
    I'm working with a service that provides data as a Lisp-like S-Expression string. This data is arriving thick and fast, and I want to churn through it as quickly as possible, ideally directly on the byte stream (it's only single-byte characters) without any backtracking. These strings can be quite lengthy and I don't want the GC churn of allocating a string for the whole message. My current implementation uses CoCo/R with a grammar, but it has a few problems. Due to the backtracking, it assigns the whole stream to a string. It's also a bit fiddly for users of my code to change if they have to. I'd rather have a pure C# solution. CoCo/R also does not allow for the reuse of parser/scanner objects, so I have to recreate them for each message. Conceptually the data stream can be thought of as a sequence of S-Expressions: (item 1 apple)(item 2 banana)(item 3 chainsaw) Parsing this sequence would create three objects. The type of each object can be determined by the first value in the list, in the above case "item". The schema/grammar of the incoming stream is well known. Before I start coding I'd like to know if there are libraries out there that do this already. I'm sure I'm not the first person to have this problem.

    Read the article

  • Tinymce Line break problem on Safari and Chrome

    - by knightrider
    Hello all, Does anyone know how to fix the problem about Tinymce Line break problem on Safari and Chrome. For example, Let's say, I have two line pure text. When I copy and paste through firefox or IE. It's under one p tag. So it's same formatting i saw in the text file which is two line. But if i copy and paste through Chrome or Firefox, it becomes two p tag. So at display there,s one space between that two line. I tried to add safari plugin, but nothing happens. And if i put the plugin called paste_auto_cleanup_on_paste : true, it's removing the space, but two line text became one line. Cany anyone help me out by providing solution ? I noticed that at wordpress which is using Tinymce Editor also, doesn't occur that problem, because seems like they are using span instead of p at editor. If that's the solution, how can i change to span instead of p. Thanks for your help and greatly appreciated.

    Read the article

  • Wrapping FUSE from Go

    - by Matt Joiner
    I'm playing around with wrapping FUSE with Go. However I've come stuck with how to deal with struct fuse_operations. I can't seem to expose the operations struct by declaring type Operations C.struct_fuse_operations as the members are lower case, and my pure-Go sources would have to use C-hackery to set the members anyway. My first error in this case is "can't set getattr" in what looks to be the Go equivalent of a default copy constructor. My next attempt is to expose an interface that expects GetAttr, ReadLink etc, and then generate C.struct_fuse_operations and bind the function pointers to closures that call the given interface. This is what I've got (explanation continues after code): package fuse // #include <fuse.h> // #include <stdlib.h> import "C" import ( //"fmt" "os" "unsafe" ) type Operations interface { GetAttr(string, *os.FileInfo) int } func Main(args []string, ops Operations) int { argv := make([]*C.char, len(args) + 1) for i, s := range args { p := C.CString(s) defer C.free(unsafe.Pointer(p)) argv[i] = p } cop := new(C.struct_fuse_operations) cop.getattr = func(*C.char, *C.struct_stat) int {} argc := C.int(len(args)) return int(C.fuse_main_real(argc, &argv[0], cop, C.size_t(unsafe.Sizeof(cop)), nil)) } package main import ( "fmt" "fuse" "os" ) type CpfsOps struct { a int } func (me *CpfsOps) GetAttr(string, *os.FileInfo) int { return -1; } func main() { fmt.Println(os.Args) ops := &CpfsOps{} fmt.Println("fuse main returned", fuse.Main(os.Args, ops)) } This gives the following error: fuse.go:21[fuse.cgo1.go:23]: cannot use func literal (type func(*_Ctype_char, *_Ctype_struct_stat) int) as type *[0]uint8 in assignment I'm not sure what to pass to these members of C.struct_fuse_operations, and I've seen mention in a few places it's not possible to call from C back into Go code. If it is possible, what should I do? How can I provide the "default" values for interface functions that acts as though the corresponding C.struct_fuse_operations member is set to NULL?

    Read the article

  • Can the Flash CS4 [embed] tag be made to export assets to frame 2 rather than frame 1?

    - by Tim Knauf
    We're working on a Flash CS4 project where the main .fla file has ballooned in size and 'Publish' is taking forever. I suspect a large amount of the size (and at least some of the compile time) is due to the quantity of audio symbols in the library. I would love to remove this unnecessary bloat from the .fla file. I've experimented with removing an audio symbol from the library and using the [embed] metadata tag instead, like so: [Embed(source="audio/music/EndOfLevelDitty.mp3")] public var EndOfLevelDitty:Class The resulting published file works perfectly, but there is a problem. Our game uses a preloader on the first frame of the timeline, so all other classes need to be exported in frame 2 (as set in Publish Settings ActionScript 3.0 Settings). So a size report normally begins like this: Frame # Frame Bytes Total Bytes Scene ------- ----------- ----------- ---------------- 1 284515 284515 Scene 1 2 5485305 5769820 (AS 3.0 Classes Export Frame) However, if I use an [embed] tag on a small sound, my size report is now: Frame # Frame Bytes Total Bytes Scene ------- ----------- ----------- ---------------- 1 363320 363320 Scene 1 2 5407240 5770560 (AS 3.0 Classes Export Frame) As you can see, the embedded sound has been exported into frame 1 rather than frame 2. If I were to embed all sounds in this manner, the size of frame 1 would grow to be huge, and users would be looking at a white screen for ages before the preloader frame even loaded. So my question is this: can I use an [embed] tag but have the embedded asset export in frame 2 instead of frame 1? Project constraints: Our team composition means we can't change to pure Flex at this stage. The compiled .swf needs to be 'all in one', so we can't split the preloader into a separate file, and we can't access external resources. Edit: I'd also settle for having the audio in an embedded library SWC, but there seems to be no way to make that embed in frame 2 either; it always ends up in frame 1.

    Read the article

  • Python Twitter library: which one?

    - by Parand
    I realize this is a bit of a lazyweb question, but I wanted to see which python library for Twitter people have had good experiences with. I've used Python Twitter Tools and like its brevity and beauty of interface, but it doesn't seem to be one of the popular ones - it's not even listed on the Twitter Libraries page. There are, however, plenty of others listed: oauth-python-twitter2 by Konpaku Kogasa. Combines python-twitter and oauth-python-twitter to create an evolved OAuth Pokemon. python-twitter by DeWitt Clinton. This library provides a pure Python interface for the Twitter API. python-twyt by Andrew Price. BSD licensed Twitter API interface library and command line client. twitty-twister by Dustin Sallings. A Twisted interface to Twitter. twython by Ryan McGrath. REST and Search library inspired by python-twitter. Tweepy by Josh Roesslein. Supports OAuth, Search API, Streaming API. My requirements are fairly simple: Be able to use OAuth Be able to follow a user Be able to send a direct message Be able to post Streaming API would be nice Twisted one aside (I'm not using twisted in this case), have you used any of the others, and if so, do you recommend them? [Update] FWIW, I ended up going with Python Twitter Tools again. The new version supported OAuth nicely, and it's a very clever API, so I stuck to it.

    Read the article

  • Where can I find a quick reference for standard Basic?

    - by Steve314
    The reason? Pure nostalgia. Anyway, there was a standard for Basic that was published in the late 80s or early 90s. It was probably ISO/IEC 10279:1991, but I don't have access to that and cannot be sure. Whatever this standard was, some of the syntax made its way into Borlands Turbo Basic and Microsofts Visual Basic. I never learned any significant amount of VB, but Turbo Basic is one of those things I played with in my mis-spent youth. At one time, my main reference was an article published in one of the main programming periodicals - maybe Personal Computer World, maybe Byte. A scan of that article (if anyone can even identify it) would be great, but all I really want is a few pages quick reference of that standard syntax. Must be free (I'm not that nostalgic), but it must describe the standard syntax - the whole point is to sort out what is standard as opposed to VB or whatever. EDIT The more I think about this, the more convinced I am that this standard was available around 1987 or 1988. Maybe it was the earlier non-full version of the standard above, or maybe it was pre-acceptance of the standard.

    Read the article

  • How do I cancel the link action?

    - by Tobbe
    I though returning false would be enough to cancel the link action, but apparently it isn't. When I click the link in the code below I do get the 'click' message, which is expected. But I also end up at google.com, which is unexpected. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Link test</title> <script> window.addEventListener('load', function () { document.getElementsByTagName('a')[0].addEventListener('click', function () { alert('click'); return false; }, false); }, false); </script> </head> <body> <a href="http://www.google.com">google</a> </body> </html> How can I make the url NOT change when clicking the link? Pure JavaScript solutions only please, no additional libraries (like jQuery). It only has to work in FireFox 3+ and Chrome.

    Read the article

  • What's the best way to develop a debugging window for an ajax ASP.Net MVC application

    - by KallDrexx
    While developing my ASP.NET MVC, I have started to see the need for a debugging console window to assist in figuring out what is going right and wrong in my code. I read the last few chapters of the Pro Asp.net MVC book, and the author details how to use http modules to show page load/creation times and linq to sql query logs, both of which I definitely want to be able to see. However, since I am loading a lot of small sections of my page individually with ajax I don't want the debug information right there in the middle of my screen. So the idea I came up with was to have a separate browser window (open-able by a link or some javascript) with a console log, that can contain logged entries both from javascript and from the asp.net mvc run. The former should be relatively easy, but I'm having trouble coming up with a way to log the asp.net information in ajax requests. The direction I have been thinking of going is to create an httpmodule (like the Pro MVC book does), and have that module contain some that append the javascript's log to console calls with the messages. The issue I see with this is finding a way to get the log messages from the controller's action methods to the httpmodule's methods. The only way I see to do this is with a singleton, but I'm not sure if singletons are bad practice for a stateless web application. Furthermore, it seems like if I return json with my ajax calls (instead of pure html) then that won't work at all anyways and unless there is a way to add data to an existing json structure inside the httpmodule. How does everyone else handle this type of debugging in heavily ajax applications? For reference, the javascript library I am using is jquery.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >