Posts

Showing posts from April, 2012

encryption - How to read encrypted zip files in Python -

the user have encrypted zip file, use program enter there password , extract files zip. however, i'm stuck! ive gone through python documentation on zip files pretty well, can't find opening encrypted zips. from https://docs.python.org/2/library/zipfile.html : zipfile.extractall([path[, members[, pwd]]]) extract members archive current working directory. path specifies different directory extract to. members optional , must subset of list returned namelist() . pwd password used encrypted files. works on python 3 too: https://docs.python.org/3/library/zipfile.html

three.js - mesh looks incorrect (threejs r68) -

Image
i'm using threejs (r68) on model online view project converts uploaded models threejs files. found models incorrect below. some models can viewed @ http://www.threedbook.com/detail/23981 especially when move models(rotate or pan), mesh color , shade changing time. strange thing model normal if it's zoomed in enough size. point me causes rendering problem? or issue when convert models threejs file? thanks lot! the modelling of object incorrect. have overlapping polygons on same area , close each other. when rendering, cause appearance change (specially if zoomed out since dont have enough rendering resolution); ie. many polygons squashed on top of each other , renderer doesn't know 1 render first. when zoom in, ok because have resolution.

Javascript method definition -

i started learn javascript, know java , little bit of html , css , sql. but, i'm little confused in terms of whats going on in js. js has method called confirm, pops window , asks user confirm. not have define method before using it. in java have define object in order use it, here use method called without ever defining it. defined in js already, how work? please because confused right now. javascript has predefined object called window has lot of properties defined on already. you can see them opening browser's console , typing window hitting enter. because javascript hasn't had concept of module system until es6 (the specification being developed) , browser apis had stored within window object in order developers able use them. you can think of window object global scope in javascript. if create variable without var keyword created property on window object. function main() { hello = 3; window.hello === 3; // true var bye = 2; window.by

linux - Error: You have an outdated version of python-requests. Please upgrade -

my issue whenever command wapiti gives me message: root@ kali: ~#wapiti wapiti - 2.3.0(wapiti.sourceforge.net) error: have outdated version of python - requests.please upgrade i have upgraded latest version : root@kali:~# apt-get install python-requests reading package lists... done building dependency tree reading state information... done python-requests newest version. 0 upgraded, 0 newly installed, 0 remove , 0 not upgraded. root@kali:~# apt-get install wapiti reading package lists... done building dependency tree reading state information... done wapiti newest version. 0 upgraded, 0 newly installed, 0 remove , 0 not upgraded. my kali version latest 1 , have downloaded iso , image other version solve encounter in each one...i amd64 if helps. 1- apt-get remove python-requests 2- pip install requests 3- apt-get install python-requests 4- wapiti work. wapiti-2.3.0 (wapiti.sourceforge.net) wapiti-2.3.0 - web application vulnerability scanne

Android Shared Element Animation doesn't work for me -

i following instruction on https://developer.android.com/training/material/animations.html , trying implement animation shared element between activities, doesn't work me, searched lot not find answer, there can take look? thank much! my steps: 1, create directory "transition" under "res" directory, , create file list_to_details.xml there: <?xml version="1.0" encoding="utf-8"?> <transitionset xmlns:android="http://schemas.android.com/apk/res/android"> <changeimagetransform/> </transitionset> 2, create directory "values-v21" under "res" directory, , create file styles.xml there(setting transition defined above in step 1): <?xml version="1.0" encoding="utf-8"?> <resources> <style name="apptheme" parent="android:theme.material"> <!-- enable window content transitions --> <item name="

ios - How to set specific areas of uiimage to process touch gestures? -

Image
i'm making photo hunt style app. i've got number of x-rays , need set specific areas of uiimage process touch events correct , others incorrect. i understand can use code below tap location in image view how declare area on image view correct , compare tap location value? cgpoint taplocation = [gesture locationinview:self.imageplatea]; any appreciated! so have programmatically create "regions" , test see whether or not they're in region after point. example: //get tap location cgpoint taplocation = [gesture locationinview:self.imageplatea]; if ([self checkiftap:taplocation inregionwithcenter:cgpointmake(somex, somey) radius:radius]) { //yay we're within bounds of circle @ point (somex, somey) //that has radius of radius } and method of checkiftap: inregionwithcenter: radius: can defined this: - (bool)checkiftap:(cgpoint)taplocation inregionwithcenter:(cgpoint)center radius:(cgfloat)radius { cgfloat dx = taplocation.x - c

