Posts

Showing posts from June, 2010

mysql - extracting a zip file and accessing each content of the zip file and then move it to a new location in php -

i trying build application have upload zip file , extract contents , put them mysql database.i halfway successful in doing so..that uploaded zip file temporary folder named uploads....now want accessing each individual content , put in formation database , move real content original upload folder real_uploads....i trying iam not able figure out how proceed.... following below code........ <?php if(isset($_files['zip'])){ //defined error erray $errors=array(); $zip = new ziparchive(); //print_r($_files['zip']); //taking extention of last file (in lower case) of zip file if(strtolower(end(explode('.',$_files['zip']['name'])))!=='zip'){ $errors[]="this not zip file"; //echo "file not opened"; } //if file bigger 100mb if($_files['zip']['size']>104857600){ $errors[]="there size limit of 100 mb"; } if($zip->open($_fil

asp.net mvc - How to login using email in identity 2? -

in mvc5 identity 2 signinmanager.passwordsigninasync take user name login. var result = await signinmanager.passwordsigninasync(model.email, model.password, model.rememberme, shouldlockout: false); but user name , email not same. want email address login.so how can that? thanks get user usermanager email. var user = usermanager.findbyemail(email); then use signinmanager's passwordsigninasync user's username var result = await signinmanager .passwordsigninasync(user.username,password,ispersistent,shouldlockout); or inside signinmanager add method ( asp.net identity discussion ) public async task<signinstatus> passwordemailsigninasync(string email, string password, bool ispersistent, bool shouldlockout) { var user = usermanager.findbyemail(email); return await passwordsigninasync(user.username,password,ispersistent,shouldlockout); } then use same passwordsigninasync user email instead of usermane.

delphi - How to resolve undeclared identifier problems -

i pretty new in delphi xe7, got project , tried build it, gives error like undeclared identifier 'images' in line.. (tcontainedaction(action).actionlist.images.draw(acanvas, glyphrect.left, glyphrect.top) and tcontainedaction not contain member named 'image'. please me resolve issues. the error simple enough understand. no variable or member defined in scope code searching. undeclared identifier 'images' tcontainedaction.actionlist of type tcontainedactionlist . , tcontainedactionlist has no member named images . hence error. you need up-cast tcontainedactionlist reference of type has member looking for. don't know type because can't see of code other in question. perhaps cast tactionlist suffice. you playing fire using unchecked casts. use runtime checked casts instead find out if got wrong. uses system.actions, vcl.actnlist; .... var actionlist: tactionlist; .... actionlist := (action tcontainedact

sybase asa - Adding index to the column already having an index -

there indexes available each columns. ex: indx1 on col1 , indx2 on col2. possible create again composite index indx3 combining col1 , col2? col1 , col2 used in condition. indx3 in effect? yes, query optimizer best matching index. if include col1 , col2 in composite index , query ( where ) 2 fields use index. you should consider throwing away index on col1 because composite index can used queries on col1 too. depends on sequence of columns in composite index: first column can queried without second one.

mod php - Using spdy with mod_php -

the documentation spdy says not compatible mod_php not thread safe: https://developers.google.com/speed/spdy/mod_spdy/php much apache worker mpm, mod_spdy multithreaded module, , processes multiple spdy requests same connection simultaneously. poses problem other apache modules may not thread-safe, such mod_php. fortunately, easy adjust apache configuration make existing php code safe use mod_spdy (and worker mpm well). i have tried using spdy mod_php , haven't had issues. danger of doing this? the php core thread-safe since php5. many of extensions , libraries extension use not. if you're not using extensions you'll not going problems. if do, might segfaults, other memory access violations or strange behavior. a partial list available op php site. unfortunately, there doesn't seem conclusive list of thread-safe , thread-unsafe extensions.

python - sqlalchemy primary key without auto-increment -

i'm trying establish table layout approximately following: class widget(db.model): __tablename__ = 'widgets' ext_id = db.column(db.integer, primary_key=true) w_code = db.column(db.string(34), unique=true) # other traits follow... all field values provided through external system, , new widgets discovered , of omitted trait values may change on time (very gradually) ext_id , w_code guaranteed unique. given nature of values ext_id behaves ideally primary key. however when create new record, specifying ext_id value, value not used in storage. instead values in ext_id follow auto-increment behavior. >>> # clean database >>> skill = widget(ext_id=7723, w_code=u'igf35ac9') >>> session.add(skill) >>> session.commit() >>> skill.query.first().ext_id 1 >>> how can specify sqlalchemy ext_id field should used primary key field without auto-increment? note: add synthetic id column primary k

ruby - used bundler and rbenv -- but still cannot find gems -

i run bundle install , list saying gems installed. bundle show shotgun => /usr/local/lib/ruby/gems/2.1.0/gems/shotgun-0.9 shotgun webpost.rb => /users/angela/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': not find 'shotgun' (>= 0) among 8 total gem(s) (gem::loaderror) /users/angela/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec' /users/angela/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem' /usr/local/bin/shotgun:22:in `<main>' problem: bundler says gems installed, both running them or trying require irb shows them unfound! how can access gems? you need run commands within context of bundler: bundle exec shotgun webpost.rb

ios - Align a programmatically created UIView's center with an auto-layout view's center -

i created uiview in storyboard centered in center of view controller auto layout, , working fine across different device sizes. call largerview . however, programmatically create smaller uiview called smallerview , center view smallerview.center = largerview.center . i running issue given auto layout used on largerview , whenever use method above, smallerview never centers largerview.center . noticed take center coordinates of largerview appear in storyboard, based on specific layout of device using (in case, previous iphone 5's dimensions), not updated center affected auto layout. a similar issue may discussed here, except based on swift. know how constraints created programmatically, unsure how "refreshed" coordinates of view after auto layout applied. thanks! you need override following method in view controller: - (void)viewdidlayoutsubviews { [super viewdidlayoutsubviews]; self.smallview.frame.center = self.largeview.frame.cent

How do you change the label text in java using eclipse and scene builder? -

i'm trying make "hello world" using eclipse , scene builder. package lj.helloworld; import java.io.ioexception; import javafx.application.application; import javafx.event.actionevent; import javafx.fxml.fxml; import javafx.fxml.fxmlloader; import javafx.stage.stage; import javafx.scene.scene; import javafx.scene.control.label; import javafx.scene.layout.borderpane; public class helloworld extends application { private stage primarystage; private borderpane rootlayout; @override public void start(stage primarystage) { this.primarystage = primarystage; this.primarystage.settitle("addressapp"); initrootlayout(); } /** * initializes root layout. */ public void initrootlayout() { try { // load root layout fxml file. fxmlloader loader = new fxmlloader(); loader.setlocation(helloworld.class.getresource("roothelloworld.fxml")); rootlayout = (borderpane) loader.load(); // show scene co

linux - storing directory size into integer variable using c++ -

below c++ code in trying store size of directory integer variable char path[60]; char exec[180]; sprintf(path,"%s","/home/directory"); sprintf(exec,"du %s",path); int k; k = system(exec); printf("\n value = %d\n",k); and output 556 /home/directory value = 0 it not storing in k here can store output file using either sprintf(exec,"du %s" > file.txt,path); sprintf(exec,"du %s >> file.txt",path); but again have open file(file.txt) , read data variable. my question there other alternative store size of directory integer variable kindly suggest me there alternative in advance as joachim & mats explained, this. below code reference only! #include <stdio.h> const int max_buffer = 2048; char path[60]; char cmd[180]; sprintf(path,"%s","/home/directory"); sprintf(cmd,"du /home/directory",path); char buffer[max_buffer]; file *stream = popen(cmd, "

sql - MySQL query to check if a date range is available -

i have checkout dates slot whether available or not, particular id. have tried following query failed cover cases. let me clear scenario first. let's say: id booked_from booked_to 2014-12-20 2014-12-29 if try book 2014-12-22 2014-12-24 conflicts above mentioned record. i using following query , working fine above mentioned scenario select * `tablename` `id` ='a' , ( (`booked_from` <= '2014-12-22' , `booked_till`>= '2014-12-22') or (`booked_from` <= '2014-12-24' , `booked_till`>= '2014-12-24') ) , `ad_status` != 2 but if specify 2014-12-15 2015-01-05 shows id available when overlaps example record. what must apply cover remaining issue also. stuck this. appreciated. in advance. this query select rows dates overlap range [2014-12-22 ... 2014-12-24] , dates inclusive: select * `tablename` `id` ='a' , `ad_status` != 2 , '2014-12-24' >= `booked_from` , `booked_till` &g

android - Green Screen effect on ImageView -

my goal have "green screen" effect imageview , border. have png border thick solid outline, shape irregular, , transparent both inside , outside border. want use border of image, photo, , because border shape irregular, parts of photo may lie outside of border. all contraption sits @ center of layout complex gradient background, cannot cheat border imageview , fill outside part color similar underlying parent background. my initial idea use image editing tool fill inside , outside of png different colors (green inside, black outside), place image behind it, , perform pixel magic resulting bitmap such black pixels outside border "punch through" whole canvas showing parent background (the complex gradient background), , green pixels inside border become transparent , reveal photo behind it. this sounds complicated simple-looking goal i'm postponing implementation (not sure if it's possible) until i'm convinced that: a. there no existing librar

javascript - Video not centered, JS causing it? -

if @ page: http://www.groenesmoothiehandboek.nl/sp/ see video offcenter. you see there counter (flipclock.js) above. call counter use code: <div style="width:100%; background:url(img/bg-countdown.png) center top no-repeat; height:140px; margin:0 auto; z-index:9999;"> if delete part, video centers perfectly. i trying fix little bug on hour without success. does know how can maybe fix this? thanks in advance! if wrap div: <!-- notice no height attribute here --> <div style="width:100%; background:url(img/bg-countdown.png) center top no-repeat; margin:0 auto; z-index:9999;"> <!-- stuff inside div --> </div> inside of div: <div style="height: 140px;"> <!-- place entire div above here --> </div> your problem fixed. picture: http://i.imgur.com/hbiluoz.png

ios - convert user input to array of Ints in swift -

i'm trying make simple ios game learn programming in swift. user inputs 4 digits number in text field (keyboard type number pad if matters) , program should take 4 digits number , put each digit in array. want like userinput = "1234" to become inputarray = [1,2,3,4] i know converting string array of characters easy in swift var text : string = "barfoo" var arraytext = array(text) //returns ["b","a","r","f","o","o"] my problem need array filled integers, not characters. if convert user input int, becomes single number if user enters "1234" array gets populated [1234] , not [1,2,3,4] so tried treat user input string, make array of characters and, loop through elements of array, convert them ints , put them second array, like: var input : string = textfield.text var inputarray = array(input) var intsarray = [int]() var = 0; < inputarray.count ; i++ { intsarray[i] = inp

javascript - AngularJS performs an OPTIONS HTTP request for a cross-origin resource => error 401 -

i'm trying use $resource datas rest web service. here code : return $resource('http://serverurl', {}, { getquartiers: { method: 'get', headers: { 'authorization': 'basic base64login:pseudostring', }, }, }); the problem headers this, it's option request send , error 401 unauthorized. if remove headers, it's request. need headers send authorization string ! otherwise webservice ok, either going chrome directly url => popup login/pwd => correct datas @ json format or using postman chrome extension, send request. what's matter ? you don't seem handling preflight options requests . your web api needs respond options request in order confirm indeed configured support cors . to handle this, need send empty response back. this check added ensure old apis designed ac

WPF - EllipseGeometry animation in C# using a Storyboard -

i need scale ellipsegeometry in c# scaletransform, doesn't works. here's code: xaml: <image x:name="rock" stretch="none"> <image.clip> <ellipsegeometry x:name="rockclip" radiusx="100" radiusy="100" center="200,150"> <ellipsegeometry.transform> <scaletransform/> </ellipsegeometry.transform> </ellipsegeometry> </image.clip> </image> c#: doubleanimation scalex = new doubleanimation(); scalex.begintime = timespan.frommilliseconds(frommills); scalex.duration = new duration(timespan.frommilliseconds(2000)); scalex.from = 0.0; scalex.to = 1.0; scalex.setvalue(storyboard.targetproperty, rockclip); scalex.setvalue(storyboard.targetpropertyproperty, new propertypath("(ellipsegeometry.transform).(scaletransform.scalex)")); doubleanimation scaley = new doubleanimation(); scaley.begintime

machine learning - Implementation of SVM for classification without library in c++ -

Image
i'm studying support vector machine last few weeks. understand theoretical concept how can classify data 2 classes. unclear me how select support vector , generate separating line classify new data using c++. suppose, have 2 training data set 2 classes after plotting data, following feature space vector , here, separating line clear. how implement in c++ without library functions. me clear implementation concept svm. need clear implementation i'm going apply svm in opinion mining native language. i join people's advice , should consider using library. svm algorithm tricky enough add noise if not working because of bug in implementation. not talking how hard make scalable implementation in both memory size , time. that said , if want explore learning experience, smo best bet. here resources use: the simplified smo algorithm - stanford material pdf fast training of support vector machines - pdf the implementation of support vector machines using

java - error in android programming -

there 2 problems in code, simple code aims has button , type passage , when push button , go next activity show text had written. package com.example.mysecondapp; import android.os.bundle; import android.app.activity; import android.content.dialoginterface.onclicklistener; import android.content.intent; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.edittext; public class main extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); // reference edittext final edittext matn = (edittext) findviewbyid(r.id.edittext1); // reference button button d = (button) findviewbyid(r.id.button1); d.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent mafhoom = new intent(main.this, second.c

vb.net - How do I run an Excel Macro from a .Net web system? -

i'm trying run excel macro called sheet1.workbook_open .net web system. below current code. xlapp = new excel.application xlworkbook = xlapp.workbooks.open("c:\testing\tempfile.xlsm") xlworksheet = xlworkbook.worksheets("testspreadsheet") dim macroname string = "sheet1.workbook_open" xlapp.run(macroname) dim filedate string = sysdatetextbox.text filedate = filedate.replace(" ", "") filedate = filedate.replace("/", "") filedate = filedate.replace(":", "") filename = "c:\testing\file" & filedate & ".xlsm" xlworkbook.saveas(filename) xlworkbook.close(true) xlapp.quit() however, fails on line xlapp.run(macroname) error; exception hresult: 0x800a01a8 system.runtime.interopservices.comexception: exception hresult: 0x800a01a8 why happening, , how can fix it? error doesn't happen when project hosted on local machine - when on server. i

java - How to wait for all threads to finish, using ExecutorService? -

i need execute amount of tasks 4 @ time, this: executorservice taskexecutor = executors.newfixedthreadpool(4); while(...) { taskexecutor.execute(new mytask()); } //...wait completion somehow how can notified once of them complete? can't think better setting global task counter , decrease @ end of every task, monitor in infinite loop counter become 0; or list of futures , in infinite loop monitor isdone of them. better solutions not involving infinite loops? thanks. basically on executorservice call shutdown() , awaittermination() : executorservice taskexecutor = executors.newfixedthreadpool(4); while(...) { taskexecutor.execute(new mytask()); } taskexecutor.shutdown(); try { taskexecutor.awaittermination(long.max_value, timeunit.nanoseconds); } catch (interruptedexception e) { ... }

c# - Create Instance of children using "key" -

i have base class "games", , children clases every game, methods making specific action every game, functions generic. make games class abstract, , every children implements abstract method or using base clase generic method. every children have same functions, implements diferent in cases. (i think correct way) using system.io; using system; namespace appgames { public abstract class games { protected string name; public games(string name) // constructor { this.name = name; } public abstract void show(); // abstract show method } public class gamewow: games { public gamewow(string name) : base(name) {} // constructor public override void show() //override abstract show method { system.console.writeline("name w : " + name); } } public class gamegw2: games { public gamegw2(string name) : base(name) {} // const

c++11 - How do I implement polymorphism with std::shared_ptr? -

i have seen of other questions on topic, have still not found answer - guess i'm missing something: i defined 2 simple test classes: class testbase { public: testbase ( ) { }; ~ testbase ( ) { }; protected: inline virtual int getint ( ) { return 0; } }; class testderived : public testbase { protected: inline int getint ( ) override { return 1; } }; i declared typedefs simplify usage std::shared_ptr: typedef std::shared_ptr<testbase> spbase; typedef std::shared_ptr<testderived> spderived; problem: cannot compile code use these shared_ptr declarations polymorphically, though base in these cases instance of spderived : spbase base; spderived derived = static_cast < spderived > ( base ); error: no matching function call ‘std::shared_ptr::shared_ptr(spbase&) spderived derived = dynamic_cast < spderived > ( base ); error: cannot dynamic_cast ‘base’ (of type ‘spbase

c - To count the number of letters in a word and no of words in a sentence -

i trying experiment counting number of letters in word.to distinguish between words in string checking blank spaces.if encounters blank space 1 word , has respective letters. example "hello world". output supposed like o/p hello has 5 letters world has 5 letter but when trying write code getting segmentation fault. below code. #include <stdio.h> #include <string.h> main(void) { int nc = 0; int word = 0; char str[] = "this test"; int len = strlen(str); int i; for(i = 0; < len; i++) { ++nc; if(isspace(str)){ ++word; } } printf("%d\n",nc); } try this.. for(i = 0; < len; i++) { if(isspace(str[i])) { ++word; continue; } ++nc; } if(len>0) word++; printf("%d %d\n",nc, word);

sql - PostgreSQL Query Time -

select * vehicles t1 (select count(*) vehicles t2 t1.pump_number = t2.pump_number , t1.updated_at < t2.updated_at ) < 4 , t1.updated_at >= ? and supply '1970-01-01 00:00:00.000000' parameter ? . i have around 10k records in vehicles table , no index added. above query takes around 10-20 seconds in execution. how can optimize decrease execution time? postgres provide nice admin tool has option explain see query execution plan . give great insights . here link pgadmin in detail http://www.pgadmin.org/docs/1.4/query.html also use joins in query instead of select increase query performance

xcode6 - Apple Mach-O Librarian error for swift static lib using cocoapods -

i have 1 public repository https://github.com/ssamanta/sshttpclient . code has been written in swift , created podspec file that. in sample project while trying use lib pod getting below compilation error in xcode 6.2 beta 2. error: /applications/xcode-beta.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/libtool: unknown option character `x' in: -xlinker but when using repo https://github.com/ssamanta/ssrestclient written in objective c it's working correctly. are there problem in cocoapods or static lib in swift?

django - how to apply additional filter on the autocomplete_light field based on the paramter passed to __init__() of a model form -

i using django autocomplete_light autocomplete value inserted on foreignkeyfield . want apply filtering on suggestions based upon arguements passed to __init__ method. this form class camenuform(autocomplete_light.modelform): class meta: model = ca_dispensaries_item autocomplete_fields = ('item',) def __init__(self, *args, **kwargs): self.category = kwargs.pop('category', none) super(camenuform, self).__init__(*args, **kwargs) self.fields['item'].queryset=items.objects.filter(product_type__name=self.category) field_name in self.fields: field = self.fields.get(field_name) if field: field.widget.attrs.update({ 'placeholder': field.label, 'class': 'form-control' }) here registry autocomplete_light.register(items, search_fields=('item_name',)) here line in __init__ method doesnt seems work autocomplete. though used filt

c++ - Load partial xml using xerces dom parser -

the xml file huge in size, while need specific parts of file in random manner (hence cannot use sax) while processing. there way can load partial dom tree in memory using xerces dom parser? it sounds want python's pulldom xerces not offer. if beholden xerces , memory primary concern, use xerces sax (push) parser populate data structure data xml care about. "randomly" access data interested in. if free use other libraries, might stax (pull) parser . although, think still have implement own data structure hold data you're interested in. i'm not aware of c++ equivalent of python's pulldom.

Android Bluetooth Socket not created -

my app trying connect bluetooth module , send/receive data simultaneously. following error thrown (it happens after gc call):- 12-15 19:06:15.559: d/dalvikvm(22875): gc_for_alloc freed 3925k, 25% free 11400k/15096k, paused 28ms, total 28ms 12-15 19:06:15.559: e/system(22875): uncaught exception thrown finalizer 12-15 19:06:15.559: e/system(22875): java.io.ioexception: socket not created 12-15 19:06:15.559: e/system(22875): @ android.net.localsocketimpl.shutdowninput(localsocketimpl.java:392) 12-15 19:06:15.559: e/system(22875): @ android.net.localsocket.shutdowninput(localsocket.java:206) 12-15 19:06:15.559: e/system(22875): @ android.bluetooth.bluetoothsocket.close(bluetoothsocket.java:462) 12-15 19:06:15.559: e/system(22875): @ android.bluetooth.bluetoothsocket.finalize(bluetoothsocket.java:229) 12-15 19:06:15.559: e/system(22875): @ java.lang.daemons$finalizerdaemon.dofinalize(daemons.java:187) 12-15 19:06:15.559: e/system(22875): @ java.lang.daemons

javascript - AJAX acting in a multi threaded manner -

i understand javascript single threaded (as explained in question: if javascript not multithreaded, there reason implement asynchronous ajax queuing? ), trying understand how applies application have developed. please see code below: function getsqltable() { var str = $("#<%=fielddatabasereferences.clientid%>")[0].value var res = str.split(","); $("#loadingimage").show(); $("#loadingimage2").show(); (var = 0; < res.length; i++) { (function (i, res) { settimeout(function () { getsqltable2(i, res.length, res) }, 0); })(i, res); } } function getsqltable2(i,reslength,res) { //if (i == 0) //{ // var start = new date().gettime(); //} var div = document.createelement('div'); div.id = "div" + document.getelement

excel - conditional formatting using xlwt python -

is there way conditional formatting using xlwt? because of code using xlwt. like this. of code import xlwt .... filename in glob.glob(opensoundingfile): wb = xlwt.workbook(encoding="latin1") sheet = wb.add_sheet('input') sheet2 = wb.add_sheet('transfer') newname = filename spamreader = csv.reader(open(filename, 'rb'), delimiter=';',quotechar='"') rowx, row in enumerate(spamreader): colx, value in enumerate(row): sheet.write(rowx, colx, value) sheet.col(0).width = 5555 sheet.col(1).width = 11110 sheet.col(2).width = 5555 sheet.col(3).width = 3333 .... and want input code. thing not working because need xlsxwriter sheet2.conditional_format('g28:g528:', {'type': 'cell','criteria': '>','value': 100,'format': yellow}) if more 100 cell color become yellow. reply

asp.net mvc 3 - jquery autocomplete using mvc3 dropdownlist -

i using asp.net mvc3 ef code first. have not worked jquery. add autocomplete capability dropdownlist bound model. dropdownlist stores id, , displays value. so, how wire jquery ui auto complete widget display value user typing store id? i need multiple auto complete dropdowns in 1 view too. i saw plugin: http://harvesthq.github.com/chosen/ not sure want add more "stuff" project. there way jquery ui? update i posted sample project showcasing jqueryui autocomplete on textbox @ github https://github.com/alfalfastrange/jqueryautocompletesample i use regular mvc textbox like @html.textboxfor(model => model.mainbranch, new {id = "searchfield", @class = "ui-widget textfield_220" }) here's clip of ajax call it checks internal cached item being searched for, if not found fires off ajax request controller action retrieve matching records $("#searchfield").autocomplete({ source: function (request, response) {

.classpath file in Java related to Java or Eclipse -

i have read many sites , decided ask question on stackoverflow, question pretty basic what .classpath file? file related java project or eclipse? some people think file related eclipse , thinks related project? .class files related java. you write code in java, compiled javac bytecode. bytecode store in .class files, , further interpreted java virtual machine (jvm). about classpath on wikipedia: similar classic dynamic loading behavior, when executing java programs, java virtual machine finds , loads classes lazily (it loads bytecode of class when class first used). classpath tells java in filesystem files defining these classes. so classpath mechanism related java, , handled eclipse thank .classpath file. hope :)

sql server - Why don't all my SSIS parallel tasks execute? -

Image
i have data flow task followed 3 tasks in ssis 2012 package control flow. part of data flow rowcount transform sets user::rowcount number of rows passed data source target. after exiting data flow there 3 tasks: an email task - task runs if success , user::rowcount>$project::rowcount_threshold. task runs , email (threshold set 1 testing email). a second email task - task runs if secondary task within data flow detects rows value exceeds different threshold. if count of "issues" (another user variable) exceeds $project:issue_threshold email. condition executing task success plus comparison of issue_count issue_threshold. doesn't run , shouldn't since i've set threshold high right now. the final task takes user::rowcount , inserts log table via execute sql task simple parameterized sql insert. task runs based on success should run every time. my problem when run package data flow runs, user::rowcount set number of rows inserted in target when data flo

import - unable to create new project in Android Studio -

i new android studio , can't create or import project. when tried import new project, show error like: not find version matches com.android.support:support-v4:21.0.+. searched in following locations: https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml https://repo1.maven.org/maven2/com/android/support/support-v4/ required by: telegram-master:tmessagesproj:unspecified consult ide log more details (help | show log) please me solve problem. you need install packages android sdk manager version of android going develop. see here , here how it. see this answer change sdk path if need to. good luck!

c# - How to bind a child `UserControl`'s Dependency Property, using `Style`, to a property of the host element's view-model? -

how bind child usercontrol 's dependency property, using style , property of host element's view-model? i tried code below, , myblock.blockisonlyone should bound view-model's property - mycontainerviewmodel.viewmodelisonlyone , via style 's setter . reason doesn't work - myblock.blockisonlyone 's value never changes, although mycontainerviewmodel.viewmodelisonlyone changes... the container xaml: <usercontrol x:class="myns.mycontainer" ... > <usercontrol.datacontext> <vc:mycontainerviewmodel x:name="thedatacontext"/> </usercontrol.datacontext> <grid> <grid.resources> <style targettype="{x:type vc:myblock}"> <setter property="blockisonlyone" value="{binding viewmodelisonlyone}"/> <!-- tried too, no success: --> <!-- <setter propert

what mistake in this medical diagnosis prolog? -

i still new prolog, have problem simple medical diagnosis program using prolog, try find code medical diagnosis system make work, cant, dont know need change, use swi prolog software. here prolog code try use show error in domains, show "syntax error= operator expected" domains disease,indication = symbol patient,name = string predicates hypothesis(string,disease) symptom(name,indication) response(char) go clauses go :- write("what patient's name? "), readln(patient), hypothesis(patient,disease), write(patient,"probably has ",disease,"."),nl. go :- write("sorry, don't seem able to"),nl, write("diagnose disease."),nl. symptom(patient,fever) :- write("does ",patient," have fever (y/n) ?"), response(reply), reply='y'. symptom(patient,rash) :- write("does ",patient," have rash (y/n) ?"), response(reply), reply='y

java - CSRF Guard - Can it protect service call also? -

i'm implementing csrf guard in web application. have done required configuration , can see token getting generated/injected request header. let me tell application's architecture bit, have jsp pages makes call services using ajax data , display in ui. my question here "can protect service calls csrf guard?" if possible how can because not going csrfguardfilter.java class when i'm debugging execution. thanks help.

c++ - Initializing derived class enum with (unscoped) base class enum having the same name -

the following code (also on ideone ) looks shouldn't compile on msvc 2008 , gcc 4.8.2 #include<iostream> struct base { enum state { on = 11 , off = 22 , standby = 33 }; }; struct derived : base { enum state { on = on , off = off }; // huh? }; int main() { std::cout << derived::on << std::endl; } is standard compliant? enum state { on = on , off = off }; // huh? ^^ at point derived re-definition not complete, on used base.

Contao: Teasers in dropdown navigation -

Image
i need make dropdown navigation , every parent navigation item, in dropdown area show child pages + 3 images title linked other pages. i need 'custom navigation' module option select images (or add custom class, , image page). is there extension use this? if not, easier/faster change/extend core module, or should create new one? thanks! example ('kollektion' menu-item hovered. gray area submenu container) i don't know of extension allow including image specific link in navigation menu. if willing css styles, here's how it: any page can have multiple custom css classes , apply navigation (unless navigation template has been changed in such way don't anymore). place enter these css classes @ bottom of edit page view, under expert settings. add css classes want , edit style sheet make them right. if 3 pages not supposed subpages current page, lead somewhere else, can use "internal redirect" page type them. the css in additio

c# - threading in Filewatcher window service -

i have written window service uses filewatcher monitor creation of file in particular folder.however,my question in real environment,many files (approx 20-30) comes in folder in production environment.how should handle such huge data files.do need implememt threading or something.for threading,any sample code appreciated not sure how do. code below: protected override void onstart(string[] args) { xmldocument xml = new xmldocument(); xml.load("c:\\users\\\\data.xml"); xmlnodelist xnlist = xml.selectnodes("/names/name"); foreach (xmlnode xn in xnlist) { strdir = xn["directory"].innertext; filemask = xn["filemask"].innertext; strbatfile = xn["batch"].innertext; strlog = xn["log"].innertext; } m_watcher = new filesystemwatcher(); m_watcher.filter = filemask; m_watcher.path = strdir+ "\\"; m_watcher.notifyfilter = notifyfilters.las

java - Criteria with full join and left join -

i trying write query using criteria class select * full join b on a.aid=b.aid left join c on c.bid=b.bid so far have criteria = getsession().createcriteria(a.class, "a") .createcriteria("b", "b").createcriteria("c", "c") which join on inner join not want that i figured out. criteria = getsession().createcriteria(a.class, "a", criteria.left_join) .createcriteria("b", "b").createcriteria("c", "c", criteria.left_join); criteria.setresulttransformer(criteria.distinct_root_entity);

How to get access token identity in asp.net webforms external login page? -

i'm using new microsoft identity manage website login , register. i've configured website start using external login (facebook). how can access token in (registerexternallogin) page? `` protected void page_load(){ // process result auth provider in request providername = identityhelper.getprovidernamefromrequest(request); if (string.isnullorempty(providername)) { redirectonfail(); return; } if (!ispostback) { var manager = context.getowincontext().getusermanager<applicationusermanager>(); var logininfo = context.getowincontext().authentication.getexternallogininfo(); if (logininfo == null) { redirectonfail(); return; } var user = manager.find(logininfo.login); if (user != null) { identityhelper.signin(manager, user, ispersistent: f

android - Getting Noise and echo in Quickblox audio/video chat Sample -

i have referred this example implement audio/video chat functionality in app, i'm getting lot of noise , echo during audio/video call. can please tell me how can improve voice quality, (i mean there setting need in code or in device..?) thank you..!

dictionary - Accessing values in Map through EL in JSF2 -

versions : aapche myfaces 2.1.14 richfaces 4.3.5 issue : i have class implementing map interface below : public class formstore implements map { private map values; public object get(object key) { return values.get(key); } public object put(object key, object value) { return values.put(key, value); } } i using map store submitted form values in application , accessing in facelet shown in below facelet code : <h:inputtext id="phone" value="#{formstore['phone']}" size="12" maxlength="20" required="true"> where formstore java class above. now have added map in above java class below serves special purpose. public class formstore implements map { private map values; private map additionalvalues; public object get(object key) { return values.get(key); } public object put(object key, object value) { return values.put(key, value); } //getter ,

c# - Starpattern in console app -

Image
i need create following pattern: it homework, question failed first time. read should have used "*" 1 time, how work in case? appreciate if give me insight in how think. my code down below: using system; class starpattern { public static void main() { (int = 0; < 5; i++) { console.write("*"); } (int = 0; <= 0; a++) { console.writeline(""); console.write("*"); } (int c = 0; c <= 0; c++) { console.writeline(" *"); } (int d = 0; d <= 1; d++ ) { console.write("*"); console.writeline(" *"); } (int e = 0; e < 5; e++ ) { console.write("*"); } console.readline(); } } you can simplify code nesting loops outer ( i ) = rows , inner ( j ) = col

c# - ObservableCollection Refresh is not working, when dynamic allocated -

public observablecollection<model.childcommand> childcommands { get; private set; } childcommands bound datagrid. both segments show me items in datagrid. but in segment 1 datagrid items doesn't refresh automatically when collection changes. segment two, refresh works. segment 1: var childs = child in m_context.childcommand.local select child; this.childcommands = new observablecollection<model.childcommand>(childs); segment 2: this.childcommands = m_context.childcommand.local; how automatic refresh using segment one? the reason segment 1 not updating automatically end binding different observablecollection instance. when m_context.childcommand.local changes, segment 2 datagrid gets notified because bound observable collection instance. segment 1 datagrid bound different observable collection instance (that create when new observablecollection(childs). if want both of them bound m_context.childcommand.local obs

javascript - AngularJS : ng-show complex conditions problems with IE9 -

the below code works in browsers including ie10. has problems in ie9. guessing there no syntax error or logic error in code, may need different way write condition in ng-show <div class="control-group" ng-show="!waste.id" style="display:inline-block"> <label class="control-label" for="shipments">treatment or shipment frequency</label> <div class="controls controls-row"> <div> <input type="number" id="shipments" name="shipments" maxlength="50" ng-required="!waste.id && !nochange" ng-model="waste.shipments" ng-disabled="nochange" placeholder="shipment" class="input-small" step="any"> <i class="inline icon-info-sign" ng-show="form.shipments.$invalid || form.shipments.$error.required == true"></i> &l

sql - JOIN inside WHERE vs outside WHERE -

will both statements return same results? the top code has join in clause , takes on 4 hrs run. moving join outside same query runs in 1m 6s. have not seen join in clause. note dsa.doc_id child version record of orders.folder. --old code taking 4+ hrs run select top 1 status_to_date dsa (status_to = 'ca') , left(dsa.doc_id,12) = orders.folder --new code taking less minute select top 1 status_to_date dsa left outer join orders on left(dsa.doc_id,12) = orders.folder (status_to = 'ca') yes believe both queries give same result. , in side join gives slowest result. there 1 more alternate of above query willl nmore , more faster second query too select top (1) status_to_date dsa (status_to = 'ca') , (select count(*) orders orders.folder = left(dsa.doc_id,12)) > 0

mysql - Joining two table with SUM of Column and Group by another column -

need join , group sum() function 2 tables. the tables under: debit table credit table --------------------- --------------------- customername debit customername credit --------------------- --------------------- customer1 200.00 customer1 100.00 customer1 300.00 customer1 100.00 customer2 100.00 customer1 100.00 customer2 600.00 customer2 200.00 ----------------------- customer2 300.00 customer2 50.00 ----------------------- i need show 2 join table as: join table(debit credit table) ------------------------------------------ customername debit credit closing ------------------------------------------ customer1 500.00 300.00 200.00 customer2 700.00 550.00 150.00 ------------------------------------------ this far getting doesn't yield rig

javascript - Loop through and validate multiple radio inputs -

js: function validateform() { var radios = document.getelementsbyname("dquestion[1]"); var formvalid = false; var = 0; while (!formvalid && < radios.length) { if (radios[i].checked) formvalid = true; i++; } if (!formvalid) alert("must check option!"); return formvalid; } php: <form name="form1" action="#" onsubmit="return validateform()" method="post"> first time visitor?:<br/> <label for="s1">yes</label> <?php for($i=1; $i<=10; $i++){?><td><input type="radio" name="dquestion[1]" value="<?=$i?>"> <?=$i?> </td><?php } ?> <br/> <label for="s2">no</label> <?php for($i=1; $i<=10; $i++){?><td><input type="radio" name="iquestion[1]" value=

apache - Why can the same user make a directory on the command line but not via the webserver? -

i running apache on centos , in /etc/httpd/conf/httpd.conf file user , group both my-username $ cat /etc/httpd/conf/httpd.conf|grep '^user' user my-username $ cat /etc/httpd/conf/httpd.conf|grep '^group' group my-username when run my-username on command line can create directory, not via call webserver. $ cat test.php <?php mkdir(dirname(__file__) . '/made-by-the-webserver', 0755); $err = error_get_last(); $user = exec('whoami'); echo 'whie attempting create directory, got ' . $err['message'] . ' running ' . $user; $ curl mysite.local/test.php whie attempting create directory, got mkdir(): permission denied running my-username $ whoami my-username $ mkdir made-on-the-command-line $ ls -lah|grep made drwxrwxr-x. 2 my-username my-username 4.0k dec 16 14:51 made-on-the-command-line $ php test.php whie attempting create directory, got running my-username $ ls -lah|grep made drwxr-xr-x. 2 my-username my-user