Posts

Showing posts from March, 2013

bootstrap carousel not working images -

i trying make carousel using bootstrap following code, problem shows 1 image. have added total 3 images shows 1 of them. , not able click on icons buttons. have added buttons previous , next not seen in page. <div id="mycarousel" class="carousel-slide"> <ol class="carousel-indicators"> <li data-target="#mycarousel" data-slide-to="0" class="active"></li> <li data-target="#mycarousel" data-slide-to="1"></li> <li data-target="#mycarousel" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="item active"> <img src="1.jpg" alt="fun" class="img-responsive"> </div> <div class="item"> <img src="2.jpg" alt="play" class=...

jquery - how do you initiate cropper to crop image in fengyuanchen cropper -

i using fengyuanchen cropper , using crop-avatar example , want pre-load image cropper on load ready editing. i.e image has been uploaded server. i have spent hours on , got no know how this? https://github.com/fengyuanchen/cropper/tree/master/examples/crop-avatar i have done pulling base64 server , populating on load. // added class or load var $image = $('.img-container > img'); maybe i'm missing but, put image in 2 spots on view , 1 crop.

c - How to find out size of array in function? -

this question has answer here: why isn't size of array parameter same within main? 13 answers is possible find out size of array in function without passing argument of size? this: #include <stdio.h> int length(const char* array) { int r=sizeof(array); return r; } int main() { const char array[]="www.google.com"; int a; a=length(array); printf("%d\n",a); return 0; } here result 8. you can't that, have read sizeof operator, in program it's returning size of pointer, equivalent sizeof(char *) . you can length of string using strlen() , function requires array terminated special value '\0' , means use +1 bytes store string.

javascript - How to produce a modal on form submit instead of a page redirect -

to give little background, using mailchimp api add email addresses form on site mailchimp email list. found example / snippet here (modified in code) passes emails list, instead of having page redirect once form submitted, want modal pop (i.e. ajax-ify it). here's i'm starting with: html: <form role="form" id="signup" class="formee form-inline" action="subscribe.php" method="post"> <div class="form-group"> <label class="sr-only" for="email-input">email address </label> <div class="email-input-wrapper"> <input type="text" id="email" name="email" class="form-control input-lg" placeholder="name@school.edu" size="40" value="...

server - Opening Foxx API to local network -

i have setup serverend points work web interface fine api endpoint app not give error , not time out. have tried turn app production mode in web interfaces no joy. @ doc server setup can find thing help. so think configure issue should look? on localhost ever thing works. on remote host using 168.192.0.15:8530 web interface works not api form either curl or may app without further information can guess problem is, i'll try: the default --server.endpoint configuration value arangodb server tcp://127.0.0.1:8529 . means able access local machine not other hosts. to make server respond http requests originated other hosts, need use endpoint includes server's ip address used in network, e.g. tcp://192.168.173.13:8529 , restart adjusted configuration. if that's not working either, can trying calling target url server via curl , check server's http response code. might reveal source of problem, too. note should invoke curl option --dump - see http r...

Rails undefined method `each' for nil:NilClass...but it is defined -

i have searched hours, tried every possible fix. cannot make work. error is: *nomethoderror in articles#index showing /users/myname/blog/app/views/articles/showall.html.erb line #21 raised: undefined method `each' nil:nilclass* showall.html.erb view. rendered 'article' controller. (both posted below). there route showall, , works fine. route configured as: get 'article/showall' but, have tried as: resources :articles 'showall' resources :comments both routes worked, neither had effect on issue. there method in controller, not private: def showall @articles = article.all end the offending piece of code in view is: <% @articles.each |article| %> <tr> <td><%= article.title.truncate(30) %></td> <td><%= article.author %></td> <td><%= article.manufacturer %></td> <td><%= article.model %></td> <td><%= article.displacement %...

c# - Deserialize xml to objects -

