Search Results

Search found 509 results on 21 pages for 'ar'.

Page 17/21 | < Previous Page | 13 14 15 16 17 18 19 20 21  | Next Page >

  • Twitter Typeahead only shows only 5 results

    - by user3685388
    I'm using the Twitter Typeahead version 0.10.2 autocomplete but I'm only receiving 5 results from my JSON result set. I can have 20 or more results but only 5 are shown. What am I doing wrong? var engine = new Bloodhound({ name: "blackboard-names", prefetch: { url: "../CFC/Login.cfc?method=Search&returnformat=json&term=%QUERY", ajax: { contentType: "json", cache: false } }, remote: { url: "../CFC/Login.cfc?method=Search&returnformat=json&term=%QUERY", ajax: { contentType: "json", cache: false }, }, datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace }); var promise = engine.initialize(); promise .done(function() { console.log("done"); }) .fail(function() { console.log("fail"); }); $("#Impersonate").typeahead({ minLength: 2, highlight: true}, { name: "blackboard-names", displayKey: 'value', source: engine.ttAdapter() }).bind("typeahead:selected", function(obj, datum, name) { console.log(obj, datum, name); alert(datum.id); }); Data: [ { "id": "1", "value": "Adams, Abigail", "tokens": [ "Adams", "A", "Ad", "Ada", "Abigail", "A", "Ab", "Abi" ] }, { "id": "2", "value": "Adams, Alan", "tokens": [ "Adams", "A", "Ad", "Ada", "Alan", "A", "Al", "Ala" ] }, { "id": "3", "value": "Adams, Alison", "tokens": [ "Adams", "A", "Ad", "Ada", "Alison", "A", "Al", "Ali" ] }, { "id": "4", "value": "Adams, Amber", "tokens": [ "Adams", "A", "Ad", "Ada", "Amber", "A", "Am", "Amb" ] }, { "id": "5", "value": "Adams, Amelia", "tokens": [ "Adams", "A", "Ad", "Ada", "Amelia", "A", "Am", "Ame" ] }, { "id": "6", "value": "Adams, Arik", "tokens": [ "Adams", "A", "Ad", "Ada", "Arik", "A", "Ar", "Ari" ] }, { "id": "7", "value": "Adams, Ashele", "tokens": [ "Adams", "A", "Ad", "Ada", "Ashele", "A", "As", "Ash" ] }, { "id": "8", "value": "Adams, Brady", "tokens": [ "Adams", "A", "Ad", "Ada", "Brady", "B", "Br", "Bra" ] }, { "id": "9", "value": "Adams, Brandon", "tokens": [ "Adams", "A", "Ad", "Ada", "Brandon", "B", "Br", "Bra" ] } ]

    Read the article

  • php: showing my country based on my IP, mysql optimized

    - by andufo
    I'm downloaded WIPmania's worldip table from http://www.wipmania.com/en/base/ -- the table has 3 fields and around 79k rows: startip // example: 3363110912 endip // example: 3363112063 country // example: AR (Argentina) So, lets suppose i'm in Argentina and my IP address is: 200.117.248.17 1) I use this function to convert my ip to long function ip_address_to_number($ip) { if(!$ip) { return false; } else { $ip = split('\.',$ip); return($ip[0]*16777216 + $ip[1]*65536 + $ip[2]*256 + $ip[3]); } } 2) I search for the proper country code by matching the long converted ip: $sql = 'SELECT * FROM worldip WHERE '.ip_address_to_number($_SERVER['REMOTE_ADDR']).' BETWEEN startip AND endip'; which is equivalent to: SELECT country FROM worldip WHERE 3363174417 BETWEEN startip AND endip (benchmark: Showing rows 0 - 0 (1 total, Query took 0.2109 sec)) Now comes the real question. What if another bunch of argentinian guys also open the website and they all have these ip addresses: 200.117.248.17 200.117.233.10 200.117.241.88 200.117.159.24 Since i'm caching all the sql queries; instead of matching EACH of the ip queries in the database, would it be better (and right) just to match the 2 first sections of the ip by modifying the function like this? function ip_address_to_number($ip) { if(!$ip) { return false; } else { $ip = split('\.',$ip); return($ip[0]*16777216 + $ip[1]*65536); } } (notice that the 3rd and 4th splitted values of the IP have been removed). That way instead of querying these 4 values: 3363174417 3363170570 3363172696 3363151640 ...all i have to query is: 3363110912 (which is 200.117.0.0 converted to long). Is this right? any other ideas to optimize this process? Thanks!

    Read the article

  • How do I set default search conditions with Searchlogic?

    - by Danger Angell
    I've got a search form on this page: http://staging-checkpointtracker.aptanacloud.com/events If you select a State from the dropdown you get zero results because you didn't select one or more Event Division (checkboxes). What I want is to default the checkboxes to "checked" when the page first loads...to display Events in all Divisions...but I want changes made by the user to be reflected when they filter. Here's the index method in my Events controller: def index @search = Event.search(params[:search]) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @events } end end Here's my search form: <% form_for @search do |f| %> <div> <%= f.label :state_is, "State" %> <%= f.select :state_is, ['AK','AL','AR','AZ','CA','CO','CT','DC','DE','FL','GA','HI','IA','ID','IL','IN','KS','KY','LA','MA','MD','ME','MI','MN','MO','MS','MT','NC','ND','NE','NH','NJ','NM','NV','NY','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VA','VT','WA','WI','WV','WY'], :include_blank => true %> </div> <div> <%= f.check_box :division_like_any, {:name => "search[:division_like_any][]"}, "Sprint", :checked => true %> Sprint (2+ hours)<br/> <%= f.check_box :division_like_any, {:name => "search[:division_like_any][]"}, "Sport" %> Sport (12+ hours)<br/> <%= f.check_box :division_like_any, {:name => "search[:division_like_any][]"}, "Adventure" %> Adventure (18+ hours)<br/> <%= f.check_box :division_like_any, {:name => "search[:division_like_any][]"}, "Expedition" %> Expedition (48+ hours)<br/> </div> <%= f.submit "Find Events" %> <%= link_to 'Clear', '/events' %> <% end %>

    Read the article

  • undefined references

    - by Brandon
    Hello, I'm trying to compile some fortran code and I'm running into some confusing linking errors. I have some code that I compile and place into a static library: >gfortran -c -I../../inc -o bdout.o bdout.F >ar rv libgeo.a bdout.o I then try to compile against that library with some simple test code and get the following: >gfortran -o mytest -L -lgeo mytest.F /tmp/cc4uvcsj.o: In function `MAIN__': mytest.F:(.text+0xb0): undefined reference to `ncwrite1_' collect2: ld returned 1 exit status It's not in the object naming because everything looks fine: >nm -u libgeo.a bdout.o: U _gfortran_exit_i4 U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_character U _gfortran_transfer_integer U ncobjcl_ U ncobjwrp_ U ncopencr_ U ncopenshcr_ U ncopenwr_ U ncwrite1_ U ncwrite2_ U ncwrite3_ U ncwrite4_ U ncwritev_ I can check the original object file too: >nm -u bdout.o U _gfortran_exit_i4 U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_character U _gfortran_transfer_integer U ncobjcl_ U ncobjwrp_ U ncopencr_ U ncopenshcr_ U ncopenwr_ U ncwrite1_ U ncwrite2_ U ncwrite3_ U ncwrite4_ U ncwritev_ The test code simply contains a single call to a function defined in bdout.o: program hello print *,"Hello World!" call ncwrite1( istat, f, ix2, ix3, ix4, ix5, ih ) end program hello I can't figure out what the problem is. Does anyone have any suggestions? Maybe even just a way to track the problem down? Cheers.

    Read the article

  • Compiling C lib and OCaml exe using it, all using ocamlfind

    - by Magnus
    I'm trying to work out how to use ocamlfind to compile a C library and an OCaml executable using that C library. I put together a set of rather silly example files. % cat sillystubs.c #include <stdio.h> #include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/alloc.h> #include <caml/custom.h> value caml_silly_silly( value unit ) { CAMLparam1( unit ); printf( "%s\n", __FILE__ ); CAMLreturn( Val_unit ); } % cat silly.mli external silly : unit -> unit = "silly_silly" % cat foo.ml open Silly open String let _ = print_string "About to call into silly"; silly (); print_string "Called into silly" I believe the following is the way to compile up the library: % ocamlfind ocamlc -c sillystubs.c % ar rc libsillystubs.a sillystubs.o % ocamlfind ocamlc -c silly.mli % ocamlfind ocmalc -a -o silly.cma -ccopt -L${PWD} -cclib -lsillystubs Now I don't seem to be able to use the created library though: % ocamlfind ocamlc -custom -o foo foo.cmo silly.cma /usr/bin/ld: cannot find -lsillystubs collect2: ld returned 1 exit status File "_none_", line 1, characters 0-1: Error: Error while building custom runtime system The OCaml tools are somewhat mysterious to me, so any pointers would be most welcome.

    Read the article

  • Navigation Items in UITableViewController are not appearing?

    - by Sheehan Alam
    I am displaying a UITableViewController inside of a UITabBarController that is being presented modally: -(IBAction)arButtonClicked:(id)sender{ //this is a uitableviewcontroller ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease]; LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease]; lbViewController.title = @"Leaderboard"; arTabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; arTabBarController.viewControllers = [NSArray arrayWithObjects:arViewController, lbViewController, nil]; arTabBarController.selectedViewController = arViewController; [self presentModalViewController:arTabBarController animated:YES]; } In my viewDidLoad for arViewController method I am setting the navigation items: - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line to preserve selection between presentations. self.clearsSelectionOnViewWillAppear = NO; self.title = @"AR"; leaderBoardButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize target:self action:@selector(leaderBoardButtonClicked:)]; self.navigationItem.rightBarButtonItem = leaderBoardButton; } My navigation bar doesn't appear when it is inside of the UITabBarController, but when I push the view itself I am able to see it. What am I missing?

    Read the article

  • Unable to find reference to std library math function inside library

    - by Alex Marshall
    Hello, I've got several programs that use shared libraries. Those shared libraries in turn use various standard C libraries. ie Program A and Program B both use Shared Library S. Shared Library S uses std C math. I want to be able to statically link Shared Library S against the standard library, and then statically link Programs A and B against S so that I don't have to be dragging around the library files, because these programs are going to be running on an embedded system running BusyBox 0.61. However, when I try to statically link the programs against Shared Library S, I get an error message from GCC stating : ../lib/libgainscalecalc.a(gainscalecalc.): In function 'float2gs': [path to my C file].c:73: undefined reference to 'log' Can somebody please help me out ? The make commands I'm using are below : CFLAGS += -Wall -g -W INCFLAGS = -I$(CROSS_INCLUDE)/usr/include LIBFLAGS += -L$(CROSS_LIB)/usr/lib -lm gainscalecalc_static.o: gainscalecalc.c $(CC) $(CFLAGS) -c $< -I. $(INCFLAGS) -o $@ gainscalecalc_dynamic.o: gainscalecalc.c $(CC) $(CFLAGS) -fPIC -c $< -o $@ all: staticlib dynamiclib static_driver dynamic_driver clean: $(RM) *.o *.a *.so *~ driver core $(OBJDIR) static_driver: driver.c staticlib $(CC) $(CFLAGS) -static driver.c $(INCFLAGS) $(LIBFLAGS) -I. -L. -lgainscalecalc -o $@ dynamic_driver: driver.c dynamiclib $(CC) $(CFLAGS) driver.c -o $@ -L. -lgainscalecalc staticlib: gainscalecalc_static.o $(AR) $(ARFLAGS) libgainscalecalc.a gainscalecalc_static.o $(RANLIB) libgainscalecalc.a chmod 777 libgainscalecalc.a dynamiclib: gainscalecalc_dynamic.o $(CC) -shared -o libgainscalecalc.so gainscalecalc_dynamic.o chmod 777 libgainscalecalc.so Edit: Linking against the shared libraries compiles fine, I just haven't tested them out yet

    Read the article

  • compile Boost as static Universal binary lib

    - by Albert
    I want to have a static Universal binary lib of Boost. (Preferable the latest stable version, that is 1.43.0, or newer.) I found many Google hits with similar problems and possible solutions. However, most of them seems outdated. Also none of them really worked. Right now, I am trying sudo ./bjam --toolset=darwin --link=static --threading=multi \ --architecture=combined --address-model=32_64 \ --macosx-version=10.4 --macosx-version-min=10.4 \ install That compiles and install fine. However, the produced binaries seems broken. az@ip245 47 (openlierox) %file /usr/local/lib/libboost_signals.a /usr/local/lib/libboost_signals.a: current ar archive random library az@ip245 49 (openlierox) %lipo -info /usr/local/lib/libboost_signals.a input file /usr/local/lib/libboost_signals.a is not a fat file Non-fat file: /usr/local/lib/libboost_signals.a is architecture: x86_64 az@ip245 48 (openlierox) %otool -hv /usr/local/lib/libboost_signals.a Archive : /usr/local/lib/libboost_signals.a /usr/local/lib/libboost_signals.a(trackable.o): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 1536 SUBSECTIONS_VIA_SYMBOLS /usr/local/lib/libboost_signals.a(connection.o): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 1776 SUBSECTIONS_VIA_SYMBOLS /usr/local/lib/libboost_signals.a(named_slot_map.o): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 1856 SUBSECTIONS_VIA_SYMBOLS /usr/local/lib/libboost_signals.a(signal_base.o): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 1776 SUBSECTIONS_VIA_SYMBOLS /usr/local/lib/libboost_signals.a(slot.o): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 OBJECT 3 1616 SUBSECTIONS_VIA_SYMBOLS Any suggestion how to get that correct?

    Read the article

  • My java.util.Scanner won't work

    - by Kevin Steen Hansen
    Hello Stackoverflow my code is getting this error: Skriv din alder herunder og tryk enter: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:907) at java.util.Scanner.next(Scanner.java:1530) at java.util.Scanner.nextInt(Scanner.java:2160) at java.util.Scanner.nextInt(Scanner.java:2119) at Tasteturindtastning.main(Tasteturindtastning.java:20) [Finished in 1.7s with exit code 1] Adn my code is: // Starter java som man plejer, læs i HejVerden.java public class Tasteturindtastning { public static void main(String[] arg) { /* Jeg skal nu angive en variable, men jeg kan ikke bestemme denne variable * Da jeg ønsker at indtastningen fra dette tastetur skal være variablen. * I stedet for int og double bruger jeg så java.util.Scanner, som aflæser * brugerens indtastninger. */ java.util.Scanner tastetur = new java.util.Scanner(System.in); // Printer en opgave/spørgsmål til brugeren System.out.println("Skriv din alder herunder og tryk enter:"); int alder; // Angiver et variablenavn alder = tastetur.nextInt(); // Angiver variablen med værdien fra indtastningen /* Herunder gør jeg brug af et if statement der tjekker værdien for * variablen alder, og ser om den er lig med eller højere end 18, og hvis * dette er tilfældet, så udprinter den en sætning */ if (alder >= 18) System.out.println("Du er myndig, da du er " + alder + " år gammel"); // Printes hvis han er 18 eller ældre } } Can snyone tell me what is wrong?

    Read the article

  • propositional theorems

    - by gcc
    wang's theorem to prove theorems in propositonal calculus Label Sequent Comment S1: P ? Q, Q ? R, ¬R ? ¬P Initial sequent. S2: ¬P ? Q, ¬Q ? R, ¬R ? ¬P Two applications of R5. S3: ¬P ? Q, ¬Q ? R ? ¬P, R Rl. S4: ¬P, ¬Q ? R ? ¬P, R S4 and S5 are obtained from S3 with R3. Note that S4 is an axiom since P appears on both sides of the sequent ar- row at the top level. S5: Q, ¬Q ? R ? ¬P, R The other sequent generated by the ap- plication of R3. S6: Q, ¬Q ? ¬P, R S6 and S7 are obtained from S5 using R3. S7: Q, R ? ¬P, R This is an axiom. S8: Q ? ¬P, R, Q Obtained from S6 using R1. S8 is an axiom. The original sequent is now proved, since it has successfully been transformed into a set of three axioms with no unproved sequents left over. //R1,R2,R3,R4,R5 is transformation myhomework is so complicate as you can see and i must finish homework in 4 days i just want help ,can you show me how i should construct the algorithm or how i should take and store the input

    Read the article

  • function not working in production mode

    - by maps
    I am using the rvideo gem to transcode files to a .flv format. class Video < ActiveRecord::Base include AASM aasm_column :status aasm_initial_state :initial aasm_state :initial aasm_state :converting, :exit => :transcode aasm_state :transfering , :exit => :send_s3 aasm_state :completed aasm_state :failed aasm_event :convert do transitions :from => [:initial], :to => :converting end aasm_event :transfer do transitions :from => [:converting], :to => :transfering end aasm_event :complete do transitions :from => [:transfering], :to => :completed end aasm_event :error do transitions :from => [:initial, :converting, :transfering, :completed] end has_attached_file :asset, :path => "uploads/:attachment/:id.:basename.:extension" def flash_path return self.asset.path + '.flv' end def flash_name return File::basename(self.asset.path)# + '.flv' end def flash_url return "#{AWS_HOST}/#{AWS_BUCKET}/#{self.flash_name}" end # transcode file def transcode begin RVideo::Transcoder.logger = logger file = RVideo::Inspector.new(:file => self.asset.path) command = "ffmpeg -i $input_file$ -y -s $resolution$ -ar 44100 -b 64k -r 15 -sameq $output_file$" options = { :input_file => "#{RAILS_ROOT}/#{self.asset.path}", :output_file => "#{RAILS_ROOT}/#{self.flash_path}", :resolution => "320x200" } transcoder = RVideo::Transcoder.new transcoder.execute(command, options) rescue RVideo::TranscoderError => e logger.error "Encountered error transcoding #{self.asset.path}" logger.error e.message end end The input file is added to the asset directory, but I never get an outputted file. On the view page aasm hangs on "converting".

    Read the article

  • how to display my list with n amount on each line in Python

    - by user1786698
    im trying to display my list with 7 states on each line here is what i have so far, but it displays as one long string of all the states with quotes around each state. I forgot to mention that this is for my CS class and we havent learned iter yet so we not allowed to use it. the only hint i was given was to to turn STATE_LIST into a string then use '\n' to break it up state = str(STATE_LIST) displaystates = Text(Point(WINDOW_WIDTH/2, WINDOW_HEIGHT/2), state.split('\n')) displaystates.draw(win) and STATE_LIST looks like this STATE_VOTES = { "AL" : 9, # Alabama "AK" : 3, # Alaska "AZ" : 11, # Arizona "AR" : 6, # Arkansas "CA" : 55, # California "CO" : 9, # Colorado "CT" : 7, # Connecticut "DE" : 3, # Delaware "DC" : 3, # Washington DC "FL" : 29, # Florida "GA" : 16, # Georgia "HI" : 4, # Hawaii "ID" : 4, # Idaho "IL" : 20, # Illinois "IN" : 11, # Indiana "IA" : 6, # Iowa "KS" : 6, # Kansas "KY" : 8, # Kentucky "LA" : 8, # Louisiana "ME" : 4, # Maine "MD" : 10, # Maryland "MA" : 11, # Massachusetts "MI" : 16, # Michigan "MN" : 10, # Minnesota "MS" : 6, # Mississippi "MO" : 10, # Missouri "MT" : 3, # Montana "NE" : 5, # Nebraska "NV" : 6, # Nevada "NH" : 4, # New Hampshire "NJ" : 14, # New Jersey "NM" : 5, # New Mexico "NY" : 29, # New York "NC" : 15, # North Carolina "ND" : 3, # North Dakota "OH" : 18, # Ohio "OK" : 7, # Oklahoma "OR" : 7, # Oregon "PA" : 20, # Pennsylvania "RI" : 4, # Rhode Island "SC" : 9, # South Carolina "SD" : 3, # South Dakota "TN" : 11, # Tennessee "TX" : 38, # Texas "UT" : 6, # Utah "VT" : 3, # Vermont "VA" : 13, # Virginia "WA" : 12, # Washington "WV" : 5, # West Virginia "WI" : 10, # Wisconsin "WY" : 3 # Wyoming } STATE_LIST = sorted(list(STATE_VOTES.keys())) I am trying to get it to look somewhat like this

    Read the article

  • Starting an Intent to Launch an app to Background in Android

    - by Tista
    Hi all, I'm using Wikitude API 1.1 as an AR viewer in my application. The problem with Wikitude, if I haven't launched the actual Wikitude application since the phone's bootup, I will get a NullPointerException everytime I start my own application. So I figure if I can start my app first and them check if Wikitude is installed and or running. If it's not installed, go to market n download. If it's not running, then we should run it straight to background so that my app doesn't loose its focus. // Workaround for Wikitude this.WIKITUDE_PACKAGE_NAME = "com.wikitude"; PackageManager pacMan = Poligamy.this.getPackageManager(); try { PackageInfo pacInfo = pacMan.getPackageInfo(this.WIKITUDE_PACKAGE_NAME, pacMan.GET_SERVICES); Log.i("CheckWKTD", "Wikitude is Installed"); ActivityManager aMan = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); List<RunningAppProcessInfo> runningApps = aMan.getRunningAppProcesses(); int numberOfApps = runningApps.size(); for(int i=0; i<numberOfApps; i++) { if(runningApps.get(i).processName.equals(this.WIKITUDE_PACKAGE_NAME)) { this.WIKITUDE_RUNNING = 1; Log.i("CheckWKTD", "Wikitude is Running"); } } if(this.WIKITUDE_RUNNING == 0) { Log.i("CheckWKTD", "Wikitude is NOT Running"); /*final Intent wIntent = new Intent(Intent.ACTION_MAIN, null); wIntent.addCategory(Intent.CATEGORY_LAUNCHER); final ComponentName cn = new ComponentName("com.wikitude", "com.mobilizy.wikitudepremium.initial.Splash"); wIntent.setComponent(cn); wIntent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION); startActivityIfNeeded(wIntent, 0);*/ } } catch (NameNotFoundException e) { // TODO Auto-generated catch block Log.i("CheckWKTD", "Wikitude is NOT Installed"); e.printStackTrace(); //finish(); } The part I block commented is the intent to start Wikitude. But I always failed in restricting Wikitude to background. Any help? Thanks before. Best, Tista

    Read the article

  • CCNet exception during build of vs2010 project

    - by sonee
    We have two build machines. Lately, we've migrated our projects to vs2010 from vs2005. But the problem is that one of the machines occurs error during build. Another machine works well, but just one machine shows error. The differences between the machines are os and computer spec. The machine which is working well is installed windows server 2003 and the other is windows7. the error message is unhandled exception: System.NullReferenceException: Microsoft.VisualStudio.Shell.ThreadHelper.InvokeOnUIThread(InvokableBase invokable) Microsoft.VisualStudio.Shell.ThreadHelper.Invoke(Action action)Microsoft.VisualStudio.Project.VS.Implementation.VSShellServices.InvokeOnUIThread(Action method) Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Action method) Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigBuildJob.BuildCompleted(BuildSubmission ar) Microsoft.VisualStudio.Project.Contracts.Implementation.BuildProjectBase.BuildCompletedCallbackManager.BuildCompleted(BuildSubmission buildSubmission) Microsoft.Build.Execution.BuildSubmission.<CheckForCompletion>b__0(Object state) System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() System.Threading.ThreadPoolWorkQueue.Dispatch() System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Curiously enough, when I run building project in command line on the machine which occurs error, it works well. The machine just shows error when launched by ccnet. I've installed latest version of ccnet to all machines. Is there anybody who faced like this problem?

    Read the article

  • dynamic lib can't find static lib

    - by renyufei
    env: gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) app: Bin(main) calls dynamic lib(testb.so), and testb.so contains a static lib(libtesta.a). file list: main.c test.h a.c b.c then compile as: gcc -o testa.o -c a.c ar -r libtesta.a testa.o gcc -shared -fPIC -o testb.so b.c gcc -o main main.c -L. -ltesta -ldl then compile success, but runs an error: ./main: symbol lookup error: ./testb.so: undefined symbol: print code as follows: test.h #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <dlfcn.h> int printa(const char *msg); int printb(const char *msg); a.c #include "test.h" int printa(const char *msg) { printf("\tin printa\n"); printf("\t%s\n", msg); } b.c #include "test.h" int printb(const char *msg) { printf("in printb\n"); printa("called by printb\n"); printf("%s\n", msg); } main.c #include "test.h" int main(int argc, char **argv) { void *handle; int (*dfn)(const char *); printf("before dlopen\n"); handle = dlopen("./testb.so", RTLD_LOCAL | RTLD_LAZY); printf("after dlopen\n"); if (handle == NULL) { printf("dlopen fail: [%d][%s][%s]\n", \ errno, strerror(errno), dlerror()); exit(EXIT_FAILURE); } printf("before dlsym\n"); dfn = dlsym(handle, "printb"); printf("after dlsym\n"); if (dfn == NULL) { printf("dlsym fail: [%d][%s][%s]\n", \ errno, strerror(errno), dlerror()); exit(EXIT_FAILURE); } printf("before dfn\n"); dfn("printb func\n"); printf("after dfn\n"); exit(EXIT_SUCCESS); }

    Read the article

  • Rails paginate existing array of ActiveRecord results

    - by SaoiseK
    Hello, I generally use will_paginate for the pagination in my app, but have hit a stumbler on my search feature. I'm using Thinking Sphinx for doing my full-text search, which returns results paginated. The problem I'm having is that after I've received the results from Thinking Sphinx, I need to merge them with some other results and re-order them. Once I've finished processing them I have an Array of results that is very different from the original from TS. As there could be 1000+ results in this Array Pagination is a necessity. The problem is that I can't figure out how to get will_paginate to play with an existing array. I've done some research and it seems the only solutions to this problem are from several years ago and are based around the old built-in Paginator class. The most recent one I could find that makes use of will_paginate was from devchix from mid-2007: http://www.devchix.com/2007/07/23/will_paginate-array/comment-page-1/ - I've given this a go but it doesn't seem to do anything for me. Are there any current methods for applying pagination (preferably via will_paginate) for existing arrays of AR results?

    Read the article

  • grailsApplication access in Grails unit Test

    - by Reza
    I am trying to write unit tests for a service which use grailsApplication.config to do some settings. It seems that in my unit tests that service instance could not access the config file (null pointer) for its setting while it could access that setting when I run "run-app". How could I configure the service to access grailsApplication service in my unit tests. class MapCloudMediaServerControllerTests { def grailsApplication @Before public void setUp(){ grailsApplication.config= ''' video{ location="C:\\tmp\\" // or shared filesystem drive for a cluster yamdi{ path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\yamdi" } ffmpeg { fileExtension = "flv" // use flv or mp4 conversionArgs = "-b 600k -r 24 -ar 22050 -ab 96k" path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\ffmpeg" makethumb = "-an -ss 00:00:03 -an -r 2 -vframes 1 -y -f mjpeg" } ffprobe { path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\ffprobe" params="" } flowplayer { version = "3.1.2" } swfobject { version = "" qtfaststart { path= "C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\qtfaststart" } } ''' } @Test void testMpegtoFlvConvertor() { log.info "In test Mpg to Flv Convertor function!" def controller=new MapCloudMediaServerController() assert controller!=null controller.videoService=new VideoService() assert controller.videoService!=null log.info "Is the video service null? ${controller.videoService==null}" controller.videoService.grailsApplication=grailsApplication log.info "Is grailsApplication null? ${controller.videoService.grailsApplication==null}" //Very important part for simulating the HTTP request controller.metaClass.request = new MockMultipartHttpServletRequest() controller.request.contentType="video/mpg" controller.request.content= new File("..\\MapCloudMediaServer\\web-app\\videoclips\\sample3.mpg").getBytes() controller.mpegtoFlvConvertor() byte[] videoOut=IOUtils.toByteArray(controller.response.getOutputStream()) def outputFile=new File("..\\MapCloudMediaServer\\web-app\\videoclips\\testsample3.flv") outputFile.append(videoOut) } }

    Read the article

  • Decompress a GZipped response from the server (Socket)

    - by Lith
    Umm, ok, after sending some data to the server, noting this particular part: "Accept-Encoding: gzip,deflate\r\n" I am getting the following response: HTTP/1.1 200 OK Server: nginx Date: Fri, 09 Apr 2010 23:25:27 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/5.2.8 Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Fri, 09 Apr 2010 23:25:27 GMT Cache-Control: no-store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Pragma: no-cache Content-Encoding: gzip Vary: Accept-Encoding 7aa ??U-?Rh?%?2?w??PM]??7?qZ?K?)???2?&??m???"q??/p9w?????x?[`tA!G???G?5z??????a>k????????Q ???N?? ('??f?,(??Y:5B???-?)?3x^0e:j?`,???**???F>G)?2????@???b??????A?k???Ar?n? But how do I decompress it? Note that I am using the Socket Class to do all the work. I know how to decompress it, but the problem here lies in the fact that I cannot separate the Packet from the GZipped data, psuedo-psuedocode (or whatever) on how I do it: Socket sends packet; Socket reads response from server, stores into a ByteArray; Create MemoryStream, use ByteArray; Create GZipStream, use Memorystream; now the problem occurs; I am getting the following Error: System.IO.InvalidDataException The magic number in GZip header is not correct. Make sure you are passing in a GZip stream. I hope the explanation is clear enough __.

    Read the article

  • How to reference SMF libraries when deploying on phone 7 (Release)

    - by aHaH
    Initially, at Visual Studio, I clicked debug instead of release to deploy my app on phone 7 device. No errors, works perfectly fine! Received multitude of errors that mention that some of the libraries don't seem to exist on the mobile phone. For example, extract from the entire list of errors include Warning 10 The referenced component 'Microsoft.SilverlightMediaFramework.Utilities' could not be found. Warning 3 Could not resolve this reference. Could not locate the assembly "Microsoft.SilverlightMediaFramework.Plugins". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SLARToolKitWinPhoneSample In addition, im also using Slartookit to power up the AR capabilities. Deploying (Release) on the mobile prompts the following errors too. Error 11 The type or namespace name 'SLARToolKit' could not be found (are you missing a using directive or an assembly reference?) What should I do? Will updating the mobile solve this? Do I have to manually install? Or? Thanks

    Read the article

  • How can get unique values from data table using dql?

    - by piemesons
    I am having a table in which there is a column in which various values are stored.i want to retrieve unique values from that table using dql. Doctrine_Query::create() ->select('rec.school') ->from('Records rec') ->where("rec.city='$city' ") ->execute(); Now i want only unique values. Can anybody tell me how to do that... Edit Table Structure: CREATE TABLE IF NOT EXISTS `records` ( `id` int(11) NOT NULL AUTO_INCREMENT, `state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `school` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=16334 ; This is the Query I am using: Doctrine_Query::create() ->select('DISTINCT rec.city') ->from('Records rec') ->where("rec.state = '$state'") // ->getSql(); ->execute(); Generting Sql for this gives me: SELECT DISTINCT r.id AS r__id, r.city AS r__city FROM records r WHERE r.state = 'AR' Now check the sql generated:::: DISTINCT is on 'id' column where as i want Distinct on city column. Anybody know how to fix this. EDIT2 Id is unique cause its an auto incremental value.Ya i have some real duplicates in city column like: Delhi and Delhi. Right.. Now when i am trying to fetch data from it, I am getting Delhi two times. How can i make query like this: select DISTINCT rec.city where state="xyz"; Cause this will give me the proper output. EDIT3: Anybody who can tell me how to figure out this query..???

    Read the article

  • How to provide i18n service for developer and end user

    - by user247245
    Many android applications have quite poor i18n-support, and for an understandable reason, as it adds much work for the developer. From a both intuitive and cultural point of view it would be a good thing if end-users could translate the apps themself, and OTA share the translation, without reinstalling the app itself. In concept; as wikipedia, some add content easily, others only use what's there. It's of course important that the service is as easy as possible to use, both for app-developers, and people willing to transcribe. To keep it simple, this is the solution I'm concidering; Developer perspective: Developer uses a customized setContentView when open activities/layouts that will seach for thanslations of xml-entries. (below) The customized version is provided as a free downloadable library/class..., turning the i18n feature to more or less a one liner. User perspective: User downloads app without any translation As app launches, it checks locale running at phone, and will look for a translated xml-file at shared space in SD. If no or old transcribed xml (above), try to download new from internet-service (ansync). This is all done by library above, no need for intents. Translator perspective: Separate app to provide translations for any app using the i18n service above. (Could be just a webapp), with some form of QA on translators/input. QUESTION: Now, for this to work efficiently, it has to be AeasyAP for the developer to even bother, and the most fluent solution would be a customized version of setContentView, that simply loads the translated values from external xml, instead of the ones in the apk. Is this possible at all, and if not, what's your suggested solutions? (And of course, Happy New Year, feliz ano novo, blwyddyn newydd dda, Gott Nytt År, kontan ane nouvo, szczesliwego nowego roku ...) Regards, /T

    Read the article

  • Can I have the gcc linker create a static libary?

    - by Lucas Meijer
    I have a library consisting of some 300 c++ files. The program that consumes the library does not want to dynamically link to it. (For various reasons, but the best one is that some of the supported platforms do not support dynamic linking) Then I use g++ and ar to create a static library (.a), this file contains all symbols of all those files, including ones that the library doesn't want to export. I suspect linking the consuming program with this library takes an unnecessary long time, as all the .o files inside the .a still need to have their references resolved, and the linker has more symbols to process. When creating a dynamic library (.dylib / .so) you can actually use a linker, which can resolve all intra-lib symbols, and export only those that the library wants to export. The result however can only be "linked" into the consuming program at runtime. I would like to somehow get the benefits of dynamic linking, but use a static library. If my google searches are correct in thinking this is indeed not possible, I would love to understand why this is not possible, as it seems like something that many c and c++ programs could benefit from.

    Read the article

  • Translating 3-dimensional array reference onto 1-dimensional array

    - by user146780
    If there is an array of ar[5000] then how could I find where element [5][5][4] would be if this was a 3 dimensional array? Thanks I'm mapping pixels: imagine a bimap of [768 * 1024 * 4] where would pixel [5][5][4] be? I want to make this: static GLubyte checkImage[checkImageHeight][checkImageWidth][4]; static GLuint texName; bool itt; void makeCheckImage(void) { Bitmap *b = new Bitmap(L"c:/boo.png"); int i, j, c; Color cul; for (i = 0; i < checkImageHeight; i++) { for (j = 0; j < checkImageWidth; j++) { b->GetPixel(j,i,&cul); checkImage[i][j][0] = (GLubyte) cul.GetR(); checkImage[i][j][1] = (GLubyte) cul.GetG(); checkImage[i][j][2] = (GLubyte) cul.GetB(); checkImage[i][j][3] = (GLubyte) cul.GetA(); } } delete(b); } work without making a multidimensional array. width = 512, height = 1024....

    Read the article

  • how to convert video from one format to another using php

    - by Meena
    hi i want to include the vedio download option in my webpage. I am using ffmpeg, but it seems to work very slow. Is there is any other way to do this or how to spead up the ffmpeg. i am using this code to get the frames from the vedio. to convert the vedio $call="ffmpeg -i ".$_SESSION['video_to_convert']." -vcodec libvpx -r 30 -b ".$quality." -acodec libvorbis -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$type." -y 2> log/".$name.".txt"; $convert = (popen("start /b ".$call, "r")); pclose($convert); to get the frame from the vedio exec("ffmpeg -vframes 1 -ss ".$time_in_seconds." -i $converted_vids video_images.jpg -y 2>); but this code does not generate any error its loading continously.

    Read the article

  • Javascript memory leak/ performance issue?

    - by Tom
    I just cannot for the life of me figure out this memory leak in Internet Explorer. insertTags simple takes string str and places each word within start and end tags for HTML (usually anchor tags). transliterate is for arabic numbers, and replaces normal numbers 0-9 with a &#..n; XML identity for their arabic counterparts. fragment = document.createDocumentFragment(); for (i = 0, e = response.verses.length; i < e; i++) { fragment.appendChild((function(){ p = document.createElement('p'); p.setAttribute('lang', (response.unicode) ? 'ar' : 'en'); p.innerHTML = ((response.unicode) ? (response.surah + ':' + (i+1)).transliterate() : response.surah + ':' + (i+1)) + ' ' + insertTags(response.verses[i], '<a href="#" onclick="window.popup(this);return false;" class="match">', '</a>'); try { return p } finally { p = null; } })()); } params[0].appendChild( fragment ); fragment = null; I would love some links other than MSDN and about.com, because neither of them have sufficiently explained to me why my script leaks memory. I am sure this is the problem, because without it everything runs fast (but nothing displays). I've read that doing a lot of DOM manipulations can be dangerous, but the for loops a max of 286 times (# of verses in surah 2, the longest surah in the Qur'an).

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21  | Next Page >