angularjs - Firebase: Error: Key content was undefined. Cannot pass undefined in JSON. Use null instead." -

trying firebase first time. got whole thing working in plunkr here: http://plnkr.co/3wirbn var app = angular.module('myapp',['firebase']); app.factory('chatmessages',["$firebasearray",function($firebasearray){ var ref = new firebase('https://scanapp.firebaseio.com/tut'); return $firebasearray(ref); }]); app.controller('mycontroller'['$scope','chatmessages',function($scope,chatmessages){ $scope.test = 'hello world'; $scope.user = "anonymouse"; $scope.messages = chatmessages; $scope.addmessage = function(){ $scope.messages.$add({ from: $scope.user, content: $scope.message }); $scope.message = ''; }; }]); i tried following tutorials on site, did quick start stuff read docs thoroughly, keep getting error above: "error: key content undefined. cannot pass undefined in json. use null instead." i can working in above plunk, understand con

javascript - Advice on better way to program jquery animation -

i have list of social icons when hovered on increase in width reveal more content while rest decrease width keep overall ul width same. wondering if tell me if way did or if there better way of doing it. still trying learn jquery , best practices. also seems working except last list item drop down occasionally. i'm thinking has hovered items width increasing @ different rate other items decreasing. here have (note facebook has content associate @ moment): $(function() { $('.social-container > li').on({ mouseenter: function () { $('.social-container > li').stop().animate({'width':'16%'},400); $(this).stop().animate({'width':'50%'},400).queue(function(){ $(this).find(".icon-placeholder").hide(); $(this).find(".icon-link").stop().fadein("slow").show(); $(this).dequeue(); }); }, m

android - Error with DrawerLayout -

