Posts

Showing posts from September, 2010

javascript - jQuery dialog box and fancy box conflict -

i using fancybox in same page have used jquery dialog box $(document).ready(function () { jquery.noconflict(); $(".fancybox").fancybox( $("#productquickview").css("display","") ); $("#fbclose").click(function () { $.fancybox.close(); }); }); but unable use dialog box <script src="../javascript/jquery-1.8.0.min.js"></script> <script src="../javascript/jquery.fancybox.js"></script>

ibeacon - Android Altbeacon Library BeaconSimulator on release version of application -

i want ask if there way use beaconsimulator simulate ibeacon on release version of application. displaying content based on ibeacon user sees , want show information application , example user needs turn on bluetooth etc. i want have kind of ibeacon visible (also when bt turned of) instruct user. there way achieve ? thanks regards juraj the android beacon library 's beaconsimulator automatically disabled release builds of applications. intended safety check, keep accidentally releasing code simulator active if forget disable in code. this safety check based on applicationinfo.flag_debuggable, automatically gets set false gradle when doing release build. if want allow simulator run in release build, can try setting debuggable flag true release builds in build.gradle file this: android { ... buildtypes { release { debuggable true } }

javascript - Split the string using regex -

this question has answer here: how remove <br /> tags , more string? 6 answers i have innertext <div contenteditable="true"> hi</br> multiple line</br> code </div> i want make single line , instead of take space , split comma.. tried stextbox.split(/[\s,]+/); include new line please suggest me solve problem updated expected output : hi multipleline code .. have calculate stextboxsplit[stextboxsplit.length - 1] , gives stextboxsplit = ["hi", "this", "is", "multiple","line","code" ""], , in give "" last index last index code . want work in c# mvc.. you can use following regex : >([^<]*?)< demo this regex use negated character classes match thing between > , < except < .

retrieving data from list in c# -

