Posts

Showing posts from February, 2010

Issue with installing latest Android SDK -

im having issue when trying access main.axml on visual studio android. visual studio returns message shown bellow on image. https://drive.google.com/file/d/0b0itanoib8olwhjkzll0bzezule/view?usp=sharing and when view android’s sdk manager seems if date https://drive.google.com/file/d/0b0itanoib8olmtfsqk1xoepkoxm/view?usp=sharing please assist i’m not sure going on. help.

php - Getting Combined Total Number Of MySQL Cells With Same Value: -

i'm working on forums project , struggle faced gathering total amount of mysql cells same value. point of total number of replies in specific topic in forums. in specific circumstance, have table called post . in post , there cell called post_topic , same value topic_id table, topic (this attach replies directly topic). values in post_topic range 1 (being first topic), 2 (being second topic), etc. what trying total amount of replies (post_topic) have same value, example if in post_topic there 40 cells value "7", how can mysql cherry pick 40 cells out of hundreds of others , echo through php? here's i'm working with: $sql = "select post_topic, topic_id post, topic"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result) echo '<button>' *** need value go here! *** '</button>; i'm self taught, if write in code able understand i

iphone - Old Launch Screen and black display after iOS app update -

i made ios app xcode , swift. in v2, updated launch screen , launch images. i first installed v1 of app app store. when new, v2, available app store updated app on devices. that's iphone 5s newest ios , iphone 7 plus newest ios. after updating app on iphone 7 plus still showed old launch screen. restart didn't help. had delete , reinstall app new launch screen shown up. on iphone 5s didn't launch screen or launch image, got black screen time launch screen shot shown. deleted , reinstalled app. didn't help. had restart device after reinstalling app right v2 launch screen. why strange behavior? can do? i cannot ask users reinstall app , restart devices. after updating launch image, delete application cache stored in deriveddata folder. if using xib or storyboard displaying launchscreen move images asset catalog, rather using png filenames.

python - what input for parameter vocabulary and tokenizer for tfidfvectorizer? -

what the proper input type tokenizer , vocabulary parameter on tfidfvectorizer? first, tried custom tokenizer own tokenizing function, because need stem terms in own language, code below: def tokenize(documents): final_tokens = [] doc in documents: tokens = doc.split() tokens = [token.lower() token in tokens if len(token) > 2] tokens = [stemmer.stem(token) token in tokens] final_tokens.extend(tokens) return final_tokens vectorizer = tfidfvectorizer(stop_words=stops,min_df=0.1,tokenizer=tokenize) features = vectorizer.fit_transform(titles) however when want print features , got error this: valueerror: empty vocabulary; perhaps documents contain stop words second, have list of terms , document frequencies taken csv files contains result of dataset tokenizing. code below: vocabs = [row[1] row in list(csv.reader(dataset_tokenize))] vectorizer = tfidfvectorizer(stop_words=stops,vocabulary=vocabs) features = vectorizer.fit_t

android - how to show a custom dialog box when an activity start -

Image
i want show custom dialog box when start first activity without using button . try search i'm not finding proper solution want do. many of them using onclick listener achieve scenario. below image showing activity dialog box, that's i'm looking without using onclick listener. how can implement without using onclick listener ? any code contained in click listener works elsewhere in class (unless use view that's clicked) create dialog in oncreate. open when activity started

asp.net mvc 4 - MVC confirm box after controller clause -