when try open activity gridview , drawerlayout, have error: 04-14 16:16:44.203 2226-2226/? e/androidruntime﹕ fatal exception: main process: com.example.proyectotaes.proyecto1, pid: 2226 java.lang.illegalargumentexception: drawerlayout must measured measurespec.exactly. @ android.support.v4.widget.drawerlayout.onmeasure(drawerlayout.java:814) @ android.view.view.measure(view.java:17430) @ android.widget.gridview.onmeasure(gridview.java:1074) @ android.view.view.measure(view.java:17430) @ android.widget.relativelayout.measurechildhorizontal(relativelayout.java:727) @ android.widget.relativelayout.onmeasure(relativelayout.java:463) @ android.view.view.measure(view.java:17430) @ android.support.v4.widget.drawerlayout.onmeasure(drawerlayout.java:851) @ android.view.view.measure(view.java:17430) @ android.view.viewgroup.measurechildwithmargins(viewgroup.jav

How to compare two files and extract some data with Python -

i have 2 files: file1, file2. file2 contains of file1 , many more. example: file1: data1/111 data2/222 data3/333 file2: data1/111 \ewr\xcgf\wer 54645623456.xml data23/42234 \asdqw\aqerf 23525.xml data2/222 \asd\qwe 234234.xml data66/2331 \a53\fdf355 12312333311.xml data3/333 \from\where 123123.xml data4/444 \xcv\sdf\ghf 98546.xml , many more... so, i'm trying print out lines exist on both files file2. means print out must have data in every line. path , xml file name. i've tried; lines1 = open(path1).readlines() lines2 = open(path2).readlines() in lines1: j in lines2: if in j: print(j.rstrip()) this prints lines @ lines2 i'm trying find out is; search first line lines1 in lines2 , if finds anywhere in lines2 , print line lines2 , , forth. after should same second line in lines1 can help? thank time. lines1 = open(path1).readlines() lines2 = open(path2).readlines() l1 in lines1: if l1 in lines2: print(l

python - django autocomplete light on admin: how does it work? -

i'm trying make searcheable customer foreigkey on model on admin. i has installed django autocomplete light, can`t see works. i'm trying this. admin.py import autocomplete_light class redadminform(forms.modelform): class meta: model = red widget = {'customer': autocomplete_light.choicewidget('customerautocomplete')} class redadmin(admin.modeladmin): #form = redadminform list_display = ("id", "customer","sponsor") list_per_page = 10 search_fields=['customer__username', 'sponsor__username'] #raw_id_fields = ('customer','sponsor',) form = autocomplete_light.modelform_factory(red) admin.site.register(red, redadmin) i have css , js static files of module, has installed , put on installed apps. autocomplete_light_registry.py import autocomplete_light django.contrib.auth.models import user autocomplete_light.register(user) show error on aja

Making class GuessingGame in Ruby, stuck on instance method guess -

okay, have assignment make class called guessinggame, , create..a guessing game! lol. seriously, have make game takes input integer that's between 1 , 10. have skeleton of class's syntax done, when instance method guess, i'm getting stuck. if user's guess higher random number, should return ":high". if it's lower number, returns ":low". if it's right number..you gist. think has conditionals. here of code far: class guessinggame def initialize(answer) @answer = answer end answer = rand(10) + 1 def guess(guess) if guess.to_i > answer return ":high" elsif guess.to_i < answer return ":low" else return ":correct" end end def solved? end end let me state here ruby noob, , i'm looking constructive advice here. here rspec errors: guessinggame#guess returns :high when guess high guessinggame#guess returns :low when guess low guessinggame#guess returns

Universe database attaching to Universe database server -

i sent universe database. installed trial version of universe database server rocket software. however, cannot find walkthroughs on how use universe database server software. given universe shell installed, i'm assuming command line. i've tried going through menu, severely lacking , horribly formatted. has run problem? i'm looking attach database file , schema information can it. a universe "database" kind of abstraction of file system, @ least in experience using aix/linux. if have universe installed , running there isn't kind of attaching need do. change directory extracted db , execute command /your/path/to/bin/uv , launch shell. also sounds experiencing terminal emulation issues, might want find terminal emulator gives ability switch emulations on fly. use dynamic connect delivered product when still belonged ibm. not sure open source alternatives lazy , dc paid for. if screen dorked try switching emulation around. of work in combinat

java - Creating a Markbook in Eclipse -

import java.util.scanner; public class markbook { public static void main(string[] args) { system.out.println("what menu access? 0. add students 1. change mark 2. list marks , students"); scanner keyboard = new scanner(system.in); } } is have, i'm bit rusty on coding abilities, have no idea on how start off, able assist giving tips or help? provide choices take user input , process system.out.println("what menu access? 0. add students 1. change mark 2. list marks , students"); int choice = keyboard.nextint(); if (choice == 0) { // run code add students } else if (choice == 1) { // code change mark } else if (choice == 2) { // list marks code } else { system.out.println("invalid input"); // handle invalid input somehow if want }

c# - How to add a class property to a list of instances -

i'm newbie in c# . perhaps resolve i'm away of solution. i have class: public class testsetups : tabelactset { public ilist<tabelactsca> valsetup { { return m_valsetup; } } private static list<tabelactsca> m_valsetup; /// constructor public testsetups(idefinitionlist dlist) : base(dlist) { m_valsetup = new list<tabelactsca>(); } } i have class called testcase public class testcase : tabelacttes { public ilist<testsetups> setups { { return m_setups; } } private list<testsetups> m_setups; ... testcase.m_setups = new list<testsetups>(); defs = gdl.getdefinitions(testcase); while (defs.movenext()) { testsetups testsetup = new testsetups(defs); idefinitionlist valsetup = gdl.getdefinitions(testsetup); { tabelactsca ctsca = new tabelactsca(valsetup); testsetup.valsetup.add(ctsca); }

php - Dynamically create variables in foreach loop and use on another page -

i'm using dynamic template custom made cms. want variables from 1 php-page and, each created site uses page, want use variables in foreach to, example display each title. i have made simple example below explain this: home.com/gallery/1 home.com/gallery/2 home.com/gallery/3 what get: gallery 1 gallery 1 gallery 1 what want: gallery 1 gallery 2 gallery 3 (assuming each page named gallery 1, 2, 3) gallery.php <form action=""> <input type="text" name="page_title"> </form> <?php $galleries = array(); $id = intval($_post["id"]); ? foreach ($galleries $id => $gallery) { $title = $_post["page_title"]; } $_session['galleries'] = $galleries; $_session['title'] = $title; ?> <h1><?php echo $title; ?></h1> page.php: $galleries = $_session['galleries']; $tit

osx - How do I properly set the title in Terminal using zsh? -

Image
i have been trying set title of terminal appropriately, haven't had success. currently, looks this , , if change directory, desktop, become this . i prefer if title had current folder , process. i've tried various methods, such here , no success. i'm using default terminal app in yosemite, , running zsh. if don't want in window title other current directory , process (which there default in terminal.app), can following @ end of ~/.zshrc : precmd () {print -pn "\e]0;\a"} example: i'm afraid can't rid of terminal size though since appears hard-coded terminal.app (maybe i'm wrong). for more information, see how change title of xterm: examples different shells . by way, recommend iterm2 instead of terminal.app. swiss army knife of terminal emulators, infinitely better terminal.app, highly customizable.

sql - Update query needed based on the condition -

i need stored procedure update error message column on table based on condition, if dob null or greater current date error message column should updated 'invalid dob' , based on id has updated, if dob lesser current date , not null, error message column should not updated. need update statement query, tried update columns without checking condition. please provide solution query,thank you. strange requirement simple. update sometable set errormessage = 'invalid dob' dob null or dob > getdate()

java - Variable transaction isolation levels by request -

i writing little auction app, , important bids recorded certainty. after all, last couple seconds of auction critical moments buyers, , can't risk them simultaneously bidding , having race condition. and of course, that's transaction isolation for. can set isolation level serializeable, , we're set. but other requests? if people viewing profiles, or sending messages, these requests don't need anywhere near kind of transaction isolation. read committed isolation level acceptable requests. i'm setting transaction level part of hibernate property hibernate.connection.isolation , i'd able session.settransactionisolation(newisolation) per request. session session = getsession(datasource, sessionfactory, connection.transaction_serializable); public session getsession(datasource datasource, sessionfactory sessionfactory, int isolationlevel){ // connection current datasource , set new isolation connection connectionwithnewisolation = datasource

Importing data from MySQL to Excel -

i have data in excel sheet (csv format) , have imported data mysql , filtered data based on dates (only 2014 , 2015) years have been selected. client wants data in excel. so, have import data had extracted based on dates excel. believe temporary table. so, how import temporary tables excel. i don't know how use mysql excel converter in case, temporary table being used. here software mysql handle https://www.mysql.com/why-mysql/windows/excel/ mysql excel makes task of getting mysql data excel easy one; there no intermediate csv files required, couple of clicks , data imported excel. mysql excel supports importing data tables, views , stored procedures.

java - How to solve "Cannot resolve symbol" in IntelliJ IDEA? -

Image
this question has answer here: intellij inspection gives “cannot resolve symbol” still compiles code 31 answers i learn algorithms, 4th edition intellij idea, however, encouted issue idea told me "cannot resolve symbol 'stdin' , 'stdout'". pic: [cannot resolve symbol "stdin"](http: //i.imgur.com/zrd6o53.jpg) my project structure correct , set stdlib.jar 1 of dependencies, there stdin , stdout. clicked "invaildate caches , restart" issue remains. you may learn details of stdlib.jar here , average.java public class average { // class should not instantiated private average() { } /** * reads in sequence of real numbers standard input , prints * out average standard output. */ public static void main(string[] args) { int count = 0; // number input values d

LINQ Query - How i can make my query better? -

i have written following linq query return list , iterating list separately convert time hours , taking sum of hours each list item. i sure might not right away send 3 database calls. can re-write in better way e.g. groupby or other way assign data model, converting idletime hours , taking sum of idletime?? model class public class testmodel { public string tasksummary { get; set; } public string locationname { get; set; } public float idletime { get; set; } public string description { get; set; } public float idletimesum { get; set; } public guid taskid { get; set; } } linq query list<testmodel> list = _context.time .include(x => x.report) .include(x => x.report.task) .include(x => x.report.task.location) .where(x => taskids.contains(x.report.taskid)) .select(x => new testmodel

html - rotateY() text is blurry/pixelated -

i've rotated , perspective-3d element text. text low fidelity. there way improve it? really simple example code: <h1 style = "transform: perspective(150px) rotatey(-45deg);width:150px;"> text </h1> http://codepen.io/anon/pen/dpxwqa?editors=100 i think need parent container right perspective. -webkit-perspective: 900px; hover text visulization div { -webkit-perspective: 100px; -webkit-transform-style: preserve-3d; } h1 { display: inline-block; transition: 1s ease; border:1px solid #ccc; cursor:pointer; } h1:hover { display: inline-block; -webkit-transform-origin: 60% 40%; -webkit-transform: rotatey(-10deg); } <div> <h1>this text</h1> <div> or see example .container { -webkit-transform-style: preserve-3d; -webkit-perspective: 200px; } .child { font-size: 2.4em; margin: 100px; width: 250px; height: 50px; -webkit-transform: rota

cordova - CordovaPush plugin always returning OK on register -

i'm following docs: http://ngcordova.com/docs/plugins/pushnotifications/ i trying follow android example, , when try register, no matter senderid is, getting ok result. when instert actual gcm sender id, still ok instead of registration id. did setup, googled , tried solutions, still couldn't make work. i need working, can't find issue. use following push notification in android , ios. work you. after install app, user need open app call ecb methods. in ios, pushnotifcation's register success method returns mobile register id in result in android, return ok. in android, onnotificationgcm method called 2 type event 1) registerid , 2) notification message. have added shownotificationapn/gcm method show notification popups $ionicpopup.alert(). .run(function ($ionicplatform, pushprocessingservice) { $ionicplatform.ready(function () { try { pushprocessingservice.initialize(); } catch (e) { //hide event

javascript - How to get a @html.Checkbox to update a @html.dropdownList -

i have following checkbox: @html.checkbox("norm", false, new { @class = "checkbox" }) once checked, want auto update dropdown @html.dropdownlist("selectedcore", (selectlist)viewbag.coresheets) the dropdown selectlist populated controller this, viewbag.coresheets = new selectlist(db.coresheets, "sheetid", "abb"); so in summary, want click check box , have current dropdown value updated. cheers, b n j try code @html.checkbox("norm", false, new { @class = "checkbox",@onclick="clicknorm()" }) <script type="text/javascript"> function clicknorm(){ $.ajax({ url:'@url.action("loadselectedcorelist")' datatype:'json', success:function(res){ if(res && res.length>0){ $('#selectedcore).empty(); $.each(res,function(index,item){ $('#selectedcore').append(n

c - Building error leads the Code Blocks to quit -

i'm writing c code solve numerical problem, define 100x100 matrix , fill values matrix, b solution : a[i][j]=1/(i+j+1) , b[i]= sum of values in ith row following code: #include <stdio.h> #include <stdlib.h> #define n 100 int main() { double a[n][n]; double b[n]; int i,j; (i=0;i<n;i++) (j=0;j<n;j++) { b[i]=0; a[i][j]=0; } (i=0;i<n;i++) (j=0;j<n;j++) { a[i][j]=1/(i+j+1); b[i]+=a[i][j]; } int c=10; (i=0;i<n;i++) (j=0;j<n;j++) { printf("%lf\t",a[i][j]); if (c==j) printf("\n"); c=c*10; } return 0; } whenever click on build button code blocks terminates, shows : cross platform ide stopped working and program closes. can me figure out problem?! you have problem a set 0, juste use 1. use double instead of int #include <

python 3.x - I am getting a list index out of range error -

i working on "connect 4" application, when running function see if there 4 in row error: list index out of range . if explain me how fix error explain why error such occurring in part of code, appreciated. i including code module because think should enough cover error. edit adding code main method show how list constructed. adding exact error. thank input. traceback (most recent call last): file "connect4alphaupdate1.py", line 164, in main() file "connect4alphaupdate1.py", line 30, in main winner = checkwinnerone(boardstatus) file "connect4alphaupdate1.py", line 106, in checkwinnerone if board[x][y] 1 , board[x][y+1] 1 , board[x][y+2] 1 , board[x][y+3] 1: indexerror: list index out of range def main(): # local variables playermove = 0 winner = false # list show board status boardstatus = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0

objective c - Facebook Graph Api call not working for iOS -

for ios app, using facebook sdk need fetch photos user's album need fetch them in single request info albums , containing photos @ same time, tried /me/albums?fields=count,name,photos.limit(10){images} that api call working fine in graph api explorer not on ios platform. need images field of photos why using above api call if run api runs fine /me/albums?fields=count,name,photos.limit(10) only {images} part causing problem, error message of unsupported url, have acquired permissions user_photos code : fbsdkgraphrequest *request = [[fbsdkgraphrequest alloc] initwithgraphpath:@"/me/albums?fields=count,name,photos.limit(10){images}" parameters:nil httpmethod:@"get"]; fbsdkgraphrequestconnection *connection = [[fbsdkgraphrequestconnection alloc] init]; [connection addrequest:request completionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) { if(!error) { nslog(@"result %@",resul

sql server - multiple counts with sql -

i have 2 tables, gages , schedule , , joined on company , serial number ( gage_sn ). i attempting total count each month, next 3 months, , total 3 months cumulatively below: type month next month 2 month total ---- ---------- ---------- ------------------ ----- indicators 4 8 2 14 calipers 0 16 16 32 ... i have following total count of gages, type, due month: select g.gage_type, count(g.gage_type) gages g left outer join schedgi s on s.company = g.company , s.gage_sn = g.gage_sn datepart(m, s.sched_due_date) = datepart(m, dateadd(m, +2, getdate())) , datepart(yyyy, a.sched_due_date) = datepart(yyyy, dateadd(m, +2, getdate())) , s.sched_type = 'calibration' , g.company = 'abc compant' , g.isactive = '1' , g.event_status <> 'msi' , g.event_st

android - showAsDropDown but upwards like spinner -

i have used popup listview work spinner .i want pop upwards spinner when @ bottom of screen . have tried : popupwindowdogs.showasdropdown(buttonshowdropdown,5,0); also, popupwindowdogs.showasdropdown(buttonshowdropdown, (int)(math.round(buttonshowdropdown.getx())),-(totallinear_layouts+buttonshowdropdown.getheight())); totallinearlayouts = sum of heights of linear layouts till button. this works on few devices not spinner. how can make work spinner? mean inflate size of device , list height. appreciate help. in advance. reference: https://www.codeofaninja.com/2013/04/show-listview-as-drop-down-android.html mainactivity.java public class mainactivity extends activity { string tag = "mainactivity.java"; string popupcontents[]; popupwindow popupwindowdogs; button buttonshowdropdown; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_

sql server - Additional fields to results of INTERSECT -

i have query looks match 6 fields between 2 tables , return matches. query uses inner joins. i've been testing intersect replace this. thus, select field1, field2, field3,...,field6 tablea intersect select field1, field2, field3,...,field6 tableb however, want add tablea.id , tableb.id results , can't quite written query won't take forever (relative original query). thoughts? update: regretfully, added comment performance when first concern how write query. can see, believe main issue bad , incorrect query structure haven't been able improve. attempt: select a.id, b.id tablea inner join ( select field1, field2, field3,...,field6 tablea intersect select field1, field2, field3,...,field6 tableb ) dupes on ( a.field1 = dupes.field1 , ... a.field6 = dupes.field6 ) inner join tableb b ( b.field1 = dupes.field1 , ... b.field6 = dupes.field6 ) a simple inner join on 6 fields return records both tables having common field valu

c# - dynamic filters in asp.net mvc 4 -

i want this: var list = db.respaldoes.where(x => x.type == "backup"); if (condicion1) list.where(x => x.entity == "gielcjlt03"); if (condicion2) list.where(x => x.activity_type == "0"); i don't know if possible, list filters never applied. you try this: var list = db.respaldoes.where(x => x.type == "backup"); if (condicion1) list = list.where(x => x.entity == "gielcjlt03"); if (condicion2) list = list.where(x => x.activity_type == "0"); initially list when clause, x => x.type == "backup" , executed give initial list refer to. then, if condicion1 true, make second fitering , assign result list. there again have deffered execution. when list requested consumed piece of code executed -hence name deffered execution . same holds second condicion , on.

excel formula - PULL DATA FROM TWO SHEETS -

looking excel formula match data in sheet 1 column (delivery number) data in sheet 2 column b (delivery number), pull data that's in sheet 2 column (po number) new column in sheet 1. there more lines in sheet 2 column b in sheet 1, column a. please help! if po number numeric can use =sumifs(sheet2!a:a,sheet2!b:b,a2)/countifs(sheet2!b:b,sheet1!a2)

sql - postgresql: alter table add constraint foreign key vs foreign key defined in a table -

i reading migrations of existing web app: ... create table billabletime ( id int8 not null, ... project int8, primary key (id), unique (employee, project, date) ); ... create table project ( id int8 not null, ... primary key (id) ); ... alter table billabletime add constraint fk3eba06e37be2cbe foreign key (project) references project; i not understand 2 things: 1) why not use simple reference declaration create table billabletime ( id int8 not null, ... project int8 references project (id), primary key (id), unique (employee, project, date) ); what benefits of method? 2) why constraint name weird: fk3eba06e37be2cbe ? there reason that? 1) why not use simple reference declaration your orm works mysql too, , mysql ignores inline foreign key declarations, you'd have long way. there's less code support adding foreign keys when create table , adding foreign keys later. 2) why constra

c - When reading from a file I get special characters, that are not in my text file -

for starters, don't know if has os on osx. when running program , printing out read text file following: a b c d e f g h j k l m n o p q r s t u v w x y z b c d e f g h j k l m n o p q r s t u v w x y z\353`\232\377 i reading new text document created using text wrangler, turned on invisibles make sure there wasn't @ end of file. code using read text file here: // parses text file, passes parsed text writeandencode writing , encryption. int encode(char *fileread, char *filewrite) { // file file *filetoread = fopen(fileread, "r+"); // open file reading char *textwithinfile; // check if file can read if (fileread != null) { // file can read. // length of file fseek(filetoread, 0l, seek_end); size_t size = (size_t)ftell(filetoread); rewind(filetoread); // make sure no error in finding size of file. if (size != -1) { long charsize = sizeof(char); tex

c# - How to read sql XML field in .Net -

in .net, dataset contains field following xml data in it. ran script in sql generate xml data need read in .net (c# or vb.net) <candidate> <inspector inspectorid="6390" name="john doe"> <qualification> <qualification docid="23107" filesize="248724" name="aws cwi" enddate="2016-12-01t00:00:00" datecreated="2014-07-23t21:30:00" /> </qualification> </inspector> <inspector inspectorid="6564" name="jane roe"> <qualification> <qualification docid="25183" filesize="48114" name="cswip 3.1 welding (or equiv)" enddate="2015-11-01t00:00:00" datecreated="2014-08-27t12:47:00" /> <qualification docid="25185" filesize="449518" name="rt level ii" enddate="2017-12-17t00:00:00" datecreated="2014-08-27t12:

Hibernate-Spring: Java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition -

my problem is: spring-cfg.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-cont

lisp - Delete all Occurences -

delete occurrences problem 5 (0 / 32) define function deleteall has 2 input argument x , l, x atom , l list contains atomic elements , sublists level, , function returns list occurrences of x deleted list l. i have problem when list has sublists. cant go recursively in sublists check whether has contains duplicate or not. (defun deleteall (x l) (cond ((null l) nil) ((not(atom(car l))) (deleteall x (cdr l))) ((not(eq x (car l))) (cons (car l) (deleteall x (cdr l )))) (t(deleteall x (cdr l))))) in second term know predicate got list in first element. should same third consequent except need process car cdr .

computer architecture - Digital Design simple operation finding of Mux and Decode? -

Image
my filed not digital design ran simple problem. how can find operation of following 2 diagram without using truth table ? (i.e write equation these) we not supposed homework. give idea, here answer. mux: c.not(b).a + b.not(a) it 3 8 decoder: not(a).b.c + a.not(b).not(c) + a.not(b).c

Java Interface Like Predicate but Without Argument -

as stated in title, i'm looking preexisting functional interface predicate 1 test method takes no arguments. if such animal exists, i’d appreciate reference. thanks. you're looking booleansupplier . https://docs.oracle.com/javase/8/docs/api/java/util/function/booleansupplier.html

android - How can increase/decrease duration of translate animation dynamically (on-the-fly) -

in app large text in textview scroll automatically translate animation, , designed 2 button decrease , increasing speed, when change duration it's work after last duration not on-the-fly, want whenever clicked, in moment duration changed.in fact want how change duration of animationdrawable on fly/runtime? ,but, "translation animation" here did randomly blinking light final imageview imagelight = (imageview)findviewbyid(r.id.imagelight); lastlightalpha = (float) math.random(); alphaanimation blinklightanimation = new alphaanimation(1.0f, lastlightalpha); blinklightanimation.setduration((long) (math.random() * 3000)); blinklightanimation.setanimationlistener(new animation.animationlistener() { @override public void onanimationstart(animation animation) { } @override public void onanimationrepeat(animation animation) { } @override public void onanimationend(animation anim