i trying retrieve data list of data. each element has following structure (not actual code): class pathpatternstringswithddv { list<string> pathpatternstring; list<point> ddv_xy; string fromstate; } i need compare first element of pathpatternstring , last element of ddv_xy , using following line of code: (list<pathpatternddxy_withprobability>) rtnlist = allpathpatternddxy_withprob.where(a => a.pathpatternstring[0] == ptrn && a.fromstate == fstate && a.ddv_xy[a.ddv_xy.count - 1].x == _x && a.ddv_xy[a.ddv_xy.count - 1].y == _y this gets me error ("delegate not take 1 element"). ideas? change line to: ienumerable<pathpatternddxy_withprobability> rtnlist = allpathpatternddxy_withprob.where(a => a.pathp

javascript - how to signup user using google-plus integradation in web? -

hi i'm trying integrate google plus in web application. have added google-plus button using link page instructed.when click on button open window access user accept or cancel. how use object user login application? function signincallback(authresult) { if (authresult['status']['signed_in']) { // update app reflect signed in user // hide sign-in button user authorized, example: document.getelementbyid('signinbutton').setattribute(); } else { // update app reflect signed out user // possible error values: // "user_signed_out" - user signed-out // "access_denied" - user denied access app // "immediate_failed" - not automatically log in user console.log('sign-in state: ' + authresult['error']); } }

ios - Sending message to Singleton Object -

i have singleton class perform web service operations. suppose have created method -(void)getprofileswithname:(nsstring *)profilename profile information. using block objects response web service operations class. since web service operations singleton many objects can send same [self getprofileswithname:@"john"] messages @ time. in scenario first object makes web service request not receive data . what proper way perform web service operations using singleton class ? can use nsoperationqueue ? nsoperationqueue 1 possibility. queue.addoperationwithblock(_ block: () -> void) method adds new block. think without queue. not set block instance variable, use directly in success method or block.

excel - Option Explicit - Not sure how to dim this -

i have existing macro use format columns. i've been using without problems. now, i'm looking learn how use option explicit , running problem defining variable. what should dim'ing level as? tried dim level string didn't work. i'm trying better understanding feedback appreciated. option explicit sub adviseformat() dim form worksheet set form = sheets("formatting") form level = worksheetfunction.match("level", .rows("1:1"), 0) .columns(level).delete .columns("d:e").delete .range("u:u").value = range("e:e").value .columns("e").entirecolumn.delete .columns("f:i").delete .columns("i").delete .columns("l").delete .columns("m").delete form.range("a:b").entirecolumn.insert form.range("a1").value = "owner" form.range("b1").value = "comment" form.range("a1").interior.color = 65535 form.rang

How can i select date older than today in mysql database -

i have following code outputs past 30 days entries phpmyadmin sql database. work , shows past 30 days entries, displays today's date entries, don't want. there way, past 30 days entries, excluding today's date? hers's code ("select * products date between date_sub(now(), interval 30 day) , now()") try following query:- select * products date between date_sub(now(), interval 30 day) , date_sub(now(), interval 1 day)

java - Sync jboss modules and jbossdatahome between devs -

we're using local jboss 7 instances ( maven jboss plugin ) custom modules local development. each dev can work on multiple projects. each project, each dev needs have proper jboss modules , jbossdatahome folder. each dev needs same path these folders, hard coded in maven pom (maven-jboss-plugin config). i hate setup , administation chore (when changing projects) comes it. how can conveniantly sync modules , jboss config & jbossdatahome between dev's each project? my initial thought put in svn folder of each project, modules contain jars (and jboss instance rather big), guess big. i'd kind of portable maven config. haven't found solution.. anyone suggestions? you can use jboss cli script configuration of jboss instance. you'll need make sure have jar files available somewhere though. if create file, e.g. module-add.cli following in it: module add --name=org.mysql --resources=mysql-connector-java-5.1.18-bin.jar --dependencies=javax.api,

unix - C - does read() add a '\0'? -

does have to? i've been fuzzy on sort of stuff, if have like: char buf[256]; read(fd, buf, 256); write(fd2, buf, 256); is there potential error here, other cases functions return -1? if read 40 characters, put \0 after it? (and write recognize \0 , stop? also, if read 256 characters, there \0 after 256? does read() add '\0'? no, doesn't. reads. from read() 's documentation : the read() function shall attempt read nbyte bytes file associated open file descriptor, fildes, buffer pointed buf. is there potential error here, other cases functions return -1? read() might return 0 indicating end-of-file. if reading (also socket descriptor) read() not reads bytes told do. in context not test outcome of read against -1 , compare against number of bytes function told read. a general note: functions documented (at least proper implementations of c language). both assumptions (autonomously set 0-termination, detect latter)

sql - Find where row value is inside a list -

companylist companylist = new companylist(); companylist.matchcompanies(); companylistobject[] companylistobject = companylist.companylist; list<double> companylist = new list<double>(); foreach (var company123 in companylistobject) { if (company123.parentcompany == companyid) { companylist.add(company123.companyid); } } ienumerable<racallratesmatched> items = db.racallratesmatched.where(row => row.accountcode == companyiddouble); i want pull results row value present in list. list contains company ids. it's quite short list, 3-5 elements long. rather checking if row equal 1 of list values. can check if equal more of them? bear in mind can't use || statements in fixed context list size vary. example compare list[0] || list[1] || list[2] fixed , i'll exception if long. i can't make multiple calls database because each call view takes long time build. can in 1 call? use .any() e.g. mycompanylist.any(

java - Canvas.drawBitmap() and freeing up memory -

i have listview , items in list custom view s. view class has field private bitmap bitmap; and ondraw method of view uses canvas.drawbitmap(bitmap, matrix, paint); the trouble geting outofmemoryerror s. want free memory associated bitmap when item scrolls off screen. thought write bitmap = null allow garbage collector take bitmap , worried canvas.drawbitmap might mean doesn't work. canvas.drawbitmap hold onto reference bitmap ? or call canvas.drawbitmap mean canvas object has memory bitmap ? trouble don't understand canvas is, , various draw calls do. thank help. if you're displaying large amounts of bitmap data in app, you're run outofmemoryerror errors. recycle() method allows app reclaim memory possible. however if call recycle() , later attempt draw bitmap, error: "canvas: trying use recycled bitmap". but need extensive reading of the android's site training on managing bitmap memory have different strateg

The meaning of [$@var-name] use in mysql ExtractValue() function -

@xml= '<a><b>x</b><b>y</b></a>'; set @i=1,@j=2; select extractvalue(@xml,'//b[$@i]'); i know meaning of $@ use in function. $@ stands user variable. see mysql documentation: user variables (weak checking) first of in posted code @xml= 'xy'; not valid xml. to explain, //b[$@i] xpath query. in $@i kind of variable interpolation. example documentation, set @xml = '<a><b>x</b><b>y</b></a>'; set @i =1; then doing select extractvalue(@xml, '//b[$@i]'); returns x sine says select first ([1] index) tag element b . here, '//b[$@i]' nothing saying '//b[1]'

python - how to normalize array numpy? -

i have norm 1 numpy array. looking equivalent version of function def normalize(v): norm=np.linalg.norm(v) if norm==0: return v return v/norm is there in skearn or numpy? function works in situation v 0 vector. if you're using scikit-learn can use sklearn.preprocessing.normalize : import numpy np sklearn.preprocessing import normalize x = np.random.rand(1000)*10 norm1 = x / np.linalg.norm(x) norm2 = normalize(x[:,np.newaxis], axis=0).ravel() print np.all(norm1 == norm2) # true

storyboard - Segue must be modal with page navigation -

i'm developing app apple watch there scene table. when select row pushes scene perfectly. when added scene , created relationship of next scene first 1 rows stopped working.i had change transition push modal , worked again. question is: right behaviour? or bug? or missing something? page-based navigation , hierarchical navigation exclusive – can't mix , match unless present new interface modally. expected behaviour.

ruby on rails - Render partial collection with association -

i trying render partials collection of @entries shared view. in 1 controller, doing directly render @entries in view. <%= render(:partial => '/shared/entry', :collection => @entries) %> on controller, doing through bookmarks. result, collection @bookmarks.entries <%= render(:partial => '/shared/entry', :collection => @bookmarks.entries) %> here /shared/_entry.html.erb : <div> <%= link_to_unless_current entry.tag_list, tag_path(entry.tag_list) %> </div> i following error bookmark controller, other controller works fine: undefined method `tag_list' #<bookmark:0x007fad659b32b8> it looks happens because thought collection @bookmarks.entries, still recognizing bookmark , not entry. if change view following, works on bookmark, fails on other controller: <div> <%= link_to_unless_current entry.entry.tag_list, tag_path(entry.entry.tag_list) %> </div> how can make bookm

javascript - Redirect in Plupload -

wonder if can advise please - using plupload , need redirect different page add information database. i can upload file perfectly, cannot seem redirect. ive tried putting in code "uploadcomplete" , in different test "fileuploaded" using firebug put in breaks script , both sections stopped @ at start, when file finished doesnt touch either of them. therefore thought id put upload.php file in chunks section (as per google result suggested). // check if file has been uploaded if (!$chunks || $chunk == $chunks - 1) { // strip temp .part suffix off rename("{$filepath}.part", $filepath); $mypi = $projid; header("location: addimg.php?file=" . $filename . "&blid=" . $mypi); die(); } in debugging went through , hit redirect , die following, then went start of "if (!chunks etc)" , run through again, never redirected. what missing please! im pulling out hair make work. thanks in advance javascript: var up

oracle - ORA-00933: SQL command not properly ended : When I try to execute INSERT -

i have procedure, inside of it, tried execute "insert", sending error can give me hint solve error? tried read oracle documentation figure out i'm wrong, far have not found can me. create or replace procedure read_file begin declare v1 varchar2(200); f1 utl_file.file_type; emptylines number(10):=0; read_lines number(10):=0; alarm_counter number(10):=0; begin --deschidere fisier f1 := utl_file.fopen('oncioiu','text.txt','r'); --itinerare fiecare linie din fisierul text loop begin utl_file.get_line(f1,v1); read_lines := read_lines+1; dbms_output.put_line(v1); -- determine number of empty rows if v1 null emptylines :=emptylines+1; end if; -- determine number of alarms if emptylines =2 alarm_counter :=alarm_counter+1; end if; insert alarms (id) values(alarm_counter) exception when no_data_found

Why does this JavaScript regex crash in the browser? -

to knowledge [ab] , (a|b) should equivalent in purpose when trying match against set of characters. now, @ 2 regex: /^(\s|\u00a0)+|(\s|\u00a0)+$/g /^[\s\u00a0]+|[\s\u00a0]+$/g they should both match against whitespaces @ beginning , end of string (see section on polyfill here more info on regex itself). when using square brackets things work well, when switch parenthesis simplest of strings causes browser run seemingly indefinitely. happens on latest chrome , firefox. this jsfiddle demonstrates this: a ="a                                                               b"; // doesn't work // alert(a.replace(/^(\s|\u00a0)+|(\s|\u00a0)+$/g,'')); // works alert(a.replace(/^[\s\u00a0]+|[\s\u00a0]+$/g,'')); is crazy quirk browser's implementation of regex engine or there else regex's algorithm causes this? the problem seeing called catastrophic backtracking, explained here . first of all, let me simplify , clarify test case:

scala - SBT PublishM2 do not refresh snapshot jar in local maven repo -

i have simple sbt project name := "xxxx" organization := "xxxxx" version := "0.0.2-snapshot" scalaversion := "2.11.6" resolvers += "spray repo" @ "http://repo.spray.io" scalacoptions in thisbuild ++= seq("-language:postfixops", "-feature") librarydependencies ++= seq("io.spray" %% "spray-client" % "1.3.3", "io.spray" %% "spray-json" % "1.3.2", "com.typesafe.akka" %% "akka-actor" % "2.3.11", "org.dspace" % "dspace-api" % "1.8.2", "org.scalatest" %% "scalatest" % "2.2.4" % "test") when publishlocal, snapshot updated in ivy, when publishm2 not work. check source jar in .m2 folder , never updated. have delete manually folder of artifact in local .m2 folder, publication again. is there way have sbt replace j

c++ - Custom streambuffer in std::ofstream -

i know in std::ostream , can use custom streambuf through either stating in constructor: std::ofstream temp; temp.open("file.txt", std::ios_base::in); std::ostream example(temp.rdbuf()); as setting afterwards (same first 2 lines before, change last line to: std::ostream example; example.rdbuf(temp.rdbuf()); my question is: how can in std::ofstream ? want able overwrite methods xsgetn , xsputn implemented in std::streambuf in own custom class , use in ofstream , but, short of writing own custom ofstream unsure of how so. the concrete file stream classes have own rdbuf() method takes 0 arguments , hides other rdbuf() method inherited virtual base std::basic_ios . qualifying name lookup base class method should work: std::ofstream ofs; ofs.basic_ios<char>::rdbuf(example.rdbuf());

ruby on rails - Save multiple same named fields to database record -

i'm trying save multiple fields same name database record this have now: <%= form_for @complaint, url: {action: 'create'}, :html => {:multipart => true} |f| %> <%= f.label :complaint_info, 'describa lo que sucedió' %> <%= f.cktext_area :complaint_info, :class => 'someclass', :ckeditor => {:language => 'us', :toolbar => 'mini'}, tabindex: '-1' %> <%= f.fields_for :witnesses |witnesses_form| %> <%= witnesses_form.label :name, '¿hay testigos?' %> <%= witnesses_form.text_field :name, placeholder: 'escriba el nombre del testigo', tabindex: '-1' %> <%= witnesses_form.label :phone, 'número de teléfono del testigo' %> <%= witnesses_form.text_field :phone, placeholder: 'escriba el número de teléfono' %> <%= witnesses_form.label :name, '¿hay testigos?' %> <%=

gcc - Converting old C code -

i have code snippet in project source code work on void func(void **p,size_t s) { *p = malloc(s+sizeof(size_t)); *(((size_t *)(*p))++) = s; } and gcc-4.7 not compile it. gcc returns lvalue required increment operand error message. changed into stp = ((size_t *)(*p)); *(stp ++) = s; and stp = ((size_t *)(*p)); *stp = *stp + 1; *stp = s; gcc compiles both of them. application not work expected. conversion true? , there tool conversion? the idea seems to allocate amount of memory ( s ) and additional amount store size allocated in same area leading block , return pointer behind stored size. so try this: void func(void ** p, size_t s) { size_t * sp = malloc(s + sizeof s); if (null != sp) { *sp = s; ++sp; } *p = sp; } btw, freeing allocated memory, not straight forward. a typicall sequence of calls, freeing function returns, then: void * pv = null; func(&pv, 42); if (null != pv) { /* use 42 bytes of memory pointed

Provide Twilio TwiML in HTTP payload? -

to make outbound call twilio, need provide url twiml information. know if possible provide said twiml part of request no twiml url required? allow more more dynamic requests without having worry providing pre-defined twiml urls twilio evangelist here. there no way send twiml part of post twilio api, have provide url twilio request once outbound call answered. you can provide single url dynamically generates twiml response based on parameters twilio sends part of http request . hope helps.

c++ - limited value in a File output -

i have program returns execution time , output of each run diplayed in file in same row . #include <iostream> #include <fstream> #include <math> #include <boost> using namespace std; int main() { std::ofstream file("myfile.txt",std::ios_base::app); v2 = rand() % 100 + 1; // burn time std::cout << v2 ; // burn time boost::chrono::duration<double> sec = boost::chrono::system_clock::now() - start; file<<sec.count() << ";"; file.close(); return 0 ; } after 4 run here output in file : 0.0190567;4.92035;11.0541;13.1457; i after 30 runs 30'th result must displayed in newline . without added functions or loops affect duration of runtime .i think there other way format output file via awk sed . you can use awk. awk '{ gsub(/([0-9]+(.[0-9]*)?;){30}/, "&\n"); print }' myfile.txt this should insert \n after each 30th ;

python - Stuck scraping a specific table with scrapy -

so table i'm trying scrape can found here: http://www.betdistrict.com/tipsters i'm after table titled 'june stats'. here's spider: from __future__ import division decimal import * import scrapy import urlparse ttscrape.items import ttscrapeitem class betdistrictspider(scrapy.spider): name = "betdistrict" allowed_domains = ["betdistrict.com"] start_urls = ["http://www.betdistrict.com/tipsters"] def parse(self, response): sel in response.xpath('//table[1]/tr'): item = ttscrapeitem() name = sel.xpath('td[@class="tipst"]/a/text()').extract()[0] url = sel.xpath('td[@class="tipst"]/a/@href').extract()[0] tipster = '<a href="' + url + '" target="_blank" rel="nofollow">' + name + '</a>' item['tipster'] = tipster won = sel.xpath('td[2]/text()').extract()[0

r - how to convert a vector of characters to quantitative data -

i have vector following data: data<-c('ab','ab','ab','cd','cd','cd','ef','ef') how can convert data using r gets transformed following pattern: ab=1 cd=2 ef=3 so vector converted to: data=[1,1,1,2,2,2,3,3] another option match match(data, unique(data)) #[1] 1 1 1 2 2 2 3 3 or in place of unique(data) , can specify vector of elements match. match(data, c('ab', 'cd', 'ef'))

Simple DOM Google Plus -

i'm using simple html dom parse various websites. working fine except when try parse through google plus page. attempted below troubleshoot , isn't working. when echo out page works fine below shows blank page. thought i'd have logged in google plus after it's still blank page. ideas on why can't load page? google forbids , locks? interesting thing page title loads favicon nothing elsel. here's example of code have. help! $url_link = "https://plus.google.com/+pollotropical/about"; $html = new simple_html_dom(); $html->load_file($url_link); echo $html;

error while sendin http PUt to creat a new page in xwiki with REST api -

i want send page xwiki $ curl -u admin:admin -x put --data-binary "@newpage.xml" -h "content-type: application/xml" http://localhost:8082/xwiki/rest/wikis/xwiki/spaces/main/pages/newpage my xml page that: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <page xmlns="http://www.xwiki.org"> <title>hello world</title> <syntax>xwiki/2.0</syntax> <content>this new page</content></page> but commands return huge code error ,anyone knows thye reason why , information sending content work without problem error: org.restlet.ext.jaxrs.internal.exceptions.convertrepresentationexception: not convert message body org.xwiki.rest.model.jaxb.page @ org.restlet.ext.jaxrs.internal.exceptions.convertrepresentationexcept ion.object(convertrepresentationexception.java:58)at org.restlet.ext.jaxrs.internal.wrappers.params.entitygetter.getvalue(entityget

php - Laravel throwing error on foreach() loop on POST -

Image
i have survey application built laravel. when users creating answers questions, enter them in corresponding textboxes (added dynamically jquery). have create.blade.php code in partial follows: {!! form::open(['url' => 'surveys']) !!} @foreach( $questions $question ) <h2>{{$question->text}}</h2> <div id="input_fields_wrap_{{ $question->id }}"> <div class="form-group"> {{--{!! form::label('answer', 'answers:') !!}--}} <div class="input-group"> {!! form::text('answers[]', null, ['class' => 'form-control']) !!} <span class="input-group-btn"><button class="btn btn-default btn-danger remove_field" type="button">remove</button></span> </div> </div> </div&

Get properties from another class (matlab) -

is possbile properties class in matlab? i have 2 classes: projecttable and allprojecttables . in projecttable have tried following: properties (getaccess = ?allprojecttables) but doesn't work. here working example: classdef projecttable properties (getaccess = ?allprojecttables) value end methods function obj = projecttable(val) obj.value = val; end function r = addtwo(obj) r = obj.value + 2; end end end classdef allprojecttables properties project_table end methods function obj = allprojecttables(project_table) obj.project_table = project_table; end function r = test(obj) r = obj.project_table.value; end end end and test: >> a=projecttable(45) = projecttable no properties. >> a.value cannot 'value' property of projecttable. >> b=allprojecttables(a)

Remove all elements before x from an array php -

if give you: $array = array(object1, object2, object3, object4); and say, @ position 2, remove elements before position end result is: $array = array(object3, object4); what do? looking @ array_shift , array_splice achieve wanted - how ever not sure use or how use them achieve desired affect. use array_slice. more detail check link http://php.net/manual/en/function.array-slice.php $array = array(object1, object2, object3, object4); $array = array_slice($array,2); // 2 position

c# - System.UnauthorizedAccessException occurs under Admin privileges with full access to folder -

i'm out of ideas on fixing "access denied" issue on windows 8.1... i'm building console app in visual studio under administrative mode , app trying following: using system.io; namespace commandcenterscriptlauncher { class program { static void main(string[] args) { try { console.writeline("the argument passed " + args[0] + "."); console.readline(); file.writealltext(@"c:\users\matt\music\target", "text file body arg: " + args[0]); } catch { console.writeline("no arguments passed."); console.readline(); file.writealltext("c:\\users\\matt\\music\\target", "text file body no args"); } } } } not running in admin mode isn't helping, folder not read only, , users on security tab target fold

plot - Plotting in R 3.1.2 -

i have records of data account (say unique 400 records). each record has three different indications indicated premium. each record, concerned how indications compare each other. in cases, indications may relatively in line, while in other 3 indications volatile , different. these records have state associated them. anyways, wondering if there nice way visualize record differences between 3 indications. also, whether or not there nice way visualize indication differences state (perhaps on map-like view in r??). i have plotted distributions of each individual indication using density plots has been helpful, here asking visualization of differences between 1, 2, or 3 indications for each record . asking possible? thank much. perhaps you're after, easier if provide sample data , more descriptive in exact question asking: library(ggplot2) library(dplyr) library(tidyr) df <- data.frame(id = 1:400, state = state.abb, ind

xs - Perl SV value from pointer without copy -

how create sv value null terminated string without copy? newsvpv(const char*, strlen) without copy , moving ownership perl (so perl must release string memory). need avoid huge memory allocation , copy. i found following example: sv *r = sv_newmortal(); svpok_on(r); sv_usepvn_mg(r, string, strlen(string) + 1); but don't have deep knowledge of xs internals , have doubts. if want perl manage memory block, needs know how reallocate , deallocate it. memory knows how reallocate , deallocate memory allocated using allocator, newx . (otherwise, have associate reallocator , deallocator each memory block.) if can't allocate memory block using newx , best option might create read-only sv svlen set zero. tells perl doesn't own memory. sv blessed class has destructor deallocate memory using appropriate deallocator. if can allocate memory block using newx , can use following: sv* newsvpvn_steal_flags(pthx_ const char* ptr, strlen len, const u32 flags) { #defin

How to parse json accepted from android app in Rails -

how parse json data sent android app. suppoce have method in controller inside have parse json data. suppoce android app able send json provided url. believe in order data android app have provide url android application. the major question json stored, access via parameters hash? try this in controller create 1 method , call in before_action e.g. before_action :parse_json_data_to_params def parse_json_data_to_params params.merge!(activesupport::json.decode(request.raw_post)) end plese dont forget write except block in front of bfore_action because raise error requests.

html - Bootstrap navbar collapse not working on mobile devices -

if resize browser works perfectly, if access phone/tablet loads uncollapsed desktop version, , incorrectly @ that. any issues html? <nav class="navbar navbar-custom navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse"> <i class="fa fa-bars"></i> </button> <a class="navbar-brand page-scroll" href="/"> <i class="fa fa-car"></i> <span class="light">title</span> </a> </div> <div class="collapse navbar-collapse navbar-right navbar-main-collapse"> <ul class="nav navbar-nav"> <li class="hidden"> <a href="

c# - Parse.com Android Unity Nothing works not even the test object -

Image
i have started using parse.com on unity 5.0.0fb, , after getting application work parse on unity editor decided try on mobile find nothing works. have checked apk , parse inside when try not work. i have tested test apk nothing parse , test script attached button , not work. using unityengine; using system.collections; using parse; public class scripttest : monobehaviour { public unityengine.ui.text mytext; string mytext; // use initialization public void myspecial () { parseobject testobject = new parseobject("testobject"); testobject["foo"] = "bar"; testobject.saveasync(); mytext = "saved"; mytext.text = mytext; debug.log (mytext); } // update called once per frame void update () { } } it not button click saved on text when check parse testobject nothing there. there im missing in build? i have made sure stripping disabled. this works 100% in editor not in android have no idea or way test ios. i ha

R shiny updateCheckboxInput -

i have r shiny application in have drop down box defined in ui.r lib values c("x","y","z") , check box called spcheck defined checkboxinput("spcheck","label1",value = false)) other conditions makes checkbox available when input$lib=z , checking make few things appear. when users select different library, x, want make spcheck value false , added following code server.r observe({ if (input$lib %in% c("x","y") ) {cat("uncheck called 1 : ",input$spcheck,'\n') updatecheckboxinput(session,"spcheck","label1,value = false) cat("uncheck called 2 : ",input$spcheck,'\n') } else return() }) the text displayed @ console : uncheck called 1 : true uncheck called 2 : true why not making spcheck value false? may i'm missing trivial, couldn't figure ou

xslt - XSL apply-templates output issues -

given xml: <?xml version="1.0" encoding="iso-8859-2" ?> <products> <p> <id> 50 </id> <name> murphy </name> <price> 33 </price> </p> <p> <id> 40 </id> <name> eddie </name> <price> 9999 </price> </p> <p> <id> 20 </id> <name> honey </name> <price> 9999 </price> </p> <p> <id> 30 </id> <name> koney </name> <price> 11 </price> </p> <p> <id> 10 </id> <name> margarethe </name> <price> 11 </price> </p> </products> with xsl: <?xml version="

bash - concatenation of two lines using awk -

i have file each row having 74 columns. have been trying combine these lines if first , second column matches. file looks below. check_in|2000000000|ms|xxxx|xxxx|n|34|n|n|n|n|n|y|n|n|n|n|n|123456|aaaaaa|122333|||||||||||aaaaaa|bbbbbbb|ccccccc|||||||||||||||||||1000123|aaaa|n|qwerty||registered|registered|registered|unregistered|19-05-2015|video|edm||||||||||xxxxx check_in|2000000000|ms|xxxx|xxxx|n|34|n|y|n|n|n|n|n|n|n|n|n|345676|abcgdwejj|aaaaaaa||||||||||||||||||||||||nnnnnnn||||||||1000001|cccccc|n|qyuirt||registered|registered|registered|unregistered|19-05-2015|video|edm||||||||||xxxxx i have used below script: cat sample_file4.txt | awk -f "|" '{line=""; for(i = 3; <= nf ;i++) line = line $i"|"; table[$1"|"$2]=table[$1"|"$2]"|"line;} end { (key in table) print key "==>" table[key];}' > output9.txt the record not appended first line.except key values, same line being repeated.like belo

c# - does not implement interface member IComponentConnector2 -

Image
i tried create new windows universal app (uwp) new project seems broken. i use visual studio 2015 rc (version 4.6.00076), .net windows store apps (4.5.1.0) how did ? used simple way : and next, tried build project without modifying nothing in project. , got error : severity code description project file line error cs0535 'mainpage' not implement interface member 'icomponentconnector2.connect(int, object, object)' d:\windows phone\\\obj\x86\debug\mainpage.g.cs 16 i didn't find solution on internet, maybe it's problem .net version or assembly missing... does had error ? , fix ? i tried "repair" visual studio installation nothing new happened. so, tried remove visual studio , install again. first time made custom installation, time made full installation. and seems works good. strange bug :s

javascript - show a div with jQuery if the user is on IE 9 and below -

how detect (with jquery) if user on ie 9 or below, , if .show() div? i have done below jquery android. how ie 9 , below condition ? done similar android. (would similar solution ie 9 and below ) var ua = navigator.useragent.tolowercase(); var isandroid = ua.indexof("android") > -1; //&& ua.indexof("mobile"); if(isandroid) { // alert( "welcome" ); $("#android").slidedown(); } have tried use method of detecting if you're using ie? if ($.browser.msie && parseint($.browser.version, 10) > 8) console.log('using ie9/10'); else console.log('not ie9/10'); another way of doing because $.browser deprecated: checkieversion(); /** * returns version of internet explorer or -1 * (indicating use of browser). */ function getieversion() { var returnvalue = -1; // return value assumes failure. if (navigator.appname == 'microsoft internet e

swift - How to add constraints to a Custom UITableViewCell -

Image
i have created custom cell table view , works fine except image view not align correctly. is there way add constraints custom cell view? programmatically or otherwise? this cell looks in storyboard - hoping achieve @ run time: but when demo app happens: here image storyboard: view controller /w tableview @iboutlet weak var tableview: uitableview! override func viewdidload() { super.viewdidload() println(questions) println(finalresults) let thewidth = view.frame.size.width let theheight = view.frame.size.height tableview.frame = cgrectmake(0,0, theheight, thewidth) } cell view controller override func awakefromnib() { let thewidth = uiscreen.mainscreen().bounds.width contentview.frame = cgrectmake(0,0, thewidth, 64) answerimage.center = cgpointmake(115, 15) } you have set constraints correctly. indeed, if add missing constraints , reset suggested constraints handy don't know want, result cannot expect. w

java - Complexity of LSD string sort (cfr. Algorithms by Sedgewick & Wayne) -

in algorithms sedgewick & wayne (4th edition), state lsd string sort uses 7wn + 3r array accesses , space proportional n+r sort n items keys w-character strings taken r-character alphabet. they prove saying: "the method w passes of key-indexed counting, except aux[] arrays initialized once.the total immediate code , proposition a." however, 2 pages back, state key-indexed counting uses 11n + 4r + 1 array accesses stably sort n items between 0 , r-1. how possible? shouldn't lsd n+w(4r + 10n) ? just clear, i'm not looking big-o notation. thanks in advance! code key-indexed counting sort (according algorithms): int n = a.length; int[] count = new int[r+1]; (int = 0; < n; i++) count[a[i]+1]++; (int r = 0; r < r; r++) count[r+1] += count[r]; (int = 0; < n; i++) aux[count[a[i]]++] = a[i]; (int = 0; < n; i++) a[i] = aux[i]; code lsd string sort int n = a.length; int r = 256; string[] aux = new string[n]; (int d = w-1; d

r - scatter plot for a multiclass dataset with class imbalance and class overlapping -

Image
i'm using weka develop classifier detecting semantic relations. lets supose have multiclass dataset. dataset, @ first, contains 4 numeric features (could on 4) , class attribute, valid class attribute value "hypernym", "synonym" or "no", i.e., 3 classes. so, examples of instances be: feat1 feat2 feat3 feat4 class .... 0.32 0.45 0.15 5 no 0.26 0.48 0.93 20 hyper 0.65 0.32 0.43 13 no 0.43 0.19 0.89 45 syn ... this typical classification problem. however, must consider dataset inflicted class imbalance problem (it problem in machine learning total number of class of data (positive) far less total number of class of data (negative)) , class overlapping (examples of different classes have similar characteristics). the question is: how can represent each instance in graph 2d, in way can visualize degree of overlapping between classes? i have found

javascript - refresh iframe after downloading a blob -

i have filebrowser on server uses azure storage store files. website has feature when click on file, it'll bring details window. use viewerjs display pdf preview of file (if applicable), , works pretty well. problem when downloading preview file, have reload preview iframe manually display. relevant php function is: http://pastebin.com/sayhsbfi when function completed (i'm using ajax), $.done function calls response = json && json.parse(response) || jquery.parsejson(response); $scope.pdfthingy=response; document.getelementbyid("viewerjs_preview").contentdocument.location.reload(true); response on first line set full pathname pdf preview file, , viewerjs_preview id of relevant iframe. reason, isn't working, , iframe isn't reloading itself. how make when blob has finished downloading, , pdfthingy set? is iframe’s domain same host website’s domain? if not, cannot access contentdocument (or contentwindow) in host website’s j

Jquery Dialog is not firing when call from the C# code behind -

this .aspx : <div id="divaddrcandidates" class="selector" style="display:none"> <div style="margin-left:10px ; margin-top:10px"> <asp:listbox id="lstcandidates" runat="server" ></asp:listbox> </div> <br /> <div style="margin-left:10px"> <asp:button id="btnselect" runat="server" text="select address" /> <asp:button id="btncancel" runat="server" text="cancel" onclick="btncancel_click" onclientclick="closeaddrcandidateswin(); return false;" /> </div> </div> this jquery: function openaddrcandidateswin() { $("#divaddrcandidates").dialog({ resizable: true, width: 650, heigh: 450, modal: true, draggable: true, re

javascript - Business Open/Closed text on page according to time -

i must have tried 100 variations of code , can't seem right. feel i'm walking further off playing field. i want display message on our pages show whether our business open or closed depending on time and/or day. here current code. <script type="text/javascript"> var today = new date() var open = ("we're open today 9am - 5pm</span>"); var closed = ("we're closed , open again tomorrow 9am - 6pm</span>"); if (today == 0) display.innerhtml = 'closed'; if (today.gethours() >= 9 && today.gethours() < 18) { display.innerhtml = 'open'; } else { display.innerhtml = 'closed'; } </script> and html i'm using. <div><span id="display"></span></div> try (see jsfiddle ): var today = new date(), open = "we're open today 9am - 5pm", closed = "we're closed , open again tomorrow 9am - 6pm",

objectinputstream - Why does order of instantiation seem to matter for input and output streams in Java? -

i have following code works (please assume hostname , port initialized proper values, , message serializable class): //example 1 - works expected message message = new message(); try(socket serversocket = new socket(hostname, port)) { objectoutputstream outstream = new objectoutputstream(serversocket.getoutputstream()); outstream.writeobject(message); outstream.flush(); objectinputstream instream = new objectinputstream(serversocket.getinputstream()); object response = instream.readobject(); } when move instantiation of objectinputstream occur after objectoutputstream instantiation, execution of application hangs indefinitely: //example 2 - client locks message message = new message(); try(socket serversocket = new socket(hostname, port)) { objectoutputstream outstream = new objectoutputstream(serversocket.getoutputstream()); objectinputstream instream = new objectinputstream(serversocket.getinputstream());

Cannot Restore from Backup File to Sybase -

we have old sybase server. our database in acting up. need restore backup database file our backup sybase server. when try that, keep getting error message: msg 7205, level 17, state 2: line 1: can't open connection site 'syb_backup'. see error log file in sql server boot directory. that how restore database backup: 1. use rcp copy dump file spare server primary server. , name copy "frombkup_mydb.dump". 2. drop old database primary server, , re-create empty one. 3. use following command load database backup dump file: load database mydb "/export/home/syb11.dump/frombkup_mydb.dump" unfortunately don't know error log file is. not familiar sco unix , sybase. does know why restore doesn't work? please help. thanks. jay chan it's backup server not running. the sap/sybase ase database process requires backup server running database backups or restores. to find database processes running can use showser

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

i trying make simple python program opening list of webpages user manually download reports site. don't have previous experience preparing exe files.. , i'm in learning process python coding. of done on windows 7 x64 this python code: #!c:/python34/python.exe -u splinter import * import time import os import csv #---------------------------------- raporty = [] open('../raporty.csv', newline='') csvfile: contents = csv.reader(csvfile, delimiter=' ', quotechar='|') row in contents: r = ', '.join(row) r = r.replace(',','') raporty.append(r) #--not implemented yet zmienne = [] open('../zmienne.csv', newline='') csvfile: contents = csv.reader(csvfile, delimiter=' ', quotechar='|') row in contents: r = ', '.join(row) r = r.replace(',','') zmienne.append(r) print("start") browser = browser(