controller if (1 > employee.2) { return redirecttoaction("index", "home", new { aid = a.id); } view <script type="text/javascript"> var = confirm("question"); </script> controller checks clause shows confirm box if true. how return controller without losing form data posted

AWS Cognito vs IAM role in Android APP for security aspects -

an app of mine in android playstore (let's >1.000.000 installs) collect anonymous statistics. want store , work these statistics on amazon emr cluster. currently use aws cognito creating unauthorized access uploading data s3/firehose. saving money thought of changing procedure use hardcoded iam user, able upload data fh/s3. don't need identification of each user. what disadvantages should expect in terms of security? cognito federated identities 100% free. switching iam user won't save money. per pricing page: "using federated identities feature authenticating users , generating unique identifiers free amazon cognito."

python - SHOP_CURRENCY_LOCALE = 'en_US.UTF-8' -

i trying include line shop_currency_locale = 'en_us.utf-8' inside settings.py file it's giving me following error:- raise improperlyconfigured(msg % currency_locale) django.core.exceptions.improperlyconfigured: invalid currency locale specified f or shop_currency_locale: 'en_us.utf-8'. you'll need set locale s ystem, or configure shop_currency_locale setting in settings module. the locale must installed on computer. on linux or mac can installed locales executing "locale -a". windows bit wierder , don't think utf-8 suffix available. here list of windows locales. should use language string. https://msdn.microsoft.com/en-us/library/39cwe7zf(v=vs.140).aspx in case 'us'.

r - How to calculate share per category within a column? -

Image
df = data.frame(week = as.factor(rep(c(1, 2), times = 5)), name = as.factor(rep(letters[1:5], times = 2)), count = rpois(n = 10, lambda = 20)) > df week name count 1 1 16 2 2 b 14 3 1 c 23 4 2 d 15 5 1 e 12 6 2 15 7 1 b 23 8 2 c 22 9 1 d 22 10 2 e 26 i'd calculate each name's count share per week. @ first going use following method: transform(df, week1_share = ifelse(week == "1", round((df$count / sum(df$count) * 100),2), na)) transform(df, week2_share = ifelse(week == "2", round((df$count / sum(df$count) * 100),2), na)) but making each column merge, put label on bar plot, seemed inefficient. there must type of quick solution dont know of yet. basically follows add share% may have been calculated above match within each box. ggplot(df, aes(reorder(week, -coun

docker - Spring Boot 1.4.1 SSL trustAnchors exception -

i running spring boot microservices inside docker containers (docker-compose) testing, tried upgrade spring boot 1.4.0 1.4.1 (tried 1.4.2. also) services fail on start invalidalgorithmparameterexception: trustanchors parameter must non-empty exception. i have not experienced issues running spring boot 1.4.0. dockerfile use 1 of services provided below (some sensitive values have been replaced, tried 1.4.2 same result. the same behaviour happens when run service on command line, environment variables , java params listed in dockerfile below. here extract log: 2016-11-10 08:10:06.645 error [sbsa-account-om-service,,,] 1 --- [ main] o.apache.catalina.core.standardservice : failed start connector [connector[http/1.1-8762]] org.apache.catalina.lifecycleexception: failed start component [connector[http/1.1-8762]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:167) ~[tomcat-embed-core-8.5.5.jar!/:8.5.5] @ org.apache.catalina.core.sta

Cakephp security component error -

the error is: '_token' not found in request data. it happens on redirect @ end of action i went through debug , can see coming function called _validtoken() i've no idea why particular controller doing though have others similar actions , working perfectly the action triggers it's supposed right redirect @ end the problem not evident until implemented ssl have been there whole time waiting pounce! i've started using security component , few pointers, if out there nudge me in right direction i'd appreciate it. cheers so figured out eventually it such simple problem i had @ end of form: <?= $this->form->button(__('submit')); $this->form->end() ; ?> it works. works when turn on auth. stops working load security component change this: <?= $this->form->button(__('submit')) ?> <?= $this->form->end() ?> and works security component silly mistake suppose hard find

php - HTTP error 500, not sure where to start -

<?php $tabel = array(); $teller = 0; $handle = opendir(dirname(realpath(__file__)).'/images/bbq2015/'); while($file = readdir($handle)){ if($file !== '.' && $file !== '..'){ $tabel[$teller] = $file; $teller++; } } $n = $tabel.length(); ($i = 0; $i < $n-1; $i++) ($j = 0; $j < $n-$i-1; $j++) if ($tabel[$j] > $tabel[$j+1]) { $temp = $tabel[$j]; $tabel[$j] = $tabel[$j+1]; $tabel[$j+1] = $temp; } $teller = 0; while($teller < $n){ echo '<a class="example-image-link" href="images/bbq2015/'.$tabel[$teller].'" data-lightbox="example-set" data-title="bbq 2015"><img class="halloween2015" src="images/bbq2015/'.$tabel[$teller].'"/></a>

c# - Pass Parameter or Arguments to a Background task in Uwp -

i creating uwp app in want take data user textbox , pass background task. when trying add project reference background task getting circular reference error. there way pass arguments maybe overload of run function or else. in advance. romasz has explained in case can user data textbox doing these steps: 1.declare in mainpage.xaml.cs(or xaml page) var localsettings = windows.storage.applicationdata.current.localsettings; localsettings.values["user"] = user.text; 2.now data in backgroundtask.cs using these var localsettings = windows.storage.applicationdata.current.localsettings; string user = localsettings.values["user"].tostring(); here variable user has texbox data wanted mainpage. note:i have assumed have named textbox "user"

xhtml - Why my css not affective while printing -

i using external css in xhtml printing page. in browser showing right output while printing css not effect. why? please help. use media query specify print styles, example: @media print { ... } the stylesheet default screen, not apply printers. references media » learn css3 | cheat sheet | css tutorial | selectors | properties create customized print stylesheet in minutes — sitepoint

python - How to fix error when concatenating two numpy arrays? -

i trying following: rands = np.empty((0, 10)) rand = np.random.normal(1, 0.1, 10) rands = np.concatenate((rands,rand),axis=0) which gives me following error: valueerror: input arrays must have same number of dimensions but why error? why can't append new row rand matrix rands command? remark: i can 'fix' using following command: rands = np.concatenate((rands,rand.reshape(1, 10)),axis=0) but looks not pythonic anymore, cumbersome... maybe there better solution less brackets , reshaping...? rands has shape (0, 10) , rand has shape (10,) . in [19]: rands.shape out[19]: (0, 10) in [20]: rand.shape out[20]: (10,) if try concatenate along 0-axis, 0-axis of rands (of length 0) concatenated 0-axis of rand (of length 10). pictorially, looks this: rands: | | | | | | | | | | | rand: | | | | | | | | | | | | | | | | | | | | the 2 shapes not fit because 1-axis of rands has length 10 , rand lac

raspberry pi3 - CAN bus turns to ERROR PASSIVE state when loopback is turned off -

i have connected pican2 board raspberry pi running latest jessie. when try send can messages pc ( pc connected via usb db9 can interface pican2 board) through pican2 using can-utils, runs error-passive state bring can interface up. but, when enable loopback mode, able send messages , receive them using 2 different terminal window on raspberry pi itself. enabled loopback mode using sudo /sbin/ip link set can0 type can bitrate 500000 loopback on. can 1 tell me more loopback mode? want make sure hardware setup pican2 correct. possible confirm can board configured correctly because can send/receive messages using loopback mode?or doesn't mean correct? i want know why error passive mode - indicate pican2 not configured correctly or mean usb db9 can interface has problem? new area , nice. thank you.

javascript - Express not working as expected -

i trying set react app express running. however, can't understand why won't load page want to this app.js : var express = require('express'); var app = express(); app.use('/', express.static('public')); app.get('/', function(req, res) { res.sendfile('./index.html'); }); app.get('/canyouplay.js', function(req, res) { res.sendfile('/canyouplay.html'); }); app.listen(process.env.port || 8080); this works. if change first app.get to: app.get('/', function(req, res) { res.sendfile('./canyouplay.html'); }); it still renders same html file when restarting app though different files. also when run function: handleclick: function() { document.location.replace('./canyouplay'); }, it says cannot /canyouplay though html , js file exist name. what have missed or doing wrong?

Send sms via java from java application -

i writing java program must able send sms. i'm inspired post here code string url = "http://www.mobinawa.com/http_api"; string charset = "utf-8"; // or in java 7 , later, use constant: java.nio.charset.standardcharsets.utf_8.name() string param1 = "sendsms"; string param2 = "696926448"; string param3 = "pwd"; string param4 = "hereka"; string param5 = phonenumber.replace("+237", ""); string param6 = textmessage; string query = string.format("action=%s&username=%s&password=%s&from=%s&to=%s&msg=%s", urlencoder.encode(param1, charset), urlencoder.encode(param2, charset), urlencoder.encode(param3, charset), urlencoder.encode(param4, charset), urlencoder.encode(param5, charset), urlencoder.encode(param6, charset)); /* urlconnection conne

jquery - Open Window.open() With POST Data and get data with PHP -

i have form username , password. when click on submit buttom username , password pass page , open new window. i know pass data request like window.open('url.php?unm=username&pass=password','_blank'); but in case don't want display data in url. want use post method data in url.php page. so how this. please help.. advance below code use : $.post("url.php?unm=username&pass=password",function(data){ $("#form").hide(); }); you need form submit , open new window <form id="form" method="post" action="url.php" target="thewindow"> <input type="hidden" name="unm" value="" /> <input type="hidden" name="pass" value="" /> </form> <script> function post(name,password) { var f = document.getelementbyid('form'); f.unm.value = name; f.pass.value = password; window.open('',

asp.net mvc - have to enable and disable my dropdown list when "All Course" is checked. multiselect dropdown validation -

function updatetextarea() { var allvals = []; $('#coursedropdown :checked').each(function () { if ($(this).val() == "all courses") { if($(this).attr('checked')) { $("input[type=checkbox][name='course-dropdown-list']").attr('checked', true); allvals.push($(this).val()); } else if($(this).val() != "all courses") { $("input[type=checkbox][name='course-dropdown-list']").attr('checked', false); $(this).val() == ""; allvals.push($(this).val()); } } else { allvals.push($(this).val()); } }); $('#course').val(allvals); } when

MongoDB import error : Failed: error reading separator after document #1: bad JSON array format - found no opening bracket '[' in input source -

here json file : {"a":"b"} when importing file in database command: mongoimport --db test --collection abc --jsonarray --file abc.json i got error : 2016-11-10t15:03:39.696+0530 connected to: localhost 2016-11-10t15:03:39.697+0530 failed: error reading separator after document #1: bad json array format - found no opening bracket '[' in input source 2016-11-10t15:03:39.697+0530 imported 0 documents in console. there no '[' symbol in file. can tell me wrong? since included option --jsonarray , must provide array: [{"a":"b"}] . if provide single document, not use option --jsonarray .

php - Is it better to get values from array or declaring them each time? -

example 1: $a = 'value1'; $b = 'value2'; $c = 'value3'; $x = 'value1'; $y = 'value2'; $z = 'value3'; example 2: $var = array('value1', 'value2', 'value3'); $a = var[0]; $b = var[1]; $c = var[2]; $x = var[0]; $y = var[1]; $z = var[2]; which example has less server resource usage? example faster? in neither has impact on speed trivial. if talk memory usage, array uses more stores same variables + reffence links (again, trivial how works). there other factors need consider: 1.readability - if use array approach code dificult trace in bigger functions. 2.operations - if use array array approach operations variables limited things += break array refference , store values directly in variable. 3.relations other devs - if use array approach else has work code spilling curses way ;)

node.js - Remove substring (URL) from a string (URL) with javascript -

i having problems removing baseurl url. i have string var baseurl = 'https://www.stackoverflow.com'; var url = 'https://www.stackoverflow.com/test/number/'; url.replace(baseurl, ""); now expect result /test/number/ not remove first part of string. the code example. not know sure if baseurl substring cannot cut length. any ideas? you need update string returning value of string#replace method since method won't updates string. var baseurl = 'https://www.stackoverflow.com'; var url = 'https://www.stackoverflow.com/test/number/'; url = url.replace(baseurl, ""); console.log(url); using string#substring , string#indexof methods. var baseurl = 'https://www.stackoverflow.com'; var url = 'https://www.stackoverflow.com/test/number/'; var = url.indexof(baseurl); url = url.substring(0,i) + url.substring(i + baseurl.length); console.log(url);

uistoryboard - Unable to find the image edge option in Xcode 8 for UIButton -

Image
as image edge option in xcode 7 using storyboard -> attribute inspector did not option in xcode 8 . please find below screenshot viewing image edge option in xcode 8.

junit - Mockito: how to verify method was called inside another method, which always throws Exception? -

i testing method expected exception. need verify code called (on mocked object) after exception thrown, verification being ignored. here code: public class exceptionhandler { @autowired private sender sender; public void handle(exception exception) throws exception { if (!someexception.class.isassignablefrom(exception.getclass())) { sender.sendmessage(exceptionutils.getstacktrace(exception)); } throw exception; } } here test code: @mock private sender sender; @injectmocks private exceptionhandler handler; @test public void testhandler() throws exception { someexception someexception = new someexception(); try { handler.handle(someexception); } catch (someexception thrownresult) { assertequals(someexception, thrownresult); } verify(sender, times(1)).sendmessage(mockito.anystring()); } i need verify code called (on mocked object) after exception thrown, verification being ignored

python - SQLAlchery query filter on child attribute -

my model consists of parent , child one-to-one relationship: class parent(base): __tablename__ = 'parent' id = column(integer, primary_key=true) name = column(string) child = relationship("child", backref="parent", uselist=false, lazy='joined') class child(base): __tablename__ = 'child' child_id = column(integer, foreignkey(parent.id), primary_key=true) value = column(integer) my test data following: q = s.query(parent) pd.read_sql(q.statement,s.bind) id name child_id value 1 1 10 2 b 2 20 3 c 3 30 now i'd parents child.value > 20 using query: q = s.query(parent).filter(parent.child.value > 20) but error occurs: attributeerror: neither 'instrumentedattribute' object nor 'comparator' object associated parent.child has attribute 'value' of course can query direct on child class goal retrieve

C Program - warning: initializer-string for array of chars is too long -

please bear me since i'm new c programming, here's code: #include <stdio.h> #include <sys/stat.h> #include <string.h> #include <stdlib.h> int main(int argc, char* argv[]) { char name[0] = "/tmp/crt/client.conf"; char name[1] = "/tmp/crt/haha"; char name[2] = "/tmp/crt/router.ovpn"; char name[3] = "/tmp/crt/router.txt"; char name[4] = "/tmp/crt/sgdo11-tcpvpn.com-443.ovpn"; char name[5] = "/tmp/crt/sgdo1-tcpvpn.com-443.ovpn"; char name[6] = "/tmp/crt/sshdropbear.net-2016-10-22.ovpn"; char name[7] = "/tmp/crt/sshdropbear.net.txt"; char name[8] = "/tmp/crt/tcpvpn.txt"; char name[9] = "/tmp/crt/test15.ovpn"; char name[10] = "/tmp/crt/test15.txt"; char name[11] = "/tmp/crt/udp-1197.ovpn"; char name[12] = "/tmp/crt/udp.group-1194-exp11nov.ovpn"; char name[13] = "/tmp

WebRTC : Video black screen bitrate -

is bit rate of black screen shown when video muted same original video's bit rate or less because black screen? it less. since there no video information being sent remote party. how depends on lot of factors (connection quality etc). i did quick test , outgoing bit rate @ 640x480 @ 27fps around 900 kbps 1 mbps . disabling video track of stream resulted in outgoing bitrate of 30 kbps . please keep in mind simple test did. can kind of information evaluating reports in peerconnection.getstats some documentation , libraries getstats https://www.w3.org/tr/webrtc-stats https://github.com/muaz-khan/getstats https://www.callstats.io/2015/07/06/basics-webrtc-getstats-api/

java - Nested bean validation using Group Sequence -

i have rest services take bean input: @get @produces(mediatype.application_json + "; charset=utf-8") @path("/{a}/{b}") public response getdetails(@beanparam @valid imputform form) throws applicationexception { the input form has field takes value headerparam , should check before other field, , achieved using custom annotation defining group sequence: @headerparam("value") @idcheck(groups = {auth.class}, payload = severitypayload.forbidden.class) private string id; the inputform class annotated with: @groupsequence(value = {auth.class, inputform.class) so far perfect, problems come out when add bean in inputform, should validated in way: @beanparam @valid private customobject customobject; in custom object there validation too, like: @notnull @notempty @pathparam("value") private string innerstring my problem when both id , innerstring don't respect validation, expect see id validated first following gro

serialization - C# - How to serialize and derialize DataSet correctly? -

Image
i cannot deserialize serialized dataset correctly if has dates. result dates considered separate table instead of columns itself. seems not parsed correctly. how fix this? here variables under inspection after serialization , deserialization. can see deserializeddataset.tables has 2 counts original 1 count. printed table names , shows second table date. moreover, can access date column in original data set unable access in deserialized version. here serialized data of dataset. <?xml version="1.0" standalone="yes"?> <newdataset> <producttransactionsummary> <id>74517</id> <branchid>9999</branchid> <date xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <year>2016</year> <month>11</month> <day>10</day> <hour>18</hour> <minute>25</minute>

c# - Detect if running as Administrator with or without elevated privileges? -

i have application needs detect whether or not running elevated privileges or not. have code set this: static bool isadministrator() { windowsidentity identity = windowsidentity.getcurrent(); windowsprincipal principal = new windowsprincipal(identity); return principal.isinrole (windowsbuiltinrole.administrator); } this works detect if user administrator or not, doesn't work if running administrator without elevation. (for example in vshost.exe). how can determine whether or not elevation [already in force or] possible ? try out: using microsoft.win32; using system; using system.diagnostics; using system.runtime.interopservices; using system.security.principal; public static class uachelper { private const string uacregistrykey = "software\\microsoft\\windows\\currentversion\\policies\\system"; private const string uacregistryvalue = "enablelua"; private static uint standard_rights_read = 0x00020000; private s

jquery - Allow Varnish cache, without per-cookie cache version only for a specific front-end cookie -

bonjour à tous, first post on stack overflow ;) i want understand process varnish. i've not yet find answer question on internet. i've drupal 7 website, in development, uses varnish (v4), works fine. no cookie generated drupal site. this website allow each anonymous user manage "demand" (involving of many pages) , send content of demand our office. there no users management or account management anonymous users. improve performance, have installed varnish real first experience it. i implement process of "demand" using jquery + cookie store relevant information. apache (v2.4) not called @ each request. i think if cookie generated, caching process skipped varnish. use varnish without per-cookie cache version specific front-end cookie. so know if possible varnish: hey varnish if specific cookie present (i mean managed, cookie crud), not take care of , continue serve cached page). if yes, explain me bit logic. thank in advance.

ios - How to get sorted Dictionary from MutableArray using swift3 -

i manage create dictionary database add sections in tableview . my function database array , array dictionary (a: aname1,aname2, b: bname1,bname2...). when sorted dictionary return value type [string, [string]] , need [string: [string]], when don't use sort action it's give error: thread1:exc_bas_instruction(code=exc_i386_invop,subcode=0x0) in console: fatal error: unexpectedly found nil while unwrapping optional value (lldb) my code: class sectiondata { var marrcrimesnames : nsmutablearray! func getcrimesnames() { marrcrimesnames = nsmutablearray() marrcrimesnames = modelmanager.getinstance().getallcrimesnames() } func getsectionsfromdata() -> [string: [string]] { var sectiondictionary = [string: [string]]() let crime: crimesinfo = (marrcrimesnames.object(at: 0) as! crimesinfo) // thread1:exc_bas_instruction(code=exc_i386_invop,subcode=0x0) _ = crime.name var firstletter: [st

php - searching two strings for identical words -

i'm creating detecting alliteration program in php practice. i'm starting off deleting non-alliterative words input strings valid words can considered alliteration: //detecting alliteration //false words $false = '\wi , @ come how in of on or when the\w'; $lines = array( 'peter piper picked peck of pickled peppers ', 'bugs bunny likes dance slow , simple shuffle ', 'you"ll never put better bit of butter on knife ' ); ($i = 0; $i < count($lines); $i++) { } as might see need delete of words in false variable appear in array strings. i've tried using preg match can't seem working. feel should pretty simple problem solve on paper i'm finding hard target individual words in strings! any appreciated.

javascript - Duplicate DOM node jQuery (not reference) -

i developing dynamic form, , need duplicate node , insert dom position. my problem when first copy node (which contains empty inputs), fill data, , copy again, copied data. i duplicate variable containing empty dom node , not refer it. it's possible? var emptysegment = $( '#segment' ).clone(); $(document ).on('click', '#add', function(){ var emptysgmt = emptysegment; // duplicate emptysegment. emptysgmt.insertafter( '.lastsegment' ); }); thank you after clone element need reset input (or other elements) state require. try this: $(document).on('click', '#add', function() { clonesegment().insertafter('.lastsegment'); }); function clonesegment() { return $('#segment').clone().find('input').val('').end(); } note example resets value of input elements within segment. can put own logic in there meet whatever specific requirements are.

php - How to insert url link inside <a hreif> in yii 1 -

i have following code: <?php return array( ulogt::update =>' <div> <a href="#link">navigate</a> </div>' ?> this code locates in class called links.php. need navigate ('viewform', array('model'=>$this->loadjson($id)), when user presses navigate button. not know how insert code instead of #link . when tried insert yii::app()->createurl( '/????/???/viewform', // link array( 'id'=> 1 // data sent ) ) it did not work. code appeared in browser. how can it?

python 2.7 - how to create & encode a label file using sample images for tensorflow -

we trying detect special characters + , - inside image using tensorflow extending mnist sample code -> https://github.com/opensourcesblog/tensorflow-mnist we have been able create binary encoded file using our sample images needed training neural network using sample code -> https://github.com/jkarnows/idx-formatter but not finding way how create label file our images , create binary encoded label file using label file both of these files important proceeding further . anybody having idea welcome share them the data in gzip format, decoded extract_labels , each label on 8 bytes. can use numpy.getbuffer convert uint8 array back. alternatively, can create own extract_labels reads labels in whatever format see fit.

c# - Button `OnSelect` not functioning in Unity.UI Canvas situation -

Image
i have 3 buttons, when tap 1 button, panel text appear. the problem when attached script, nothing happens. "click" registered the panel never appears. my script attached each of button , this: public gameobject panel; //i use put panel in unity bool selected = false; void start () { panel.setactive(false); } void onselect() { selected = !selected; panel.setactive(true); } i have else panel can't figure out. do this: (1) add canvas project (2) big tip - sure select scale screen size . that's 1 ever use. unity accidentally set wrong default there, have not fixed yet. (3) in canvas, add button make perhaps "test" (3) in canvas, add button make perhaps "another test" (4) make script this... public class mainscreen:monobehaviour { public void userclickedtest() { debug.log("test.."); } public void userclickedanothertest() { debug.l

Data scraping tools for Desktop/Windows application -

i new data scraping, did search on these topics , came across tools import.io, jacada, kimono , uipath. of them related web scraping except uipath. seems uipath has issues in downloading trial version. tried more 3 times download no success. what looking tool can use scrap data desktop app. means have developed own desktop/windows app , want scrap data application reduce efforts manually note down , process it. any tools available can try?(other uipath , web scraping) want tool desktop/windows application , not web application. would settle windows automation tool instead? here alternatives uipath on site (although web scrapers, there few desktop automation tools): http://alternativeto.net/software/uipath/ i think find many people recommend program api desktop , use instead, can tap data directly without having deal ui changes design i.e. avoid ongoing maintainance.

ios - How to download imagery world map to work on offline with ArcGIS Library? -

i have integrated arcgis library in 1 of project, have access map , perform functions such draw line, add stickpin, add polygon's area, etc. while offline mode, i’m beginner arcgis library don’t know how implement. it great if 1 me make understand flow of download map , perform such functions on offline mode, appreciated. thanks in advance.

python - gdal2tiles pixel shift in output tiles -

Image
i re-calculate large geotiff files (10,000 x 10,000px) of gdal2tiles little (256 x 256px) tiles. process works fine. however, result not perfect. there slight shift in tiles (see picture below). i've tried different resampling methods , same result every time. here statement: gdal2tiles.py -s epsg: 25832 -z 11-20 /home/input/file.tif output_path / does have ideas? after days of research found answer myself: the problem depends on transformation of srs epsg:25832 epsg:3857. what did: created 1 big .tif gdalwarp , used paramter -s_srs epsg:25832 , -t_srs epsg:3857 (!important create 1 big file - otherwise there gap between .tif files). had take parameter -r cubic . default option (-r average) got same problem. so tricky, worked me!

sql - How to get specific mismatched column when using EXCEPT -

i using except / minus compare if rows/columns between 2 tables matching. select col1, col2 table1 minus select col1, col2 table2 for given row, if e.g. col2 doesn't match, output col2 ignoring matched col1 value or show null there no mismatches col1 . there way sql alone? table1 | col1 | col2 | | | b | | x | y | | m | n | table 2 | col1 | col2 | | | z | | x | y | | 1 | n | applying above sql produces | col1 | col2 | | | b | | m | n | but might need mismatched values below. | col1 | col2 | | | b | | m | | you can try this select case when t2.col1 null or t1.col1 <> t2.col1 t1.col1 end col1, case when t2.col2 null or t1.col2 <> t2.col2 t1.col2 end col2 table1 t1 left join table2 t2 on (t1.col1 = t2.col1 or t1.col2 = t2.col2) , (t1.col1 <> t2.col1 or t1.co

c - How to known which time zone the system is using -

i'm doing code need known time zone active in system (i'm working on linux so): my first aproach check tz enviroment var,it's empty unless set (for instance calling tzset) after try extern long timezone (time.h) variable 0. finally calculate difference of timezone , utc+0 don't real timezone because don't known if daylight saving apply i'm pretty sure there easy (and consistent) way achieve this. i'm looking "europe/paris" or "utc+2" or that any appreciated! as starting point, suggest this: #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { char str[64]; time_t timer; struct tm * ptm; timer = time(null); ptm = localtime(&timer); strftime(str, sizeof(str), "%z", ptm); printf("tz: %s\n", str); return(0); }

javascript - OAuth in Meteor with different URL callback for example www. at the start doesn't log in -

i playing around getting prototype app log in twitter using oauth , noticed strange. it works when put in eg. http://example.com when try logging in http://www.example.com pops , tries redirect me root_url=http://example.com , in chrome & firefox window stays locked there. in safari window disappears, still logged out. is expected behaviour meteor app or web app? there way of getting work www. , without? should redirect www. requests use without www. ? i similar behaviour when trying http , ssl https . are there websites out there use oauth different web addresses guess i'm asking? , how achieve this?

r - How to aggregate data by factor variables and count column -

i have data frame of factor variables columns , 1 numeric column , 1 integer column. want aggregate data unique factor variable combinations , sum counts. aggregate unique factor combi's doesn't sum count column. data dataframe test2 afdeling_1 probleemgebied locatie.niveau.1 risico count cost 1 secondairy assembly complete transformator secundaire installatie risico 3 ( hoog) 1 na 2 active part binnenwerk actief deel risico 3 ( hoog) 1 na 3 construction complete transformator secundaire installatie risico 2 (midden) 1 na 4 final assembly complete kast complete transformator risico 3 ( hoog) 1 na 5 windingshop wikkeling wikkeling risico 3 ( hoog) 1 na 6 warehouse complete transformator niet transformator gerelateerd risico 1 (laag) 1

android Viewpager inner page margins -

i trying show images in viewpager there padding inside each page , don't know how remove it. here image shows white space around image my image here xml code: <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v4.view.viewpager android:layout_width="200dp" android:layout_height="match_parent" android:layout_gravity="center" android:id="@+id/view_pager"> </android.support.v4.view.viewpager> </linearlayout> </linearlayout> her define adapter: public class customswipadapter extends pageradapter { private context context; private layoutinflater layoutinfl

javascript - How to bind a Paginate button OnClick event in Datatable -

i'm using datatable populate large number of records in web-site project. , due big number of data don't want load records, need in pagination manner. so, in datatable want each page display 10 records, , when user clicks on paginate button "2,3,...." or when click on "next" want bind click event clicked page number , based on display next batch of records. i have query use in sql server side fetch corresponding data: select * tablename order inserted_timestamp offset 10 rows fetch next 10 rows only; i want offset value changed per requested page number. idea crossed mind clicked paginate button number , multiply 10. so question how , if if have other suggestions approach please suggest me there 2 approach task. let ui hold key keeps track of current page being fetched. value 0. when click on next button, increment value 1 , multiply page size(10 in case). gives you offset , start position. with each response backend, send ke

perl - Sort hash attending to two parameters -

i have hash keys in following format: scaffold_902_159 scaffold_2_1980420 scaffold_2_10 scaffold_10_402 i want print out hash sorted in following format: scaffold_2_10 scaffold_2_1980420 scaffold_10_402 scaffold_902_159 so first have order numerically attending first number , attending last one. don't want regular expression searching "scaffold_" since may vary. mean, can have hash other format " blablabla_number_number , or blablablanumber_number ". last part of key _number , thing permanent. i've code sorts numerically attending first number: my @keys = sort { ($aa) = $a =~ /(\d+)/; ($bb) = $b =~ /(\d+)/; $aa <=> $bb; } keys %hash; foreach $key (@keys) { print $key; } any suggestion? sort::naturally rescue! #!/usr/bin/perl use strict; use warnings; use sort::naturally qw(nsort); %hash = ( scaffold_902_159 => 'v1', scaffold_2_1980420 =>

javascript - Change slider after clicking on the option to choose the color -

i implement change slider after clicking on product color option in product site. should similar here, not static image, slider. website based on wordpress. looking plugin slider , js/jquery function make change slider after clicking. you can go through link http://imageslidermaker.com/blog/how-to-make-a-responsive-image-slider-using-jquery-and-css helps create image slider using jquery , css.

python - Binarize an Array -

i have column vector signifies day of week [1,2,2,3,4] i need binarise vector in sense every item in original vector must transformed vector number indicates index needs 1 , rest must 0. [[0,1,0,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0], [0,0,0,0,1,0,0,0,0]] do composing binary list zeroes except in given position in list comprehension gives nice one-liner: w=[1,2,2,3,4] m = [[0]*(pos)+[1]+[0]*(9-pos-1) pos in w] result: m = [[0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0]]

javascript - Pass variable to getElementById -

i have multiple tables generated loop , each table have different ids. (table1,table2,table3 , on.) want pass these id getelementbyid function using jquery each function. here code $(document).ready(function () { $('.table', this).each(function (index, element) { tnames = $(element).attr('id'); //alert(tnames) var elem5 = document.getelementbyid(tnames); alert(elem5); }); }); tnames alert fine. when pass tname getelementbyid function return null or object. want should return ids returning alert(tname) ; any , suggestions. please? i hope following code find element's id. following code alert table id. $("document").ready(function () { var tableid= $('table').attr('id'); var element = document.getelementbyid(tableid); alert(element.id); });

javascript - Use basename in react-router on server side -

i'm serving site /clientpanel directory on server. url http://xxx.yy/clientpanel . client-side code: const history = userouterhistory(createhistory)({ basename: "/clientpanel" }); render( <router history={history} routes={routes}/>, document.getelementbyid("root") ); on client-side works fine. urls relative /clientpanel , have problem on how work on server. server-side code: const history = userouterhistory(creatememoryhistory)({ basename: "/clientpanel" }); match({ routes, location: req.url, history}, (error, redirectlocation, renderprops) => { if (renderprops) { const html = rendertostring( <routercontext {...renderprops}/> ); res.send(renderfullpage(html)) } }); on first page load need omit /clientpanel in url work, on client-side after clicking first <link> /clientpanel added begining. how make works consistent on both client , server side?

java - Vaadin: adding a custom javascript to bootstrap page -

this question has answer here: is possible use jquery inside of vaadin framework? 3 answers i need add jquery bootstrap page of vaadin application. added following in custom servlet class @override public void sessioninit(sessioninitevent event) throws serviceexception { event.getsession().addbootstraplistener(new bootstraplistener() { @override public void modifybootstrappage(bootstrappageresponse response) { //jquery necessary open in new window button string contextpath = event.getrequest().getcontextpath(); response.getdocument().head().prependelement("script").attr("type", "text/javascript").attr("src", contextpath + "/vaadin/js/jquery.min.js"); response.getdocument().head().prependelement("script").attr("type", "text/

c# - Looping through a list and matching several conditions -

im trying create method grades quiz. works fine if quiz-question has 1 correct answer, i'm having hard time handleing multiple correct answers. i first check see how many correct answers current question has. if more 1 need method checks if users answer perfect match correct answers. so, if there question 2 correct answers, , user checked in 1 of them, not score. any ideas on method of checking number of answers correct answers match correct answers? i think linq fit here i'm total noob on it. maybe adding correct answers new list , matching .contains solution? the classes like: list<question> question-class - list<answers> -(string) answertext -(bool) correctanswer - list<string> useranswertoquestiontext pseudo code: if (currentquestion has more 1 correct answer) if (useranswertext == correctanswerx && useranswertext == correctanswery) nrofcorrectanswers++; should able linq so down how model questions , answe

windows - RabbitMQ node authentification failed after changing cookie file -

i have multiple rabbitmq nodes running on different machines. after installing each node failed specify common cookie each of them use had go , manually change file .erlang.cookie . issue after doing conflicting error messages. if rabbitmqctl status following error: diagnostics attempted contact: ['rabbit@nc-mso-test01'] rabbit@nc-mso-test01: * connected epmd (port 4369) on nc-mso-test01 * epmd reports node 'rabbit' running on port 25672 * tcp connection succeeded erlang distribution failed authentication failed (rejected remote node), please check erlang cookie current node details: - node name: 'rabbitmq-cli-45@nc-mso-test01' - home dir: c:\users\jol - cookie hash: 9/hx6l+wlqv3nkmsdfqbog== whatever script call, same error. tried restarting service, removing , installing through rabbitmq-service. error persists. can gather other posts, reason might node , erlang broker running on separate users , each

sql server - Update Database MFC C++ ODBC CRecordset -

i'm developing mfc application (sdi) update, add , delete table in database called security. problem after updating 1 row in table, row updated ( verified) when action (updating row or deleting row) update canceled. don't know if there problem crecordset or database itself. //m_pset instance of class based on crecordset: m_pset->open(); m_pset->edit(); m_pset->m_security_id = sec->securityid; m_pset->m_security_name = sec->securityname; m_pset->m_security_type_id = sec->securitytypestringtoint(); if (!m_pset->update()) { afxmessagebox(_t("record not updated; no field values set.")); } in experiences oracle , sql server there difference in way commit statements happen. behavior seeing implies update not implicitly committed. in oracle , commits explicit statement , need conducted after have carried out transaction. in sql server , commits implicit default , not need carried out after transactions. that being sa

publish subscribe - How to Edit the Pub/Sub url after publishing the application -

we published wrong pub/sub url mistake. how can edit pub/sub url after publishing application? to change url published app, please email apisupport @ jawbone.com assistance. when app published, user can connect app. reason, jawbone chooses err on side of security user's data , requires manual review of app changes.