Posts

Showing posts from January, 2011

sql - Storing Schedule Information -

i need create table hold schedule meetings. meeting can scheduled be: daily 'ever x days'. x can between 1 , 6. ending after x sessions. 'sessions' number of repeats. weekly days during week can occur. mon, tue, etc. can select more 1 day per week. date on ends. monthly use can select day of month can occur (1st, 2nd etc) or can select lookup of '1st, 2nd, 3rd, 4th or last' , day 'mon, tues', saying, example "the 2nd friday" of month. how can store these scenarios in single table? i thinking: create table schedule ( id int not null identity(1,1) primary key, startdate datetime not null, endtime time null, repeattypeid int not null, // daily, weekly, monthly, none // daily everydaycount int null, // handle 'every 3 days', repeatcount int null, // how many occurances. can shared different repeattypes // weekly ismonday bit, istuesday bit, etc // field per day selection. there better way?

meteor - this.userId not displaying user -

i'm publishing users , second collection called joboffers. joboffers collection stores userids employer , candidate. candidate name display next joboffer, admin page, nothing seems work. of joboffers display not candidate name. in console object . path: publish.js // publish jobs admin view meteor.publish('alljobs', function () { return joboffers.find({}); }); meteor.publish('alluserswithjobs', function () { var offers = joboffers.find({}, {fields: {candidateuserid: 1}}).fetch(); var ids = _.pluck(offers, 'candidateuserid'); options = { fields: {username: 1, emails: 1, "profile.firstname": 1, "profile.familyname": 1 } }; return meteor.users.find({ _id: { $in: ids } }, options); }); path: alljoboffers.js template.alljoboffers.oncreated(function() { meteor.subscribe("alljobs"); meteor.subscribe("alluserswithjobs"); }); template.alljoboffers.helpers({ alljoboffers: function(

inheritance - calling parent constructor with more parameters than the child's one in c++ -

class parent{ public: parent(string a, int i, int j, int k): name(a), num1(i), num2(j), num3(k){} ~parent(){} ... //other member functions ... protected: string a; int num1, num2, num3; }; class child : public parent{ public: child(string a, int i, int j): parent(???){} //how should initialise base class? ~child(){} .... //other member funcitions .... } in above classes, parent got more data members child, many of member functions inherited parent. don't know whether there way call parent constructor have more parameters child constructor. the child can provide whatever values needs additional parameters, eg: class child : public parent { public: child(string a, int i, int j): parent(a, i, j, 12345){} ... };

simple form - rails gem Simple_form installation is not working -

i using rails 4.2.4 , trying use simple_form right view gives error: undefined method `simple_form_for' #<#<class:0xbbc2748>:0xbbc1460> gem list returns list of gems , includes simple_form. installed simple_form typing gem install simple_form $gem list returns simple_form (3.2.1) i have tried , got this: rails generate simple_form:install --bootstrap not find generator 'simple_form:install'. maybe meant 'responders:install', 'rspec:install' or 'devise:install' run `rails generate --help` more options. does know how fix issue? if installed via gem install didn't add rails application. instead, need add gemfile , @ the documentation . gemfile: gem 'simple_form' then run bundle install , continue installation github page.

dataframe - Union of data frame in R -

i have 4 dataframes in list l below: l[[1]]: v1 v2 b c b z b l[[2]]: v1 v2 b d b z b l[[3]]: v1 v2 z y x z n z l[[4]]: v1 v2 z j x z n z this come graph head c,d,y, , j. obviously, c , d same graph, y , j. how can merge c d , y j given these dataframes in list l? what i'm thinking is, iterate list , pairwise comparison. if dfx intersect dfy merge. can r code? edit: i'm thinking this: first element, compare second, if okay, merged , save first element, remove second element, move next element until last. repeat until remaining element not removed. this, list consist of remaining element has been merged know how implement in code? output expected : l[[1]]: v1 v2 b c b d b z b l[[2]]: v1 v2 z y z j x z n z could approach solution you? # create list of data.frames ld <- list( data.frame(v1 = c("b","a","z"), v2 = c("c","b"

How to get all of html's source code in webview, android? -

i know way, view.loadurl("javascript:window.local_obj.showsource('<head>'+" + "document.getelementsbytagname('html')[0].innerhtml+'</head>');"); but looks give <head> tag. if want all source codes, include comments in <!-- comments--> , should do?

node.js - Aggregate works in command line but not with mongoose -

i trying find out why aggregate command works in mongodb not in mongoose: db.providers.aggregate({$geonear{near[-117.67625427246094,33.58256912231445], distancefield: "dist", spherical: true, maxdistance: 71591.87002706563, query{type_id:1}}}).pretty(); the following returns single row: "provider_id" : 1366826512, "providername" : "dover xxxx", "loc" : { "type" : "point", "coordinates" : [ -117.9081489, 33.6195128 ] }, "dist" : 0.003432172265332921 but same command not return mongoose. provider.aggregate([ { $geonear: { near: { type: "point", coordinates: [parsefloat(platlngarray[0]), parsefloat(platlngarray[1])] }, distancefield: "dist", spherical: true, //distancemultiplier: 3963.2, maxdistance: parsefloat(pradius),

objective c - ARC behavior on assigned local variable to an instance variable -

question 1 supposed have code: myclass * __strong foo = [myclass new]; myclass * __strong bar = foo; // foo = nil; // arc? in reference this answer , arc automatically nil out foo on line 3 since bar acquired reference? question 2 //ecgservice.m @property (strong) muttablearray *rridata; (muttablearray *)getrridata { return _rridata; } //algorithmtest.m // according apple docs, local variable marked __strong default muttablearray *rridata = [self.ecgservice getrridata]; for(nsnumber *rri in rridata) { // use rri! } // rridata = nil; should nil out local variable rridata after using it? and, __strong attribute must applied 1 instance of object? answer 1. in principle, arc doesn't “nil out” foo until goes out of scope. when goes out of scope, arc releases reference. doesn't have set foo nil, effect if arc set nil. in practice, arc allowed release reference held foo after last use of foo variable, may long before goes out of scope.

swift - New Xcode 7.3 error - Ambiguous us of 'view' -

the following code worked prior upgrading xcode 7.3; func mymethod() { let tapgesture = uitapgesturerecognizer(target: self, action: #selector(createbuttonobject.notifybuttonaction(_:))) let longpressgesture = uilongpressgesturerecognizer(target: self, action: #selector(createbuttonobject.notifybuttonaction(_:))) tapgesture.numberoftapsrequired = 1 } @ibaction @objc func notifybuttonaction (sender: anyobject) { let userinfo:dictionary<string,anyobject!> print("sender tap or longpress: \(sender)") **let button = sender.view as! uibutton** let soundname = button.currenttitle! userinfo = ["sender" : sender] nsnotificationcenter.defaultcenter().postnotificationname(sleepezbuttonactionnotificationkey, object: nil, userinfo: userinfo) ddlogdebug("createbuttonobject.notifybuttonaction: notificaiton! buttonviewcontroller") ddlogdebug("createbuttonobject.notifybuttonactio

ruby on rails - How to define a link path -

i'm trying figure out how make app rails 4. keep getting stuck on basic things , don't seem able identify principles use going forward. i have profile model , industry model. associations are: profile: has_and_belongs_to_many :industries, join_table: 'industries_profiles' industry: has_and_belongs_to_many :profiles, join_table: 'industries_profiles' in profile show page, i'm trying link industry page: <% @profile.industries.limit(5).each |industry| %> <%= link_to industry.sector.upcase, industry_path(@industry) %> <% end %> i can't find works link. i have tried following: industry_path(@profile.industry) industry_path(@profile.industry_id) industry_path(industry) industry_path(profile.industry) industry_path(industry.id) industry_path(industry_id) but of them guesses. don't know how ready api dock can't understand of content. can see how link show page of other side of habtm association sing

python - Pyodbc- If table exist then don't create in SSMS -

i trying like: import pyodbc cnxn = pyodbc.connect(driver ='{sql server}' ,server ='host-mobl\instance',database ='dbname', trusted_connection = 'yes' ) cursor = cnxn.cursor() cursor.execute("""select * information_schema.tables table_name = n'tablename'""") def checktableexists(cnxn, tablename): cursor = cnxn.cursor() cursor.execute(""" select count(*) information_schema.tables table_name = '{0}' """.format(tablename.replace('\'', '\'\''))) if cursor.fetchone()[0] == 1: cursor.close() return true cursor.close() return false if checktableexists == true: print ("already") elif checktableexists == false: print ("no") but there nothing happen, can me on this? using micrsoft sql server management studio 2014 express version. code run in python. thank

javascript - Upload video file from google storage bucket to youtube programmatically -

i'm developing video uploader , want upload video file google storage bucket youtube channel. know how use youtube's apiv3 upload video local machine, can't figure out how file google storage bucket , upload youtube. there way this? if so, how do or find more information?

java - How to fix stack? (more specific in description) -

import java.io.*; import java.util.*; public class cookiemonster1 { public static int [][] maze; public static int counter; public static stack<cookieposition> path; public static cookieposition poslast2; public static void main(string[] args){ path = new stack<cookieposition>(); cookieposition poscurrent = new cookieposition(); poslast2 = new cookieposition(); path.push(poscurrent); maze = getmaze(); counter = maze[0][0]; system.out.print(path); while(poscurrent.getx()!=11 && poscurrent.gety()!=11) { poscurrent = move(poscurrent); // make move // output maze-just check if working for(int row=0; row<maze.length; row++) { for(int col=0; col<maze[row].length; col++) { if(poscurrent.getx()==row && poscurrent.gety()==col) system.o

Error:The connection to the server was unsuccessfull(fake) in Angularjs App -

i creating angular app intel xdk.i have data on local storage.when run app in offline message appear after few minutes "application error:the connection server unsuccessful(fake)" , stop application spontaneously.how manage this.i expect hopeful solution recover this. app.js $scope.checkconnection=function() { var networkstate = navigator.connection.type; if(networkstate == connection.none){ $scope.footer_message = "no network connection"; return false; }else{ $scope.footer_message = "obidos technologies (p) ltd"; return true; } } $scope.checkconnection(); if seeing inconsistent/transient error messages saying [connection server unsuccessful “www/assets/index.html”] when starting app. caused app timing out. can either increase time-out time, reduce frequency of issue, or can:

ios - How to stop downloading a youtube video in XCDYouTubeClient? [Swift] -

i'm making job company requires user view videos youtube. has player, , i'm using xcdyoutubeclient download videos, if tap on cancel button, ios continues downloading video, consuming user data plan unnecessarily. here's code far: xcdyoutubeclient.defaultclient().getvideowithidentifier(videoid) { [weak playerviewcontroller] (video: xcdyoutubevideo?, error: nserror?) in if let streamurl = (video?.streamurls[xcdyoutubevideoqualityhttplivestreaming] ?? video?.streamurls[xcdyoutubevideoquality.hd720.rawvalue] ?? video?.streamurls[xcdyoutubevideoquality.medium360.rawvalue] ?? video?.streamurls[xcdyoutubevideoquality.small240.rawvalue]) { //play video } } else { //dismiss player } } then have function when user press cancel: func playerdonebuttontouched() { //dismiss player } i belive in function need have code stop do

javascript - Append textarea new line text as anchor text -

weave = http://kodeweave.sourceforge.net/editor/#4c11169c009d3096f896798b8b28e088 i have textarea.libraries consists of following value (this changes depending on user input). https://necolas.github.io/normalize.css/4.1.1/normalize.css https://leaverou.github.io/prefixfree/prefixfree.js http://ajax.googleapis.com/ajax/libs/mootools/1/mootools-yui-compressed.js https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.js i know can detect number of lines textarea has using simple loop... for (i = 0; <= $(".libraries").val().split("\n").length - 1; += 1) { // every new line appends anchor $(".assets").append('<a class="block" href="javascript:void(0)">'+ +'</a>') } in case... when anchors appended how can grab first line being normalize link first anchors text, prefix-free second, , on? if you're still confused. i'm trying take value... https://necolas.github.io/normalize.cs

c# - Xelement adds element value to itself twice -

in code iterate through xelement , have return value of each node within element e.g. foreach(xelement n in xdocument.descedants("element_name) { console.writeline("searching: " n.value); } my problem both <directory> elements returned in string searching: c:\users\215358\onedrive\musicc:\users\215358\dropbox\music my xml file looks this: <?xml version="1.0" encoding="utf-8"?> <directories> <directory>c:\users\215358\onedrive\music</directory> <directory>c:\users\215358\dropbox\music</directory> </directories> i expect output second line element in <directory> this: c:\users\215358\dropbox\music why happening? xelement.value gets concatenated text contents of element . includes text of child elements not helpful. if want text current element, can find text node in child nodes. foreach(xelement n in xdocument.descedants("directory")) { var t

mysql - Update wordpress database table with multiple where clauses -

i trying update 1 row of database multiple clause not working. here code... $wpdb->update( 'wp_cf_form_entry_values', array( 'value' => 'example', // string ), array( 'entry_id' => '$entryid' , 'slug' => 'code' ), array( '%s', // value1 ), array( '%d', '%s' ) ); ok got solution earlier. posting future viewers. problem in 6th line. 6th line array( 'entry_id' => '$entryid' , 'slug' => 'code' ), i make below changes in 6th line... array( 'entry_id' => $entryid, 'slug' => 'registration'), now whole update query 2 clause looks below .. $wpdb->update( 'wp_cf_form_entry_values', array( 'value' => $regcode //entering data in value field ), array( 'entry_id' => $entryid, 'slug' => 'registration'), //two

File Upload & Delete in asp.net -

how can upload file without clicking submit button & how delete uploaded file in asp.net? can upload can't delete uploaded file.my code behind source: public partial class webform1 : system.web.ui.page { protected void page_load(object sender, eventargs e) { } public void uploaddocument(object sender, eventargs e) { fudocument.saveas(server.mappath("~/documents/" + path.getfilename(fudocument.filename))); lblmsg.visible = true; } } } to upload file, can use javascript - there many examples of on , web in general. such as: https://cmatskas.com/upload-files-in-asp-net-mvc-with-javascript-and-c/ you "can't delete" file. how trying delete , happens when try? if it's exception, message , stack trace?

What value actually need to provide {item-path} in view.delta OneDrive for Business API -

i using /drive/root:/{item-path}:/view.delta getting changes of file in onedrive business in root folder. have tried path /drive/root:/files/filename:/view.delta response resource not found. can please explain value ? the link following below. more details the error suggest /files/filename not exist, if did you'd run limitation of how view.delta works onedrive business. make long story short, it's limited working on root of drive, i.e. /drive/root/view.delta . using path you'll changes items within drive, not 1 you're interested in. given you're trying detect changes in single file may want consider standard metadata request if-none-match header contains etag of last state application saw. for example, you'd first make request without additional headers initial state: request: get /_api/v2.0/drive/root:/file/filename response: 200 ok { ... "name": "filename", "etag": "\"aasdfasdf\&

php - repeated loop in wordpress blog page how to solve this? -

how list 10 post in 1 page , solve pagination, found repeated loop in this. i want apply css in comment . how can separate comments each part , can give individual css? <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?> <?php if( have_posts() ): ?> <?php while( have_posts() ): the_post(); ?> <div id="post-<?php get_the_id(); ?>" <?php post_class(); ?>> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( array(200,220),'thumbnail', array( 'class' => 'alignleft' ) ); ?></a> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <span class="meta"><?php //author_profile_avatar_link(48); ?> <strong><?php the_time('f js, y'); ?><

Android MVP architecture standard for loading UI with Model class having android resource -

i following mvp architecture in application. homeactivity contains sliding panel list icon having selector upon selecting sliding panel item icon state changed , not using list selector. i keeping model class navitemdata populating navigation drawer , using class slidingpanelitemselector extends statelistdrawable generates appropriate selector sliding panel icon. in mvp architecture have presenter class communicates model , generates input views. in case if using presenter getting data sliding panel calling class presenter using android context that's approach, or we having alternative solution strictly following mvp architecture? currently using viewbinderutils class , injected directly activity class , gets list of data sliding panel. following mvp architcture? slidingpanelitemselector.class public class slidingpanelitemselector extends statelistdrawable { private context mcontext; public slidingpanelitemselector(context mcontext){

java - Base64 image data is not getting in android -

i using httpurlconnection connect server , response contains base64 image data. when trying read response using getinputstream not reading complete response, breaks in between. response contains list of objects in json format , each object contains base64 image data. reading breaks while trying read first image data first object. though not showing error displays till half of image data.how full response?? here code inputstream = httpurlconnection.getinputstream(); byte[] b = new byte[1024]; stringbuffer buffer=new stringbuffer(); while ( is.read(b) != -1){ buffer.append(new string(b)); system.out.println("read= "+is.read()); } system.out.println(buffer); have tried example code google ? url url = new url("http://www.android.com/"); httpurlconnection urlconnection = (httpurlconnection) url.openconnection(); try { inputstream in = new bufferedinputstream(urlconnect

drupal 7 - HTML5 video (video.js) not loading in Chrome (2) -

this same question html5 video (video.js) not loading in chrome not resolved. on chrome mp4 source same message in console: array[2] 0: "video error" 1: object at_target: 2 ab: function c(){return f} blur: 8192 bubbling_phase: 3 capturing_phase: 1 change: 32768 click: 64 dblclick: 128 dragdrop: 2048 focus: 4096 keydown: 256 keypress: 1024 keyup: 512 mousedown: 1 mousedrag: 32 mousemove: 16 mouseout: 8 mouseover: 4 mouseup: 2 none: 0 select: 16384 bubbles: false cancelbubble: true cancelable: true clipboarddata: undefined currenttarget: video#videojs-306-field-video-file-video_html5_api.vjs-tech defaultprevented: false eventphase: 2 initevent: function initevent() { [native code] } lc: function d(){return l} preventdefault: function (){e.preventdefault&&e.preventdefault();a.returnvalue=l;a.yb=c} relatedtarget: undefined returnvalue: true srcelement: video#videojs-306-field-video-file-video_html5_api.vjs-tech stopimmediatepropagation: function (){e.stopimmediat

javascript - Using a select box to swap classes between divs -

i have 5 divs, each containing select box lists divs. trying make when use select box swaps class of div using the div selected. i have set classes change column position using css flex. so far work correctly on first change not on after that. doing wrong here? fiddle: https://jsfiddle.net/wd9vrfmn/ jq: var col = ['col1', 'col2', 'col3', 'col4', 'col5'] //list of classes $("select").change(function(){ var prevclass = $(this).parent().attr('class'); var nextclass = col[$(this).val() - 1]; $(this).val($(this).find('option[selected]').val()); $('div.' + prevclass).removeclass(prevclass).addclass("col0"); $('div.' + nextclass).removeclass(nextclass).addclass(prevclass); $('div.col0').removeclass("col0").addclass(nextclass); }); the value of options not getting updated. have added following code: var previd = $(this).parent().

office365 - Skype for Business has a Meet Now Url that I can send to my attendees? -

back in hey days (live meeting) there meet url 1 send attendees can join meeting. signed skype business , i"m looking "meet now" url can't find it. i need url have attendees join video conferencing call. need send via email. know can find url or construct one? thanks beside settings button, there down arrow , click on it. find 'meet now' option in that.click on it, dialog box pop namely 'join meeting audio'.select "use skype business" radio button , click ok. on bottom-right side, there image, on hovering on , can read more options.click on it,from list of options , select 'meeting entry info'. can meeting url there.

sql - How to make efficient pagination with total count -

we have web application helps organizing biological experiments (users describe experiment , upload experiment data). in main page, show first 10 experiments , below previous next 1 2 3 .. 30. i bugs me how make efficient total count , pagination. currently: select count(id) experiments; // not efficient in large datasets but how scale when dealing large datarecords > 200.000. tried import random experiments table, still performs quite ok (0.6 s 300.000 experiments). the other alternative thought add addtional table statistics (column tablename, column recordscount) . after each insert table experiments increase recordscount in statistics (this means inserting 1 table , updating other, using sql transaction of course). vice versa goes delete statement (recordscount--). for pagination efficient way where id > last_id sql uses index of course. there other better way? in case results filtered e.g. select * experiment name 'name%' , option table statistics

How to manipulate number in Redis using Lua Script -

i trying multiply 2 numbers stored in redis using lua script. getting classcastexception. point out wrong in program jedis.set("one", "1"); jedis.set("two", "2"); string script = "return {tonumber(redis.call('get',keys[1])) * tonumber(redis.call('get',keys[2]))}"; string [] keys = new string[]{"one","two"}; object response = jedis.eval(script, 2, keys ); system.out.println(response); throws exception in thread "main" java.lang.classcastexception: java.lang.long cannot cast [b @ redis.clients.jedis.jedis.getevalresult(jedis.java:2806) @ redis.clients.jedis.jedis.eval(jedis.java:2766) @ com.test.jedis.script.simplescript.main(simplescript.java:18) you can't cast table number in lua. want grab number of elements in table instead. can using last element point # . also, i'd highly recommend separating out lua script rest of code, it's cleaner. lua scrip

How to sleep forever only using C++11 -

yes, use sleep() in windows or pause() in posix, , goes on. how sleep using c++11? thought there way, joining calling thread using std::this_thread std::this_thread has no join() method unlike pthread functions. not mention can't handle signals c++11 , know how iterate sleep forever below: while(true) std::this_thread::sleep_for(std::chrono::seconds(1)); however, can see, it's not elegant @ all. code still consumes cpu time. scheduler has care process. use conditional variable or promise, again takes bit of memory or wouldn't work on os(it throw exception avoid deadlock). maybe equivalent of sleep(infinite) of windows: while(true) std::this_thread::sleep_for(std::chrono::hours::max()); but many it's not practical. could think of brilliant way? there 2 ways can think of. one, @guiroux mentions sleep_until non-reachable time: std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::hours(std::numeric_limits<int&g

jquery - How to apply autocomplete in a textbox of gridview .I am creating dynamic row of gridviwew -

<script type="text/javascript"> //alert('hi gridview'); $(document).ready(function () { $('table[id$="gvproduct"] input.txtprodtype').autocomplete({ source: function (request, response) { $.ajax({ type: "post", url: "/tally/saletest.aspx/autocompleteprodtype", //data: "{'searchtext':'" + document.getelementbyid('<%=gvproduct.clientid %>').find('input:text[id$="txtprodtype"]').value + "'}", data: "{ 'searchtext' : '" + request.term + "'}", contenttype: "application/json; charset=utf-8", datatype: "

javascript - How to read a js script file from cjs chrome extension -

Image
i installed google chrome extension cjs (custom javascript website). the script working fine if writting script inside cjs editor: i wrote script in js file , put in iis following: open iis manager right-click default web site add application alias = googlescript physical path: c:\scripts\google (for example) i created googlescript.js file , saved in c:\scripts\google. content of file is: alert("google") ; i clicked on connect , select application user (pass-through authentication) i opened default document located in googlescript (in iis) , add new default document named: googlescript.js when right-click on googlescript , select manage application->browse , new web page being opened script wrote. url of page http://localhost/googlescript/ now cjs extension, instead of alert("google"); wrote //localhost/googlescript/googlescript.js; . when calling script file, alert not working anymore. correct way call script file cjs chrome exten

java - HTTP Status 500 - No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode -

i know question has been asked lot of times. have searched entire stack overflow, haven't been able out of it. understand exception arises when column name used in query different property specified in bean class, however, both of parameters same. complete error: java.lang.illegalstateexception: no data type node: org.hibernate.hql.internal.ast.tree.identnode +-[ident] identnode: 'iduserinfo' {originaltext=iduserinfo} this query: list<object[]> tuples = session.createquery( "select iduserinfo, sum(points) " + persistentclass.getname() + " group iduserinfo " + "order sum(points) desc").list(); and bean class: @xmlrootelement @entity @table(name = "userinfo") public class userinfo { protected @xmlelement int id; protected @xmlelement int iduserinfo; protected @xmlelement int idquestion; protected @xmlelement string location; protected @xmlelement string state; protected @xmlelement stri

java - jLabel.setVisible(true) doesn't work -

public class game extends javax.swing.jframe { arraylist<integer> numere = new arraylist<>(); arraylist<bila> balls = new arraylist<bila>(); arraylist<string> culori = new arraylist<>(); arraylist<jlabel> colours = new arraylist<>(); random random = new random(); jframe frame = new jframe("display image"); jpanel panel = (jpanel)frame.getcontentpane(); int nrballs=0; public void createcolours(){ for(int i=0;i<7;i++){ culori.add("portocaliu"); culori.add("rosu"); culori.add("albastru"); culori.add("verde"); culori.add("negru"); culori.add("galben"); culori.add("violet"); } } public void createnumbers(){ for(int i=1;i<50;i++){ numere.add(i); } } public void createballs(){ while(nrballs<36){ int indx =random.nextint(numere.size()); int nr = numere.get

iphone - Memory warning results in crash when creating layers with images -

i'm creating app takes photo each second , saves image disk. when enough photos has been taken, app creates video of images using avfoundation framework. done creating layer each image, add animation hides layer after time combine these layers single layer held avvideocompositioncoreanimationtool . after creating avvideocomposition holds animation tool, end using avassetexportsession export avmutablecomposition . however, while creating layers app give 2 memeory warnings , crash if have 50-60 photos or more. use below code create layers. means 60 images, below loop run 60 times. once each image. imagelayer created contents of photo, animation applied layer , layer added sublayer layer . calayer *layer = [calayer layer]; layer.frame = cgrectmake(0.0f, 0.0f, rendersize.width, rendersize.height); layer.bounds = cgrectmake(0.0f, 0.0f, rendersize.width, rendersize.height); (nsstring *imagepath in imagepaths) { cmtime endtime = cmtimeadd(cursortime, cmtimemake(1.0f, (cgf

php - Insecure form post value validating -

currently i'm using form post "comment" , save in database there 2 hidden fields, 1 check component comment made on , other hidden field comment number. found exploit in own form. if go developer console can change them either crosspost comments other form, or doesn't exist, doesn't matter, nor fact can change number comment is, because still works if there's comment same number. <form action="/index.php?option=com_comments&view=comment&row=<?= $row ?>&table=<?= $table ?>" method="post"> <input type="hidden" name="row" value="<?= $row ?>" /> <input type="hidden" name="table" value="<?= $table ?>" /> <textarea type="text" name="text" class="control control--textarea control-group__control" placeholder="<?= translate('add new comment here ...') ?>" id="new-commen

javascript - Jenkins plugin advanced development -

i trying create advanced feature in jenkins plugin no idea start. i wanted create table has dynamically row added checkbox in 1 column , value of selected checkboxes. please me out for. a) generate dynamically table. b) add checkbox in column , checked value. after week of rnd. jenkins tag library not provided control has 1 control make happy. <f:block></f:block> in block can create table or other html controls. for dynamically created rows , coloumns should use javascript in <script /> tag not requried type in html. guys tried jquery jenkin stapler not allow this, because sign of dollar used stapling classes in jenkin. if know data generating dynamic row that's ok. if data came server side have implement ajax functionality. for ajax functionality in jenkins use link. " https://wiki.jenkins-ci.org/display/jenkins/ajax+with+javascript+proxy "

java - why am i getting a "cannot resolve method" error on getApplication? -

i believe have code in order ive been toiling on error few hours now. im trying setup basic app framework using fragments. can code work if structure project activity based , put string data along block of code below in mainactivity, doesnt me try move them fragments. in mainactivity (where same block of code works without using fragments) placed in oncreate makes no difference if place there in fragment , read placing in oncreate not proper place. im new android development, if explain answer code example greatly. thank taking time look. my entire fragment below. public class basicspagefragment extends fragment { recyclerview recyclerview; private recycler_view_adapter adapter; public basicspagefragment() { // required empty public constructor } @override public void oncreate(bundle savedinstancestate) { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layou

c# - Change background color of item after visiting -

i have following code: <itemscontrol grid.row="1" itemssource="{binding activities}"> <itemscontrol.itemspanel> <itemspaneltemplate> <ctrls:alignablewrappanel maxwidth="400" horizontalcontentalignment="center" horizontalalignment="center" /> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemcontainerstyle> <style targettype="contentpresenter"> <setter property="horizontalalignment" value="center" /> </style> </itemscontrol.itemcontainerstyle> </itemscontrol> now have background color of each item has

java - Error when run Jitsi for android source -

i've got error when run jitsi android source. got source here the error 10-17 22:21:07.150: e/androidruntime(14134): fatal exception: main 10-17 22:21:07.150: e/androidruntime(14134): process: org.jitsi, pid: 14134 10-17 22:21:07.150: e/androidruntime(14134): java.lang.noclassdeffounderror: net.java.sip.communicator.util.logger 10-17 22:21:07.150: e/androidruntime(14134): @ org.jitsi.android.jitsiapplication.<clinit>(jitsiapplication.java:42) 10-17 22:21:07.150: e/androidruntime(14134): @ java.lang.class.newinstanceimpl(native method) 10-17 22:21:07.150: e/androidruntime(14134): @ java.lang.class.newinstance(class.java:1208) 10-17 22:21:07.150: e/androidruntime(14134): @ android.app.instrumentation.newapplication(instrumentation.java:990) 10-17 22:21:07.150: e/androidruntime(14134): @ android.app.instrumentation.newapplication(instrumentation.java:975) 10-17 22:21:07.150: e/androidruntime(14134): @ android.app.loadedapk.makeapplication(loadedapk.java