i'm trying deserialize xml objects. keep getting error: system.invalidoperationexception' occurred in system.xml.dll additional information: xml-document (1, 1) contains error. this class use deserialisation [xmlroot("mrdata")] public class driverdata { [xmlelement("series")] public string series { get; set; } [xmlelement("url")] public string url { get; set; } [xmlelement("limit")] public int limit { get; set; } [xmlelement("offset")] public int offset { get; set; } [xmlelement("total")] public int total { get; set; } } [xmlroot("drivertable")] public class drivertable { [xmlelement("driver")] public list<driver> drivers { get; set; } } public class driver { [xmlelement("driverid")] public string driverid { get; set; } [xmlelement("url")] public string url { get; set; } [xmlelement...

javascript - Changing checkbox value when div is clicked -

i have checkbox when clicked saves value along title in local storage. checkbox inside div. want checkbox value change when anywhere in div clicked not figure out how it. code far. <div class="grid-menu"> <div class="centering-and-alignment" ng-repeat="row in items | partition:3"> <div class="grid-menu-item list__item list__item--tappable" ng-repeat="item in row"> <label class="checkbox"> <input type="checkbox" ng-model="item.value" name="item.title" ng-change="savecategories()"> <div class="checkbox__checkmark"></div> </label> <ons-icon icon="{{item.icon}}"></ons-icon> <div class="grid-menu-item-label">{{item.title}}</div> </div> </div> </div> i tried ch...

apache - Apache2 log does not capture hping/ping data -

i trying put log analyzer code use apache log determine ip address of attacker. came across hping3 attack dos, icmp attack, if use command , ping apache entries aren't recorded in access log. there missing? these requests go , escape logging? in advance... i guess "almost arbitrary tcp/ip packages" not considered requests http server... should log? opening of socket without further happening? there no request logged.

swift - Read static property from object -

i have class static property access specific object. code follows: import uikit protocol theme { static var name: string { } func getbackgroundcolor() -> uicolor } class defaulttheme: theme { static var name = "default theme" func getbackgroundcolor() -> uicolor { return uicolor.blackcolor() } } var currenttheme: theme = defaulttheme() println(currenttheme.name) //error: 'theme' not have member named 'name' i cannot acces theme's name via defaulttheme.name because currenttheme may instance of different theme class, need know it's name. how can access static variable? i using xcode 6.3.1 (with swift 1.2) you've hit obscure , interesting bug in swift 1.2. swift has long history of bugs related static variables required protocols, , appears one. the problem here, apparently, have tried mix , match protocol-based characteristics class-based characteristics. suppose had said this: var curre...

c++ - Wider line in QGraphicScene on MainWindow::resizeEvent -

Image
in window i've got qgraphicscene. inside qgraphicscene draw lines (see first picture). my bug when resize window code below called fit scene in view. void gobobmainwindow::resizeevent(qresizeevent *event) { goview->fitinview(goscene->scenerect(), qt::keepaspectratio); qmainwindow::resizeevent(event); } but this. edit: on platforms (os x, windows, gnu/linux) how fix ? problem solved : goview->setrenderhints(qpainter::antialiasing | qpainter::smoothpixmaptransform);

jquery - JavaScript dynamic loading -

i have senerio, need render html page using dynamic javascript. i using loadscript function load external javascript , passing callback funtion. in html page , loading script header. header section working after script loaded , head section can see new script. however , when trying use variables script undefined. function loadscript(url,callback){ var script = document.createelement("script"); script.type = "text/javascript"; script.id="acvdatarequest"; document.getelementsbytagname("head")[0].appendchild(script); if (script.readystate){ //ie script.onreadystatechange = function(){ if (script.readystate == "loaded" || script.readystate == "complete"){ script.onreadystatechange = null; callback(); } }; } else { //others script.onload = function(){ alert(dataheader) // can see object...

hadoop - Is star schema still necessary for a big-data-warehouse? -

i designing new hadoop-based data warehouse using hive , wondering whether classic star/snowflake schemas still "standard" in context. big data systems embrace redundancy normalized schemas have poor performance (for example, in nosql databases hbase or cassandra). is still best practice making star-schema data warehouses hive? is better designing row-wide (reduntant) tables, exploiting new columnar file formats? when designing nosql databases tend optimize specific query preprocessing parts of query , store denormalized copy of data (albeit denormalized in query-specific way). the star schema, on other hand, all-purpose denormalization that's appropriate. when you're planning on using hive, you're not using optimization general-purposefullness (?) of sql , such, i'd imagine star schema still appropriate. nosql db non-sql interface, however, i'd suggest use more query-specific design.

linux - Samba modifies "last modification date" of files substracting 3 hours -

i think weird , despite having done searching wasn't able find info related problem. i'm setting backup server raspberry pi running raspbian communicate windows 7 pc. did program auto mounting external drive attached pi, after doing manual backup of files w7 pc. shared said mounting folder on samba , works great. the thing want use program called synkron on windows can monitor 2 or more folders, detec changes , copy on new/modified files periodically. however, when press "analyze", programs lists files (in ext drive) obsolete, , i've discovered problem samba (or pi itself) changing last modified date of files, substracting 3 hours each of them. when remove drive pi , re analyze connected pc files normal , show ok. this exact situation has happened 2 different sets of raspberrys, raspbian installations, external drives, windows pc , files. also, checked date on both pi's , correct every time. what do? :/ the raspberry pi doesn't have rt...

html - Trigger javascript action on click? -

i want trigger javascript code when button clicked. want when button clicked console.log() triggered. attempt: corel.html : <!doctype html> <html> <head> <title>corelation</title> <script src="jquery-1.11.3.min.js"></script> <script type="text/javascript" src="corel.js"></script> </head> <body> <form id="tablevar"> variable 1: <input type="text" id="var1"><br> variable 2: <input type="text" id="var2"><br> <button onclick="myfunction()">click me</button> <!-- type button not refresh --> </form> </body> </html> corel.js : console.log("iniating app ..."); function myfunction() { console.log('yeah'); } i not understand not work ? the button making form submit hence need use preventdefault() see de...

Fetch list of all apps on Android device (esp. Android TV) -

i'm trying fetch list of launchable apps on android tv (nexus player) running 5.1.1. private static set<resolveinfo> getinstalledappsfrom(packagemanager packagemanager) { set<resolveinfo> activities = new hashset<>(); activities.addall(launcheractivitiesin(packagemanager)); if (build.version.sdk_int >= build.version_codes.lollipop) { activities.addall(leanbackactivitiesin(packagemanager)); } return activities; } private static list<resolveinfo> launcheractivitiesin(packagemanager packagemanager) { intent intent = new intent() .setaction(intent.action_main) .addcategory(intent.category_launcher); return getresolveinfos(packagemanager, intent); } private static list<resolveinfo> getresolveinfos(packagemanager packagemanager, intent intent) { return packagemanager.queryintentactivities(intent, packagemanager.match_default_only); } @targetapi(build.version_codes.lollipop) private s...

r - Control outputted decimal places globally -

is there way globally control number of decimal places show in print output in r? globally, mean can run @ beginning of r session applies in session. default me appears 6 decimals don't need level of detail. accomplish using base r, without using round() or other formatting function @ prompt. for example, assume print 4 decimal places. therefore want 123.123 appear 123.1230, 123.123123 123.1231, , 123 123.0000, etc. digits() won't accomplish limits entire output number of digits specify.

Django Template render dictionary values into html form using Function Based View -

summary using django 1.8, i'm trying make function based view renders html page allows me update contents of object. i'm able work using form.as_p shown in documentation here , can't these values inside html <input> value . issue the issue first word appears , rest of text cut off (e.g. html input tag, value of 'hello world will' gets turned 'hello') model.py class questions(model.model): title = models.charfield(max_length=512, null=false, blank=false) forms.py class questionsform(forms.modelform): class meta: model = questions fields = ('title', ) views.py def advice_update(request, pk) question_results = questions.object.get(id=pk) advice_form = questionsform(request.post or none, instance=question_results) ... return render(request, 'advice/advice_update.html', {'advice_form': advice_form, 'question_results': question_results,}) advice_update.html ...

java - Nested Thymeleaf Templates in Spring -

short version how 1 supposed make nested templates in thymeleaf when using spring? appears asterisk notation not supported ( "*{mailingaddress}" ) inside th:object attributes in spring. there work-around / different tag use? long version for example, let's have these classes: class address { string street; } class person { address mailingaddress; address shippingaddress; } class order { int orderno; person customer; } so make address.html thymeleaf template: <span th:text="*{street}"></span> we test sample address . looks good. and make person.html thymeleaf template references address so: <span th:text="*{firstname}"></span> <span th:object="${person.shippingaddress}"> <span th:include="fragments/address :: address"></span> </span> and test example person. reference same template , set context ${person.mailingaddress} . far good. now let's make o...

android - Add Event Handler to ImageButton -

Image
i developing android app has imagebutton in it, , need add event handler it. in attempt this, have added new function .java file android studio creates when make new project looks this: public void tapimagebutton(imagebutton myimgbtn) { // code stuff come later on. } after doing this, trying set onclick proerty not show function, , trying enter manually causes app crash when test it. you must have view parameter of method wish call, while bind click event through layout file. try this: public void tapimagebutton(view view) { // code stuff come later on. toast.maketext(this, "clicked !!", toast.length_short).show(); } in xml: ... android:onclick="tapimagebutton" ...

function - Error when using reduce() in Swift 2.0 -

note: applies swift 3.0 when attempt use reduce function, error saying: reduce unavailable: call 'reduce()' method on sequence i figured out how enumerate() function cannot seem solve issue. here line of code returning error: var hashvalue: int { return reduce(blocks, 0) { $0.hashvalue ^ $1.hashvalue } } you fix same way fixed problem enumerate() . in swift 2, reduce has been removed global function , has been added instance method on objects conform sequencetype protocol via protocol extension. usage follows. var hashvalue: int { return blocks.reduce(0) { $0.hashvalue ^ $1.hashvalue } }

python - how to remove the "/digit" numbers from output -

i need remove patch-set numbers output meaning remove "/digit" 1293927/2 1293929/3 ,i have shown expected output below,the output should shown below should of type list.. how split this? sql_get = """select gerrit_id gerrits.gerrit_submit_table (si='%s' , component='%s' , release_bit = '0' , picked_bit = '0')"""%(si,component) #print sql_get rows = cursor.execute(sql_get) gerrits = cursor.fetchall() #print "gerrits" #print gerrits -->prints (('1293927/2',), ('1293929/2',)) print' '.join(item[0] item in gerrits).rstrip('\r\n') --> prints 1293927/2 1293929/2 output:- 1293927/2 1293929/2 expected output:- 1293927 1293929 use re module. import re print ' '.join(re.sub(r'/.*', '',item[0]) item in gerrits).rstrip('\r\n') or use string.split function. pri...

cartodb - how to detect polygons within other (many) polygons in postgis -

i have 2 datasets: 1. zipcodes , 2. neighborhoods (think of them counties). i want join each neighborhood zipcodes cover it. neighborhoods within 1 zipcode, in cases neighborhoods straddle two. example: neighborhood 1 inside 20001 neighborhood 2 inside 20002 neighborhood 3 inside 20001,20002 here have far: select name, zipcode neighborhood_names nn, dc_zipcode_boundries dzb st_intersects(nn.the_geom, dzb.the_geom); note: updated within based on comments, getting answer each neighborhood still not able array function respond expected. i figured out. john. statement needed group (whcih error said, needed time digest before clicked). the snippet below worked following select name, array_to_string(array_agg(zipcode), ',') neighborhood_names nn, dc_zipcode_boundries dzb st_intersects(nn.the_geom, dzb.the_geom) group name

php - Run Query of Wordpress in a Button Javascript - WPDB -

i want run javascript function javascript sending $variables when running single button, not how make connection of $wpdb javascript. any appreciated. http://code.tutsplus.com/tutorials/writing-custom-queries-in-wordpress--wp-25510 for example: $wpdb->update( 'foods', array( 'fruit' => 'apple', // string 'year' => 'value2' // integer (number) ), array( 'id' => 1 ), array( '%s', // value1 '%d' // value2 ), array( '%d' ) ); when press button in event onclick query run in javascript not how make connection base give run query.

tsql - How to skip showing results in HIVE Command Line? -

i have executed query in hive cli should generate around 11.000.000 rows, know result because have executed query in ms sql server management studio too. the problem in hive cli rows showing on over ( right know there more 12 hours since started execution ) , want know time processing, showed after showing results. so have 2 questions : how skip showing rows results in hive command line ? if execute query in beeswax , how see statistics execution time , similar set statistics time on in t-sql ? you can check using link given in log .but wont give total processing left.

c++ - Creating an array2D class crashing when compiling -

---------------------- repeated question in these lines array2d(int xres, int yres){ float **xtable; you declaring local variable. class member variable of same name remains uninitialized , use later. remove second line. also, member variables xres , yres not initialized either. use: array2d(int xresin, int yresin) : xres(xresin), yres(yresin) { xtable = new float*[yres]; for(int i=0;i < yres;i++) { xtable[i] = new float[xres]; } } also, change void getsize(int &xres, int &yres){} to void getsize(int &xresout, int &yresout) { xresout = this->xres; yresout = this->yres; } as expand class, keep in mind the rule of three , implement copy constructor , copy assignment operator. array2d(array2d const& copy) { ... } array2d& operator=(array2d const& rhs) { ... }

javascript - How to remap keyboard within the same textarea -

currently doing project remapping characters words detecting keyup function. unfortunately, have been able retrieve first character , remap word want. in project, need directly retrieve of keyboard input , directly convert word want within same textarea. example when type in textarea, convert "are" directly. don't know why stopped retrieving second character , remapping not function. below code, hope can tell me error. thank you. <textarea class="width-100" id="translated-text" onkeyup="myfunctionkey(event);" rows="10"></textarea> <script> function myfunctionkey(e) { conversion(); } function conversion(){ var x = document.getelementbyid('translated-text'); if(x.value == 'a'){ x.value='yes'; } if(x.value == 'q'){ x.value = 'are'; } } </script> from understand, want grab input , replace key stroke complete word. maybe do. i've changed onkeyup onkeyp...

audio - Where is corresponding /dev/dsp from Linux 2.6 in Linux 3.+? -

i got tutorial write /dev/dsp play audio, found no such device in linux 3.16. should do? /dev/dsp interface oss (open sound system) has been deprecated in favor of alsa sound system in 3.x , 4.x kernels.

c++ - map.find(var) isn't returning correct value -

sample code : map<char* , int> map; map["privilege"] = 1; char* code[]="privilege"; val = map.find(code); // returns map.end() val = map.find("privilege"); // returns correct value i need find value in map on basis of variable key : val = map.find(code); it returning map.end() please suggest something use std::string instead of char * since want save string value, not location. also, wouldn't use name "map" variable (since used) #include <map> #include <string> std::map<std::string, int> mymap; mymap["privilege"] = 1; std::string code = "privilege"; val = mymap.find(code); val = mymap.find("privilege");

javascript - call the same jQuery function in multiple link <a> -

i not familiar jquery. idea link href="..?episode=1" will add class active , while other link not add class active link href='..?episode=2" added class active , while other link not active add class similar other links. have code html <ul id="episode"> <li><a href="index.php?episode=1" class="active">1</a></li> <li><a href="index.php?episode=2">2</a></li> <li><a href="index.php?episode=3">3</a></li> <li><a href="index.php?episode=4">4</a></li> </ul> code js $(document).ready(function() { $("a").click(function(){ if($("a").text()!="1"){ $("a.active1").removeclass("active1"); $("a").addclass("active1"); alert($(this)).text(); } }) }) the prob...

javascript - multiple random images in let it snow plug-in -

i've been playing jason brown's let snow plug-in. code accommodates single custom image, , i've been trying figure out how change code accommodates multiple custom images within random range. !function($){ var defaults = { speed: 0, interaction: true, size: 2, count: 200, opacity: 0, color: "#ffffff", windpower: 0, image: false }; $.fn.let_it_snow = function(options){ var settings = $.extend({}, defaults, options), el = $(this), flakes = [], canvas = el.get(0), ctx = canvas.getcontext("2d"), flakecount = settings.count, mx = -100, = -100; canvas.width = window.innerwidth; canvas.height = window.innerheight; (function() { var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe || function(callback) { window.settimeout(callback, 1000 / 60); }; window.requestanimationframe = reques...

Python 2 compiler doesn't read the correct values after the 31st inputted value -

solving smoothing weather problem on codeabbey. prints correct output first 32 values after doesn't read inputted values correctly. inputted test values on 150. here code: from __future__ import division num=int(raw_input()); inp=((raw_input()).split(" ")); lists=[]; in inp: if inp.index(i)==0 or inp.index(i)==len(inp)-1: lists.append(inp[inp.index(i)]) else: a,b,c=0.0,0.0,0.0; a=float(inp[(inp.index(i))+1]) b=float(inp[inp.index(i)]) c=float(inp[(inp.index(i))-1]) x=(a+b+c)/3 x = ("%.9f" % x).rstrip('0') lists.append(x) in lists: print i, the index in following code return first occurrence of in inp. so, if there duplicate values in inp, whole logic fails. if inp.index(i)==0 or inp.index(i)==len(inp)-1: lists.append(inp[inp.index(i)]) the correct approach enumerate , correct indices: from __future__ import division num = int(raw_input()) inp...

Need info about return -<options> in TCL -

what options available in tcl return command ? see -code -errorcode -errorinfo options return command.. couldn't understand difference between them. proc new {} { set name george puts "hello $name" return -code ok } puts [new] here didn't output, normal return command. more option -code in return command break , continue, error , retun... use of options. , below code makes me confuse .. proc new {} { set name george puts "hello $name" return -code return -code return -code return } like can give more , didn't errored , use of option.. the options return listed on man page: return . -errorcode , -errorinfo , -errorstack , , -level used describe aspects of exception: -options allows 1 pass dictionary of exception data command. neither of these useful until have thorough understanding of language , writing advanced exception handling code. the -code option used specify kind of handling surrounding code need perform. ok means ...

angularjs - Jquery Time Picker inside ng-repeat is not working -

as proceeding project. in place need repeat few input fields contains 2 time html5 field. going when testing in chrome when tested in in firefox showing text field. (firefox not support time , date html5 fields). started finding plugin nothing worked requirements. so have wasted lot of time explaining requirements clearly. html code. <div class="row" ng-repeat="timingindex in timingsarray"> <div class="col-md-3"> <select class="form-control" ng-model="timings[$index].group"> <option value="pre-priary">pre-priary</option> <option value="primary">primary</option> <option value="middle">middle</option> <option value="senior">senior</option> </select> </div> <div class="col-md-2"> <select class="form-control" ng-model...

javascript - Accessing events defined on constructor - is this approach good? -

i have class manages tabs: function tabsmanager() {} when performing operations adding or removing tabs broadcasts events, example, active-tab-change . want make explicit possible events supported class, define them this: tabsmanager.events = { active_tab_change: "active-tab-change" } when subscribing tabs manager events, can specify event name this: tabsmanager.on("active-tab-change", function(){}); however, approach error prone since can misspell event name. use enumeration-like object events : tabsmanager.on(tabsmanager.events.active_tab_change, function(){}); the problem here if use dependency injection don't have direct reference object constructor, i've used approach: tabsmanager.on(tabsmanager.constructor.events.active_tab_change, function(){}); i've never seen approach used before, i'm curios whether it's feasible approach , whether it's been used in js frameworks/libraries?

hdfs - Hadoop Distributed File Systmes -

hdfs built around idea efficient data processing pattern write once, read-many-times pattern. can have real time example how hdfs write once , ready many times? wanted understand core concepts in deep. hdfs applications need write-once-read-many access model files. file once created, written, , closed need not changed. assumption simplifies data coherency issues , enables high throughput data access. mapreduce application or web crawler application fits model. (source: hdfs design ) hdfs built around idea files updated. rather, read data calculation, , possibly additional data appended files time time. example, airline reservation system not suitable dfs, if data large, because data changed frequently. (source: mining of massive datasets ) also see why hdfs write once , read multiple times?

c# - Unity 5 moving planets in a circular or elliptical path (orbits) -

i have: void update () { transform.rotatearound(transform.parent.position, new vector3(0, 1, 0), orbitspeed * time.deltatime); } which gives me basic circular orbit. what need varied elliptical orbits (planets generated randomly per star , give them random orbit paths)? you can't use rotatearound. have make own function try use: http://answers.unity3d.com/questions/133373/moving-object-in-a-ellipse-motion.html x, y: center of ellipse a, b: semimajor , semiminor axes the code: var : int; var b : int; var x: int; var y : int; var alpha : int; var x : int; var y : int; function update () { alpha += 10; x = x + (a * mathf.cos(alpha*.005)); y= y + (b * mathf.sin(alpha*.005)); this.gameobject.transform.position = vector3(x,0,y); } edit: if want orbit object use: this.gameobject.transform.position = anotherobject.transform.position + vector3(x,0,y);

list - Dictionary int, myclass -

that's class public class personelatama { public int personelid { get; set; } public int yonetimtalepid { get; set; } public bool durum { get; set; } } i want do dictionary<int,list<myclass>> dictionary<int, list<personelatama>> personelatamalistesi = new dictionary<int, list<personelatama>>(); how insert list personelatamalistesi.add how assignments made personelatamalistesi[0][1] personelatamalistesi.add(0,new personelatama() { personelid = personelid, yonetimtalepid = yonetimtalepid, durum = false }); assignment list , how use again i want add list , component values achieve. want sample code. you have list tvalue so: personelatamalistesi.add(0, new list<personelatama>() { new personelatama() { personelid = 1, ...

java - Display captcha in Jframe -

i want create application registration in java, want submit information website. experiment information registration(e.g username, password) submit request. want integrate captcha registration , want display on jframe , submit answer along side other data. have no idea how captcha image, , submit data. think use new recaptcha(where ask select foods). ideas how this? edit: know how display image jlabel, able find way extract get image captcha session .now i'm wondering how send response. to send response need session id server , clients answer send request server both of values public void getmethod() throws ioexception { string useragent = "java/" + runtime.class.getpackage().getimplementationversion(); //the server need know "question" answering sent captha , sesion id //example random 1 need figure out how sesion id string captchasesionparam = "captchasesionid="; string captchasesionid = u...

r - RStudio HiDPI support -

rstudio great ide r development. wonder if there way nice support hidpi resolution? have 13 inch display , 3200x1800 resolution, hard read rstudio options adjust more appropriate setting. of course not rstudio issue general issue related high resolution display requires hidpi support make reasonably usable. posting here question because rstudio still doesn't allow fill questions/issues on github. rstudio qt application. i've solved setting scaling factor in qt environment variable (note must integer): export qt_device_pixel_ratio=2 the arch wiki has excellent advice on getting hidpi working .

javascript - Making a simple slider -

how can make slider, 1 multiple photos through can navigate arrows? i have images , arrows in page. should hide images , when arrow clicked hide current image , display next/prev? i have images in list. i think should go it. make own, it's best way learn how things work. here's guide simple show/hide box arrows: hide images css. show image class current . use jquery on load function add current class first element (you can handle preload or here) on arrow click assign current image variable var current = $('.imgclass.current') , remove current class images ( $('.imgclass').removeclass('current') ), , add current.next() or .prev() . if next() or prev() undefined, add element number 0 or $('.imgclass').length - 1 accordingly ( $('.imgclass').eq(n).addclass('current') ).

java - MQTT topic match evaluation -

i'm implementing android application using mqtt (paho). have components have compare subscribed topic includes wildcards acutal topic client has published to. i don't head around , "rudimentary" regex-skills don't helpt either... is there utility class in paho/java mqtt see if "sensor/temperature/+/degree/#/id" (subscribed topic) is applies to "senor/temperature/garden/degree/celsius/abovezero/id" (actual topic)? does know best way that? thank you! edit: hi there - think should right public static boolean comparetopic(final string actualtopic, final string subscribedtopic){ return actualtopic.matches(subscribedtopic.replaceall("\\+", "[^/]+").replaceall("#", ".+")); } your solution should work in case of example regular expression "sensor/temperature/[^/]+/degree/.+/id" a website http://www.regexplanet.com/advanced/java/index.html resource cases this. ...

sas - How to split one variable into multiple rows -

**application_id reaon_code value** 123 ab31ab45 £500 124 ab43rd49ty87 £640 125 rt87 £900 126 cd19rv29 £1000 what want separate reason_code variable taking subset of this, each reason has 4 character , combine 2 letters , 2 numbers, the dataset want following: application_id reason_code value 123 ab31 £500 123 ab45 £500 124 ab43 £640 124 rd49 £640 124 ty87 £640 145 rt87 £900 hope make sense. 2nd question, want create flag sho...

can't load php file with jquery and access variable outside the file -

if load php file (home.php) via jquery, can't seem able access $var in home.php file. loads succesfuly "undefined" error: ( ! ) notice: undefined variable: var in /media/sf_sandbox/linksup/view/home.php i have done in exact same order. declare variable: index.php <?php $var = "bar"; ?> i load file home.php .load(): index.php <div id="contentcontainer"> <script> $( "#contentcontainer" ).load( "view/home.php" ); </script> </div> i try value of $var in home.php: home.php <div class="row"> <div class="col-md-12"> <h2>home</h2> <?php echo $var?> </div> </div> why using jquery purpose. php include_once() easily. in home.php below:- <?php include_once('index.php');?> <div class="row"> <div class="co...

sql - update database java -

Image
i'm working on database containing 2 columns (nom (string) ,tmp(integer)). when tried update , first row became last. can update , maintain same order? statement state = conn.createstatement(resultset.type_scroll_sensitive, resultset.concur_updatable); resultset result = state.executequery("select * cities"); result.absolute(1); result.updatestring("nom", "xxx"); result.updaterow(); here's databasebefore , after excution of code. the results displayed ordered primary key. since changed primary key nom field ordering changed well.