Posts

Showing posts from September, 2010

sql - SSIS Package What credential SSIS is running? -

i have package access excel file .xls. file located on network path. the packaged called store pass use32bitruntime = true. store called c# code. if file local file => package run successfully. if file network path => package run failed. checking network path: can access network path , open file manually successful. so question credential ssis package running? if runs under account logg-in sql , call store, should access file. it's not. turns out credential substituted own. after search quite long time, can't find answer. any on appreciated. this store execute ssis alter procedure [dbo].[execute_ssis_package] @folder_name varchar(100) ,@project_name varchar(100) ,@package_name varchar(300) --,@runaccount varchar(300) output ,@output_execution_id bigint output begin set nocount on; declare @execution_id bigint exec ssisdb.catalog.create_execution @folder_name, @project_name, @package_name, @use32bitruntime = t...

php - How secure is simple admin validation with if statement? -

i wondering how secure simple php script if statement admin password. say, have webpage want login edit content. if created html login script, retrieved credentials through post, , validated password , username through 'if' statement, such as if ($_post['pass'] = 'somepasswordwithalotof123456789' , $_post['user']) { .. stuff ... } i'm sure approach have major security issues, i'm curious go wrong i'm researching bit on writing secure php applications. reason why interested in approach, avoids database contact. also, aware of possibility of brute force attacks approach. thanks in advance. that secure how keep web server's ftp/filesystem access away users, no 1 able see script's source code. therefore, might want hash password before comparing. echo password_hash('somepasswordwithalotof1234567', password_bcrypt); this output: $2y$10$abapxe/k/mdqwzkrf7jhc.7z6gks0yfzdrgoxgxes24oh1/224b.c now, use ...

php - Http to https redirect not working for few pages -

following htaccess code working on home page. when enter my.example.com in url, htaccess redirects https://my.example.com when enter my.example.com/login , it's not redirecting https://my.example.com/login (i don't want www in domain name) <ifmodule mod_rewrite.c> rewriteengine on options +followsymlinks rewritebase / rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] rewritecond %{http_host} ^[^.]+\.[^.]+$ rewritecond %{https}s ^on(s)| rewriterule ^https://%{http_host}%{request_uri} [l,r=301] </ifmodule> please let me know going wrong? thanks keep redirect rule before internal rewrite ones , fix syntax error in http->https error: rewriteengine on options +followsymlinks rewritebase / rewritecond %{https} off rewriterule ^ https://%{http_host}%{request_uri} [l,ne,r=301] rewriterule (.*) app/webroot/$1 [l]

angularjs - How to create promise? -

problem $window.print() called , not when promise success.how can create promise when data populated ? suggestion? 'use strict'; angular.module("printmodule").controller('printcontroller', ['$scope', '$window', '$q', function ($scope, $window, $q) { $scope.ticketpin = localstorage.getitem("pin"); $scope.payouttime = localstorage.getitem("payouttime"); $scope.payoutamount = localstorage.getitem("payoutamount"); var defer = $q.defer(); defer.resolve($scope.ticketpin); defer.resolve($scope.payouttime); defer.resolve($scope.payoutamount); defer.promise.then(function () { $window.print(); }) }]); function getfromlocalstorage (item, callback) { //to prevent errors if (callback) { return callback(localstorage.getitem(item)) ; } } var callback; callback = function (data) { //set variable data } //i make getfromlocalstorage f...

c# - Async Await top level handling -

i have 10 sql tables need extract data, process, , insert data table. don't want them in parallel, make use of io time. i have function: public async task promoteasync() { try { using (httransdb transactions = new httransdb()) using (zimportmaster importmaster = new zimportmaster()) using (zmasteraddress masteraddress = new zmasteraddress()) { // select out non error rows datatable dt = await httransdb.getvalidrowsasync(this.tableconfig.batchid, this.tableconfig.sourcetablename); // stuff // insert data using (httransdb transactionsdb = new httransdb()) { int result = await transactiondb.bulkcopyasync(dt); } } } catch (exception e) { // log exception , re-throw } } i run function in foreach loop each table: ...

php - Heroku and Mod_security: How to disable it -

i'm trying install piwik on heroku keep company's applications on same host. got other errors suppressed, 1 has stumped me: get request piwik.php failed. try whitelisting url http authentication , disable mod_security (you may have ask webhost). after making change, restart web server. heroku doesn't have guide on disabling mod_security , i've tried disabling through .htaccess file no luck. what whitelisting url http auth mean? easier configure hacking stack disable mod_security?

c++ - Linker error with static constant that doesn't seem to be odr-used -

the definition in standard odr-used pretty confusing when details (at least, me is). rely on informal definition of "if reference taken", except when lvalue-to-rvalue conversion available. integral constants, should treated rvalues, seems should excluded reference rule. here sample code failing link: class test { public: test(); static constexpr int min_value { 5 }; int m_othervalue = 10; }; test::test() { m_othervalue = std::max(m_othervalue, min_value); } int main() { test t; } and linker error get: clang++ -std=c++14 -o2 -wall -pedantic -pthread main.cpp && ./a.out /tmp/main-e2122e.o: in function `test::test()': main.cpp:(.text+0x2): undefined reference `test::min_value' clang: error: linker command failed exit code 1 (use -v see invocation) live sample: http://coliru.stacked-crooked.com/a/4d4c27d6b7683fe8 why definition of min_value required? it's constant literal value, compiler should optimize out std::max(m_oth...

performance - Fast way to compute only the diagonal of the square of a matrix -

i have nxm matrix v , of compute square s=v'*v . following computations need diagonal of s , write s=diag(v'*v) . however, bit of waste, because i'm computing off-diagonal elements. there fast way compute diagonal elements of s ? use for loop, of course, explicit looping isn't fast way stuff in matlab. thanks!!! that's easy: sum(conj(v).*v,1) or sum(abs(v).^2,1) if matrix real, can simplify to sum(v.*v,1) or sum(v.^2,1)

switch functions in c -

trying create menu driven employee data program. don't know how create functioning menu , having trouble getting menu options work such editing entered employee info. appreciate can on this. errors arising edit employees function: redefinition; different basic types. in main —when calling menu function using menu(&payroll) , error message is, cannot convert input* input . also in main—the function employeeinfo(&payroll) giving error message, cannot convert input* input . i'm sure there many other mistakes making if see please guide me in right direction. #include <stdio.h> #include <stdlib.h> #include <string.h> //this macro intended use emplyname array. #define size 20 //this struct has varibles using in functions typedef struct { char emplyname[5][size]; float emplyhours[5]; float emplyrate[5]; float emplygross[5]; float emplybase[5]; float emplyovrt[5]; float emplytax[5]; float emplynet[5]; floa...

c++ - Qt: How to set topMargin of paragraph in QTextEdit -

i trying set margin above first paragraph of qtextedit . problem shows above second paragraph; between first , second paragraph. my current code is: auto doc = ui->textedit->document(); auto blockformat = doc->begin().blockformat(); blockformat.settopmargin(100); qtextcursor{doc->begin()}.setblockformat(blockformat); is intended behavior of qt? how achieve desired outcome of having margin above every paragraph, including first? this seems design. simple workaround insert empty paragraph, or paragraph transparent 1x1 image.

qt - Using float or double for own QML classes -

i've created components , helper methods using c++ , qt used in qml gui. of methods calculate gui elements (size, transformations, scene graph items creation). target arm 32 bit using opengl / eglfs render output. opengl using float , qml using real (defined double ). what should use in c++ do not lose precision? if use qreal ( double ) shouldn't lose precision. if git grep float in qtbase.git , can find out bit more: dist/changes-5.2.0-**************************************************************************** dist/changes-5.2.0-* important behavior changes * dist/changes-5.2.0-**************************************************************************** dist/changes-5.2.0- dist/changes-5.2.0- - qt compiled qreal typedef'ed double on dist/changes-5.2.0: platforms. qreal float on arm chipsets before. guarantees more dist/changes-5.2.0- consistent behavior between platforms qt supports, binary dist/chan...

html - Table inside scrollable container still causes container width to grow -

Image
i using bootstrap grid. facing strange issue displaying tables inside bootstrap column. i have table columns, displayed inside div (table container). table container has col-md-9 bootstrap class, width set 75%. however, @ point if table contains content and/or column, causes container's width expand. here standalone example: https://output.jsbin.com/xowihu here screenshot. notice gray box getting pushed outside, causing layout broken: and, when removed columns table, works , looks expected: the thing confuses me that, have specified overflow: scroll on table container. why content length affecting container width? i have tried: setting table-layout: fixed on table, , word-wrap: break-word on table cells. works, table contents visually horrible; 1 word broken 3 lines, etc. setting max-width on table container works, has in px unit. might last resort (and applied via javascript) since site has various layout widths. edit link code: https://jsbin.com/xowihu...

node.js - Multiple level of sections in page_objects in nightwatch.js -

i have started out using nightwatch.js , , using page_objects access elements in tests. wondering there anyway can have sections within sections in page objects? know can specify 1 level of section. have done : module.exports = { url : 'http://127.0.0.1:8111/local.html#open?view=shelf&lang=en_us', sections : { topcontainer : { selector : '.top_container', elements : { logo : { selector : '.logo' }, settingsbutton : { selector :'.dropdown' }, searchbox : { selector : '.search_box' }, sortorderbutton : { selector : '.icond' } } }, library : { selector : '.library', booklist : { selector : 'ul.library_container' } } } }; can have sections inside sections , , in case not , how select in test case @variable client.elements('css selector',...

mysql - Error 1111 when calling a stored function -

so found post talked putting logic tests behind having instead of where. missing that's still tripping error 1111? drop procedure if exists elo; delimiter // create procedure elo() begin -- declares... label1: while xgame <= max(games.game_id) select games.game_id, games.game_type, games.date, games.home_team, games.away_team, games.runs0, games.runs1 games games.game_id = xgame having (games.game_type = 0 or games.game_type = 3) @id, @ty, @d, @home, @away, @homer, @awayr; set starthomeelo = (select team_elo.team_id, team_elo.date, team_elo.elo team_elo team_id = home having min(d - team_elo.date)); set startawayelo = (select team_elo.team_id, team_elo.date, team_elo.elo team_elo team_id = away having min(d - team_elo.date)); set elodiff = abs((starthomeelo + 25) - startawayelo); set homeelo = (starthomeelo + (40*power(rundiff, (1/3)) * (homewin - (1/(power(10, (elodiff/400)) + 1))))); set awayelo = (starta...

javascript - Why does my Promise definition gets executed? -

i quite new promises , want know why promise definition gets executed without me calling .then() or resolve on it. var promise = new promise(function (resolve, reject) { console.log("starting loader"); resolve(); }); if run sample , see console see 'starting loader' message. https://jsfiddle.net/npqgpcud/ that how promises defined. run executor function immediately. it's in spec: promise(executor) , step 10. this instance of revealing constructor pattern ; reading might understand.

java - Using boolean flag -

i not sure how change inside of if statement in code fragment below reflect false. matches boolean method if (toppilecard.matches(super.getcardfromhand(i))) { tempcardarray[i] = super.getcardfromhand(i); } the easiest way include exclamation mark ! @ beginning of condition statement: if (!toppilecard.matches(super.getcardfromhand(i))) { tempcardarray[i] = super.getcardfromhand(i); } in java, ! can used mean false or not . example, != comparator means "not equal to", opposed == means "equal to".

how to convert string into JSON in javascript -

this question has answer here: safely turning json string object 20 answers i trying convert below string value json: var yourmsg = '{"yourid":{"latlng":[123,456],"data":{"id":2345," name ":" basanta ","status":"available"}}}'; please me out. all object keys need strings, can't use yourid key without qoutation marks: var yourmsg = '{"'+yourid + '":{"latlng")+:[' + yourlat + ','+ yourlng + '],"data":{"id":' + yourid +'," name ":" basanta ","status":"available"}}}';

sql - Grouping by as a single row with results as a column? -

this question has answer here: create pivot table postgresql 1 answer i have scores table this: code | week | points 1001 | 1 | 2 1001 | 1 | 1 1001 | 3 | 6 2001 | 1 | 0 2001 | 4 | 5 2001 | 4 | 2 what i'd result this: code | 1 | 3 | 4 1001 | 3 | 6 | 2001 | 0 | | 7 i've written simple group use write code around i'd rather work in sql. http://sqlfiddle.com/#!15/8ff5d select code, week, sum(points) total scores group code, week order code, week; and result is: code | week | total 1001 | 1 | 3 1001 | 3 | 6 2001 | 1 | 0 2001 | 4 | 7 i'm sure it's simple i'm stumped. in advance help. you're looking pivot function: similar question: create pivot table postgresql when number of columns fix, it's more or less simple. if number dynamic,...

Is it possible for Parquet to compress the summary file (_metadata) in the MR job? -

right using mapreduce job convert data , store result in parquet format. there summary file (_metadata) generated well. problem is big (over 5g). there way reduce size? credits alex levenson , ryan blue: alex levenson: you can push reading of summary file mappers instead of reading on submitter node: parquetinputformat.settasksidemetadata(conf, true); (ryan blue: default 1.6.0 forward) or setting "parquet.task.side.metadata" true in configuration. had similar issue, default client reads summary file on submitter node takes lot of time , memory. flag fixes issue instead reading each individual file's metadata file footer in mappers (each mapper reads metadata needs). another option, we've been talking in past, disable creating metadata file @ all, we've seen creating can expensive too, , if use task side metadata approach, it's never used. (ryan blue: there's option suppress files, recommend. file metadata handled on tasks, ther...

layout - Android - Disable onClick highlight for one group in expandable list? -

i have expandablelistview backed implementation of baseexpandablelistadapter . first group in list functions header , not expandable. i've set ischildselectable() return false group , everything's functioning normally. however, when user clicks on non-expandable group, ui still highlights row. confusing , unnecessary visual cue i'd eliminate. i can't set android:listselector="@android:color/transparent" on expandablelistview itself, because do want other list items highlighted upon click , expansion. is possible suppress click highlighting first group (only)? try set individual parent view's onclicklistener null getgroupview() . view getgroupview(int groupposition, boolean isexpanded, view convertview, viewgroup parent) { ... convertview.setonclicklistener(null); ... }

digital ocean - Change DigitalOcean access token for docker-machine -

i created host using digitalocean driver. however, had generate new access token , unable connect it. how reconfigure docker-machine use new access token? each host spun docker-machine creates folder holding configuration under ~/.docker/machine/machines/ digitalocean access token , other information droplet stored in config.json file. let's @ specific 1 example: $ cat ~/.docker/machine/machines/docker-001/config.json | jq . { "drivername": "digitalocean", "driver": { "accesstoken": "9dasd89ssf6542notarealtoken455b44sdgf4685", "dropletid": 4906043, "dropletname": "", "image": "ubuntu-14-04-x64", "machinename": "docker-001", "ipaddress": "45.32.128.70", "region": "nyc3", "sshkeyid": 7697371, "size": "512mb", "cacertpath": ...

javascript - I there anyway to define a dict in jsoncschema? -

i trying define schema object type. there way allow property name, restrict property values adhere schema. way can allow key , ensure values of same structure/type. thanks in advance. the additionalproperties keyword can either boolean or schema. if it's schema, schema must apply properties don't match either properties or patternproperties . therefore, if keys can anything, schema just: { "type": "object", "additionalproperties": {"type": "integer"} } you'd need use patternproperties if want restrict keys - example, lower-case alphabetic only: { "type": "object", "patternproperties": { "^[a-z]+$": {"type": "object"} }, "additionalproperties": false } since want allow any property name, additionalproperties best solution you.

php - MySQL Order by specific rows only -

i have mysql query returns results in following way: id | count | type ------------------ 1 | 1000 | 1 2 | 100 | 2 3 | 80 | 2 i order results rows type 2 . order of other rows not matter, although control on order them useful down line. resulting order therefore id = 2 id = 3 id = 1 . possible without doing in post-processing? if want order rows type 2 first , else after: select ... order if(type = 2, 0, 1) asc

c# - How to add markers to SKMaps? -

i developing android application skmaps. managed run load map, add route , start/stop navigation. can't seem find way add markers. skmapsurfaceview has methods .addcircle or .addcustompoi. i tried circle , drew nothing. skcircle c = new skcircle(); c.circlecenter = new skcoordinate(longitude, latitude); c.radius = 50; c.outlinesize = 1; c.setcolor(new float[] { 0.0f, 0.0f, 0.0f }); c.setoutlinecolor(new float[] { 255.0f, 0.0f, 0.0f }); surface.addcircle(c); then tried custom poi: skmapcustompoi poi = new skmapcustompoi(); poi.category = skcategories.skpoicategory.skpoicategorybuilding; poi.location = new skcoordinate(longitude,latitude); poi.uniqueid = 195; surface.addcustompoi(poi); this resulted in application crash. crashes no exception being caught visual studio. how can add marker map? remove when no longer needed? the online documentation pretty nonexistent. thing have found markers 'how rotate marker'. the official documentation has "setcu...

css - How to get these timestamps, which come after in the html, to float right on the same line -

i have markup, can't change, looks this: <div class="message"> <p class="messagetext">long long long long long long long long long message wraps</p> <span class="timestamp">6:30:07 pm</span> </div> <div class="message"> ... how can style css this?: long long long long long long 6:30:07 pm long long long message wraps next message 6:31:58 pm i want timestamps go on over right, directly right of message correspond to. if timestamps appeared before messages in markup, float them right , work fine. how do in case, given appear after messages? assuming these timestamps consist of same amount of characters, , therefor have (roughly) same width, positioning them absolutely easy solution: .message { position:relative; padding-right:5em; } .timestamp { position:absolute; top:0; right:0; } https://jsfiddle...

c - How to change a block cipher algorithms ciphertext and plaintext length -

i designing encryption program. use sm4 block cipher algorithm. now, program requires ciphertext , plaintext 64bit long , key 128bit long, sm4's ciphertext , plaintext 128bit long. try more different way, result of decrypt incorrect. how can change 64bit? this source code: sm4.h: /** * \file sm4.h */ #ifndef xyssl_sm4_h #define xyssl_sm4_h #define sm4_encrypt 1 #define sm4_decrypt 0 /** * \brief sm4 context structure */ typedef struct { int mode; /*!< encrypt/decrypt */ unsigned long sk[32]; /*!< sm4 subkeys */ } sm4_context; #ifdef __cplusplus extern "c" { #endif /** * \brief sm4 key schedule (128-bit, encryption) * * \param ctx sm4 context initialized * \param key 16-byte secret key */ void sm4_setkey_enc( sm4_context *ctx, unsigned char key[16] ); /** * \brief sm4 key schedule (128-bit, decryption) * * \param ctx sm4 context initialized * \para...

java - Print output on the same line -

i'm making translator in java translate fake language came fun. input english word , returns it's equivalent word in other language. it's translating everything, each new word on separate line , want output on 1 line. i'm still new java here code: import java.io.*; import java.util.*; public class translator { private static scanner scan; public static void main(string[] args) { hashmap <string, string> xanthiumlang = new hashmap <string, string>(); xanthiumlang.put("hello", "fohran"); xanthiumlang.put("the", "krif"); xanthiumlang.put("of", "ney"); xanthiumlang.put("to", "dov"); xanthiumlang.put("and", "ahrk"); scanner scan = new scanner(system.in); string sentence = scan.nextline(); string[] result = sentence.split(" "); ...

scala - inferSchema in spark-csv package -

when csv read dataframe in spark, columns read string. there way actual type of column? i have following csv file name,department,years_of_experience,dob sam,software,5,1990-10-10 alex,data analytics,3,1992-10-10 i've read csv using below code val df = sqlcontext. read. format("com.databricks.spark.csv"). option("header", "true"). option("inferschema", "true"). load(sampleaddatas3location) df.schema all columns read string. expect column years_of_experience read int , dob read date please note i've set option inferschema true . i using latest version (1.0.3) of spark-csv package am missing here? 2015-07-30 the latest version 1.1.0 , doesn't matter since looks inferschema is not included in latest release . 2015-08-17 the latest version of package 1.2.0 (published on 2015-08-06) , schema inference...

java - The difference between = and == -

what difference between = true , == true in : void startengine(){ if ( enginestat == true ) system.out.println("the engine on "); else { enginestat = true; system.out.println("the engine on"); } == outputs boolean represents whether 2 expressions equal. (the boolean equal true or false). = assigns value of expression on right side variable on left.

Two different analytics conflict -

i have been looking while before coming ask here, because know topic has been covered. needed put 2 different analytics on same website, inserted code before closing head tag of every page on website. found solution seemed work, creating 2 different trackers , sending them separately. results don't match : first tracker shows 70 visits, whereas second 1 shows 800, , set both @ same moment. (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-40380819-3', 'auto',{'name': 'tracker1'}); ga('tracker1.send', 'pageview'); (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q|...

php - How to create this urlManager rule? -

first of all, excuse low english. having following action in controller named webcontroller: public function actionpage($view = 'index') { try { return $this->render('site/page/' . $view); } catch (invalidparamexception $e) { throw new httpexception(404); } } i need rule following: localhost/cookies equals localhost/?r=web/page&view=cookiesyprivacidad or localhost/faq equals localhost/?r=web/page&view=preguntas something this: 'rules'=>array( 'cookies'=>'web/page' ) but adding fixed parameter. you need this 'urlmanager' => array( 'rules' => array( <view:(cookies|faq)>' => 'web/page' ) )

javascript - Fetch geometry of an Address Location -

if search textual address (let's address "305 quincy st ne"), how go doing in arcgis using arcgis api javascript ? my aim call function has geometry of place passed function argument. function showlocation(evt) { map.graphics.clear(); var point = evt.result.feature.geometry; // how value textual address? . . . } use locator class. here's example: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>using locator find address</title> <link rel="stylesheet" href="https://js.arcgis.com/3.14/esri/css/esri.css"> <style> html, body, #map { height:100%; width:100%; margin:0; padding:0; } body { background-color:#...

java - MS SQL Bulk update\insert -

some time ago faced problem of bulk insert\update ms sql database. task pretty simple - retrieve data db, perform data transformation , update parent table , fill out child table. volume of data huge, that's why interested in performant way this. in db (stored procedures, file processing, etc) not applicable, since need piece of information third-party application. although in internet can find lot of articles of how disable autocommit , perform batch inserts\updates, anyway send requests one-by-one. applicable majority free jdbc drivers, including popular 1 - net.sourceforge.jtds.jdbc.driver ( http://sourceforge.net/p/jtds/discussion/129584/thread/8e89906c/ ). datadirect supports such functionality, it's not free. fiy - list of jdbc drivers sql server 2008 (comparison) . please share experience in solving similar problems. best regards, alex we solved problem in other way. since need perform 2 pieces of data modification (insert new child record ...

mysql - PHP Mysqli replace comma if data is Null or empty during fetch -

have issue comma "," when fetching data if data selected id empty coma(,) shows want if data null or empty "," should not show unable do. say selecting data for id 1 ,2 ,3 where id 1 num 6789 , id 2 has no num , id 3 has 12345 $query="select num euser userid in (select id master aa='aa' , cc='cc')" ; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $num = array(); while($row=mysqli_fetch_array($data)){ $num[] = $row['num']; } $numstr = implode(',', $num); echo $numstr; mysqli_close($mysqli); present output 6789,,12345 expecting output 6789,12345 use isset() while ($row = mysqli_fetch_array($data)) { if (isset($row['num']) && $row['num'] != "") { $num[] = $row['num']; } } $numstr = implode(',', $num);

c# - Cannot implement type with a collection initializer because it does not implement 'System.Collections.IEnumerable' -

i'm working in c# , xna. i have class: class quad { public texture2d texture; public vertexpositiontexture[] vertices = new vertexpositiontexture[4]; } and i'm trying create new instance of said class: quad tempquad = new quad() { texture = quadtexture, vertices[0].position = new vector3(0, 100, 0), vertices[0].color = color.red }; which added list of "quad"s quadlist.add(tempquad); i keep either getting error: "cannot implement type collection initializer because not implement 'system.collections.ienumerable'" or told vertices not exist in current context. is there reason can't create class this? being dumb? have this?: quad tempquad = new quad(); tempquad.vertices[0].position = new vector3(0, 100, 0); tempquad.color = color.red; quadlist.add(tempquad); is there way around @ all? appreciated. the object initialize syntax expecting assignment properties on objec...

List all days of a month ASP.NET C# -

Image
i want generate pivot table days of month image below. is there way make list of days dynamically in sql or c#? month , year binded dropdownm, filled manually. <asp:label id="llbmes" runat="server" text="mês"></asp:label> </td> <td> <%--months--%> <asp:dropdownlist id="ddmes" runat="server" height="18px" width="90px"> <asp:listitem text="janeiro" value="1"></asp:listitem> <asp:listitem text="fevereiro" value="2"></asp:listitem> <asp:listitem text="março" value="3"></asp:listitem> <asp:listitem text="abril" value="4"></asp:listitem> <asp:listitem text="maio" value="5"></asp:listitem> <asp:listitem text="junho" value="6"></asp:listitem> <asp:list...

ios - When to use UITouch vs UIScroll -

i achieve design see in dating apps. can vertically scroll images of profile , horizontally scroll view next or previous person in list. currently have views laid out such. previous-uiview - current uiview - next uiview uiscrollview. uiscrollview. uiscrollview images. images. images uiview. uiview. uiview profile info. profile info. profile info uipagecontrol. uipagecontrol uipagecontrol. only 1 of views occupies main view next , previous off screen. ideally when user moves view left programmatically remove previous view, make current previous, next current , add new view next. visa versa moving right. what best way scroll views horizontally? should wrap them in uiscrollview? , interfere uiscrollview sub views? or should program touch controls move views? or there better way? i'm still newbie @ ios development appreciated. ...

javascript - string.split not working as intended in Firefox? Works fine in Chrome -

having bit of issue here. have code: //phonenumber string ie ('01☂916☂5234321') var phonenumbersplit = phonenumber.split('☂'); console.log(phonenumbersplit); //in chrome returns ["01", "916", "5234321"], in firefox returns //[ "01☂916☂5234321" ] i later call phonenumbersplit[1] in chrome fine, in firefox says it's undefined . why string.split return 2 different things depending on browser i'm in? documentation says works in both firefox , chrome. help? edit oooook figure out issue was. on page testing on charset="utf-8" missing meta tag , wasn't reading unicode character. in chrome guess have utf-8 on default , in firefox not, or something. whoops. i figured out issue was. on page testing on charset="utf-8" missing meta tag , wasn't reading unicode character. in chrome guess have utf-8 on default , in firefox not, or something. whoops.

python - How to get the number of symbols in a SymPy expression -

i trying number of symbols in sympy expression like: a = sympify('1/4*x+y+c+1/2') the number instance should 3 . came far a.args.__len__() however, counts constant factors 1/4 , 1/2. any ideas? you need use atoms method list symbols in expression. in [32]: a.atoms(symbol) out[32]: {c, x, y}

python - Plot dashed line interrupted with data (similar to contour plot) -

Image
i stuck (hopefully) simple problem. aim plot dashed line interrupted data (not text). as found out create dashed line via linestyle = 'dashed' , appreciated put data between dashes. something similar, regarding labeling, existing matplotlib - saw in the contour line demo . update: the question link mentioned richard in comments helpful, not 100% mentioned via comment. currently, way: line_string2 = '-10 ' + u"\u00b0" +"c" l, = ax1.plot(t_m10_x_values,t_m10_y_values) pos = [(t_m10_x_values[-2]+t_m10_x_values[-1])/2., (t_m10_y_values[-2]+t_m10_y_values[-1])/2.] # transform data points screen space xscreen = ax1.transdata.transform(zip(t_m10_y_values[-2::],t_m10_y_values[-2::])) rot = np.rad2deg(np.arctan2(*np.abs(np.gradient(xscreen)[0][0][::-1]))) ltex = plt.text(pos[0], pos[1], line_string2, size=9, rotation=rot, color='b',ha="center", va="bottom",bbox = dict(ec='1',fc='1', alpha=0.5)) ...

iphone - Are there any limitation for using CorePlot within an iOS in commercial application? -

most stack overflow questions asking graph plotting libraries in ios have answer coreplot . some, dating 2012, ask if there alternatives answer out dated , not comprehensive. asked myself question months ago , got directed coreplot. i struggle understand why apple has not included native ios framework draw graphs. leaving aside consideration wondering how reliable include coreplot in commercial application (will coreplot code supported in future? stable?). what limitations in using this? is there reliable , proven alternative? is there suggestion may want give me in case decide use coreplot in application? basic step structure code in mvc pattern can substitute library if better 1 comes on. more suggestions welcome (is there specific data structure proves useful graphs?). coreplot contains license describes in detail must use , can use it: copyright (c) 2014, drew mccormack, brad larson, eric skroch, barry wark, dirkjan krijnders, rick maddy, vijay kalusani...

android - Multiple TextWatcher added to same EditText in ExpandableListView's group view -

from conclusion of previous post not able track how textwatcher being added multiple times edittext in expandablelistview. arraylist has 2 elements. the output should list 0 , 1 once called twice. adapter: public class expandablelistadapter extends baseexpandablelistadapter { private layoutinflater inflater; private context context; private expandablelistview accordion; private int lastexpandedgroupposition; arraylist<modelobject> mparent; textview textviewlabelgrandtotal; float grandtotal = 0; public expandablelistadapter( context context, arraylist<modelobject> modelobject, expandablelistview accordion, textview textviewlabelgrandtotal) { mparent = modelobject; inflater = layoutinflater.from(context); this.accordion = accordion; this.context=context; this.textviewlabelgrandtotal=textviewlabelgrandtotal; } @override //counts number of group/par...