Daily Archives

Articles indexed Saturday May 8 2010

Page 21/78 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • basename() returning int?

    - by EB
    Probably something stupid I'm missing but, why am I getting this warning? static void foo(char *path) { char *bname; char *path2 = strdup(path); bname = basename(path2); (line with basename() call): warning: assignment makes pointer from integer without a cast Indeed, if I change to this, the warning goes away: bname = (char *)basename(path2); man 3 basename tells me: char *basename(char *path); Both dirname() and basename() return pointers to null-terminated strings. What gives?

    Read the article

  • htaccess subdomain redirct with last url parameter

    - by Pankaj
    I want to write a .htaccess file for redirecting my subdomains and URL's last variable to a new location. Here is what I want to do: http(s)://abc.example.com/books I want my internal URL to be like: http://example.com/?name=abc&type=books I have already gotten the subdomain redirect to work but I am not able to do subdomain with variable in last part of URL. How can I accomplish this?

    Read the article

  • Need help in reading callgrind output

    - by n179911
    Hi, I have run callgrind with my application like this "valgrind --tool=callgrind MyApplication" and then call 'callgrind_annotate --auto=yes ./callgrind.out.2489' I see output like 768,097,560 PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 18,624,794 /build/buildd/eglibc-2.11.1/elf/dl-lookup.c:do_lookup_x [/lib/ld-2.11.1.so] 18,149,492 /src/js/src/jsgc.cpp:JS_CallTracer'2 [/src/firefox-debug-objdir/js/src/libmozjs.so] 16,328,897 /src/layout/style/nsCSSDataBlock.cpp:nsCSSExpandedDataBlock::DoAssertInitialState() [/src/firefox-debug-objdir/toolkit/library/libxul.so] 13,376,634 /build/buildd/eglibc-2.11.1/nptl/pthread_getspecific.c:pthread_getspecific [/lib/libpthread-2.11.1.so] 13,005,623 /build/buildd/eglibc-2.11.1/malloc/malloc.c:_int_malloc [/lib/libc-2.11.1.so] 10,404,453 ???:0x0000000000009190 [/usr/lib/libpangocairo-1.0.so.0.2800.0] 10,358,646 /src/xpcom/io/nsFastLoadFile.cpp:NS_AccumulateFastLoadChecksum(unsigned int*, unsigned char const*, unsigned int, int) [/src/firefox-debug-objdir/toolkit/library/libxul.so] 8,543,634 /src/js/src/jsscan.cpp:js_GetToken [/src/firefox-debug-objdir/js/src/libmozjs.so] 7,451,273 /src/xpcom/typelib/xpt/src/xpt_arena.c:XPT_ArenaMalloc [/src/firefox-debug-objdir/toolkit/library/libxul.so] 7,335,131 ???:g_type_check_instance_is_a [/usr/lib/libgobject-2.0.so.0.2400.0] I have a few questions: What does the number on the right mean? Does it mean it spend accumulative that long in calling the function on the right? How can I tell how many times that function has been called and Does that include the time spend in calling the functions called by that function? What does line with ??? mean? e.g. ???:0x0000000000009190 [/usr/lib/libpangocairo-1.0.so.0.2800.0] Thank you.

    Read the article

  • Latex: stretchable curly braces outside math

    - by basweber
    Hi, I am producing some latex beamer slides (but I think it is not a beamer specific question per se). I have the following: \begin{itemize} \item Issue1 \item Issue2 \item Issue3 \end{itemize} Now, I want to have a right curly brace (i.e. '}') behind the items spreading over issue1 and issue2. And of course I want to write something behind that curly brace. In a perfect world I would write something like: \begin{itemize} \left . \item Issue1 \item Issue2 \right \} One and Two are cool \item Issue3 \end{itemize} This does not work because I am not in a math environment and I can not put the whole snippet inside a math environment because itemize would not work in that case. Is there a clean solution or a hack to produce my desired result? Regards, Bastian.

    Read the article

  • SOW, SLA, TOS....am i missing anything else ?

    - by fwfwfw
    when doing long term sale of service or software, what type of legal contracts need to be drafted ? i'm not a lawyer, and was looking for a general template on statement of work, service level agreements and terms of services. how are java enterprise applications requiring server side logic, delivered by the vendor to the client ? do they deliver the actual hardware server with everything installed ? java apps can be decompiled and source code exposed, what type of legal paper would you need to draft to protect your asset and Intellectual property ?

    Read the article

  • What is the best JSOS?

    - by JamesM
    What is the best JSOS (Javascript Operating System)? Here are some.. /* Remove the "x_" for the link, was needed so I can post this.. */ x_http://fractalbrain.net/ /* Best.. */ x_http://cometdesktop.com/ /* alright */ x_http://skylightproject.com/ /* Wrost */

    Read the article

  • Secondary keys in a B-tree

    - by Phenom
    Let's say that there is a file that contains an unsorted list of student information, which includes a student ID number as well as other information. I want to make a program that retrieves student information based on student ID number. In order to make it efficient, I store the student IDs in a B-tree. So when I enter a student ID number, it searches the B-tree to see if its there or not. It also does one more thing. If it finds the student ID number, then it also returns where in the file that student's information is. This is the secondary key. The program uses this information to locate the rest of the student's information and prints it to screen. Can this be done? Is this how a b-tree works?

    Read the article

  • Wordpress page grouping

    - by Ragnar
    Is there any way to group/folder my pages in Wordpress. Pages as in pages, not posts. In case I'm using it as a CMS and have, say, 200 pages. 10 main pages and the rest are all sub-pages. It'd be really inconvenient to see all the pages as a one huge lists. I know I could use posts and categories, as I won't be needing the blog functionality anyway, and even if I did need it, I could make it work anyway. Thing is, I'd lose a bit functionality this way and it's unfortunately not an option for me. I have looked around and Googled but so far with no results. I'm sure I'm not the only one who has come to wonder about that.

    Read the article

  • Types of Nested Loops in JAVA

    - by dominoos
    Hi guys. I have a simple question. I have to find out many nested loops as possible in java. I have something like for loop and if statement inside. i know that we can do like if{if{if{if{ something like that too. just need some more idea of more types of nested loops. if you can write down some examples. I'll be very glad. thank you. public class Test { public static void main (String []args) { int i = 0; for(int j = 1; j <= 5; j++) { if(j == 1 || j == 5) { i = 4; } else { i = 1; } for(int x = 0; x < i; x++) { System.out.print("**"); } System.out.println(); } } }

    Read the article

  • J: Self-reference in bubble sort tacit implementation

    - by Yasir Arsanukaev
    Hello people! Since I'm beginner in J I've decided to solve a simple task using this language, in particular implementing the bubblesort algorithm. I know it's not idiomatically to solve such kind of problem in functional languages, because it's naturally solved using array element transposition in imperative languages like C, rather than constructing modified list in declarative languages. However this is the code I've written: (((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#)) ^: # Let's apply it to an array: (((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#)) ^: # 5 3 8 7 2 2 3 5 7 8 The thing that confuses me is $: referring to the statement within the outermost parentheses. Help says that: $: denotes the longest verb that contains it. The other book (~ 300 KiB) says: 3+4 7 5*20 100 Symbols like + and * for plus and times in the above phrases are called verbs and represent functions. You may have more than one verb in a J phrase, in which case it is constructed like a sentence in simple English by reading from left to right, that is 4+6%2 means 4 added to whatever follows, namely 6 divided by 2. Let's rewrite my code snippet omitting outermost ()s: ((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#) ^: # 5 3 8 7 2 2 3 5 7 8 Reuslts are the same. I couldn't explain myself why this works, why only ((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#) is treated as the longest verb for $: but not the whole expression ((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#) ^: # and not just (<./@(2&{.)), $:@((>./@(2&{.)),2&}.), because if ((<./@(2&{.)), $:@((>./@(2&{.)),2&}.)) ^: (1<#) is a verb, it should also form another verb after conjunction with #, i. e. one might treat the whole sentence (first snippet) as a verb. Probably there's some limit for the verb length limited by one conjunction. Look at the following code (from here): factorial =: (* factorial@<:) ^: (1&<) factorial 4 24 factorial within expression refers to the whole function, i. e. (* factorial@<:) ^: (1&<). Following this example I've used a function name instead of $:: bubblesort =: (((<./@(2&{.)), bubblesort@((>./@(2&{.)),2&}.)) ^: (1<#)) ^: # bubblesort 5 3 8 7 2 2 3 5 7 8 I expected bubblesort to refer to the whole function, but it doesn't seem true for me since the result is correct. Also I'd like to see other implementations if you have ones, even slightly refactored. Thanks.

    Read the article

  • System.Web.HttpException in asp.net mvc 2 on images and javascript files

    - by Rippo
    Hi I am getting the following errors reported by ELMAH on my asp.net mvc 2 site for javascript files, images etc. System.Web.HttpException: The remote host closed the connection I have done some research and it appears that the user/bot is clicking a link on the site before the page has fully loaded. Now this error never occurs on a controller action but always on a file that is on disk. e.g. /Content/CmsImages/logo.png /Content/CmsImages/MemberImages/Photo-001605.jpg /Content/jquery.tickertype.js So this means that all static files are being routed through the mvc pipeline. What options do I have?

    Read the article

  • Ideal PHP Session Size?

    - by Jason
    Hi, I have a PHP form (mortgage app) that is about 400 fields, traffic on the site will be low. What is the ideal Session size for 400 fields going into a MySQL db? In PHP.ini what do I set? Anything I should set that I am missing? -Jason

    Read the article

  • Testing movie with Flash IDE fails to load file from localhost

    - by davgothic
    Hi, I'm just wondering if anybody can help me with my simple but frustrating problem. I have created an SWF that loads an XML file from http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml, but I get this error when running the movie using Test Movie in the Flash IDE. Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml at Main/loadConfig()[D:\www\webroot\flash\Projects\MEL\Quiz\Quiz\src\Main.as:126] at Main/configLoadError()[D:\www\webroot\flash\Projects\MEL\Quiz\Quiz\src\Main.as:143] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() The error I get if I handle the exception is: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml"] Trouble is running the SWF in a browser locally does work, it only throws these errors in the Flash IDE. I have tried a adding wildcard crossdomain.xml file in my root web directory and setting the SWF publish properties for local playback security to Allow network only, but neither of these have solved my problem. I know Windows 7 handles localhost name resolution differently compared to previous versions of Windows but I have even added 127.0.0.1 localhost to my hosts file to no avail. Can anyone shed any light on this issue?

    Read the article

  • Subdomain forwarding using .htaccess

    - by RJ
    I want to redirect a praticular subdomain to the main domain http(s)://dl.example.com/par1/par2 to http(s)://www.example.com/par1/par2 How to achieve the above using .htaccess Why i want to do this: Whenever any user download a file from my server, if the file is huge , then user cannot do any other operation until the file is downloaded completely...so the solution that i have thought is to forward the download request through subdomain so that the browser may continue with rest of the operation. Thanks

    Read the article

  • How to achieve an eagerly loaded, filtered child collection with the NHibernate criteria API

    - by vakman
    Is it possible to use the criteria api to load a set of parent objects along with a filtered, eagerly loaded set of child objects? I'm trying to query a list of categories and at the same time load the categories products that start with the letter M. The query below gives me the results I want but the Products are not eagerly loaded, that is NHibernate performs additional queries when I enumerate the Product collection: var categoriesWithProducts = session.CreateCriteria<Category>() .SetFetchMode("Products", FetchMode.Eager) .CreateCriteria("Products") .Add(Expression.Like("Name", "M%")) .List<Category>(); What am I missing here?

    Read the article

  • has any simply way to delete a value in list of python

    - by zjm1126
    a=[1,2,3,4] b=a.index(6) del a[b] print a it show error: Traceback (most recent call last): File "D:\zjm_code\a.py", line 6, in <module> b=a.index(6) ValueError: list.index(x): x not in list so i have to do this : a=[1,2,3,4] try: b=a.index(6) del a[b] except: pass print a but this is not simple,has any simply way ? thanks

    Read the article

  • i m trying to return list<object> from webmethod but gives error

    - by girish
    System.InvalidOperationException: There was an error generating the XML document. --- System.InvalidOperationException: The type WebService.Property.Property_Users was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write8_ArrayOfAnyType(Object o) at Microsoft.Xml.Serialization.GeneratedAssembly.ListOfObjectSerializer.Serialize(Object objectToSerialize, XmlSerializationWriter writer) at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o) at System.Web.Services.Protocols.XmlReturnWriter.Write(HttpResponse response, Stream outputStream, Object returnValue) at System.Web.Services.Protocols.HttpServerProtocol.WriteReturns(Object[] returnValues, Stream outputStream) at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[] returnValues) at System.Web.Services.Protocols.WebServiceHandler.Invoke() public List<object> GetDataByModuleName(string ModuleName) { List<Property_Users> obj_UserList = new List<Property_Users>(); // performing some operation that add data to obj_UserList List < Object > myList = new List<object>(); return ConvertToObjectList<Property_Users>(obj_UserList); } public List<Object> ConvertToObjectList<N>(List<N> sourceList) { List<Object> result = new List<Object>(); foreach (N item in sourceList) { result.Add(item as Object); } return result; } [WebMethod] public List<object> GetDataByModuleName(string ModuleName) { List<object> obj_list = new List<object>(); obj_list = BAL_GeneralService.GetDataByModuleName(ModuleName); return obj_list; }

    Read the article

  • ListView created programmatically - emptyView doesn't show

    - by Yorick
    I've created custom ListView programmatically, and set view to show when ListAdapter is empty but nothing shows on the screen in that case, what can be wrong? public PlayerList(Context context, Activity activity) { super(context); mParent = activity; setOnItemClickListener( new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ... } }; List<PlayerInfo> players; players = getPlayerList(); // here size of players == 0 setAdapter(new PlayersAdapter(this.getContext(), R.id.player_name, players)); LayoutInflater vi = (LayoutInflater)mParent.getSystemService(Context.LAYOUT_INFLATER_SERVICE); emptyView = vi.inflate(R.layout.empty_view, null); // emptyView is View, and member of PlayerList this.setEmptyView(emptyView); }

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >