Posts

Showing posts from September, 2010

asp.net mvc 4 - ViewModel List object return Null on HTTPPost -

i posting form server, values null. model: public class rdetailsviewmodel { public rdetailsmaster rdetailsmaster { get; set; } public etransaction etransaction { get; set; } } public class rdetailsmaster { [required] public list<qe_dropdown_mst> master_eq { get; set; } [required] public list<qe_dropdown_mst> master_basis { get; set; } [required] public list<qe_dropdown_mst> master_te { get; set; } [required] public list<qe_dropdown_mst> master_alop { get; set; } [required] public list<qe_dropdown_mst> master_risk { get; set; } [required] public list<qe_dropdown_mst> master_excess { get; set; } [required] public list<qe_dropdown_mst> master_ctype { get; set; } } controller: [httppost] public actionresult rdetails(rdetailsviewmodel objr) { return view(); } my view : @model qms_erater.viewmodels.rdetailsviewmodel @{ viewbag.ti...

javascript - Fulling updating setState in reactjs -

in reactjs docs setstate : setstate() not mutate this.state creates pending state transition. accessing this.state after calling method can potentially return existing value. the second (optional) parameter callback function executed once setstate completed , component re-rendered. what if wanted update state, create callback nothing? the callback optional can this.setstate({ key: value }); .

java - properly using constructors to change int value? -

i have 2 classes. 1. main , 2. gun. gun: public class gun { private int ammoamount = 15; public int getammoamount() { //i believe allows me see value of ammoamount , use in main class. return ammoamount; // returns value of ammoamount getammoamount? } public gun(int ammousage) { //this constructor right? ammoamount = ammoamount - ammousage; //method makes ammoamount decrease ammousage. } public void newammoamount() { system.out.println("you have " + ammoamount + " bullet(s) left."); // output of how bullet left. } } main: import java.util.random; public class main { public static void main(string[] args) { random rand = new random(); gun fire1 = new gun(0); // need create objective? fire1.newammoamount(); // need code below? int clip = fire1.getammoamount(); // need set clip while loop? { //starts loop int x = 5; //max # random can go to. int...

c++ - Error with strtok Function -

in code unhandled expression error when use parse function. in popstack function right way delete last element of vector. error is: unhandled exception @ 0x0f463b50 (msvcr100d.dll) in boost_test.exe: 0xc0000005: access violation writing location 0x00345d49. class stack { public: stack() {globalindex=0; }; std::vector<char*> v; int globalindex; void addstack(char* txt); void parse(); void popstack(); void printstack(); }; void stack::parse() { char* tok; tok = strtok(v[globalindex-1], ";"); while(tok!=null) { cout<<"\nthe time value = "<<tok<<endl; tok = strtok(null, " "); } } void stack::addstack(char* txt) { v.push_back(txt); globalindex++; } void stack::popstack() { v.pop_back(); globalindex--; } void stack::printstack() { std::cout<<v[globalindex-1]<<endl; } int _tmain(int argc, _tchar* argv[]) { int i; ...

javascript - Regular Expression: Convert a numeric string from camelCase to regular -

i need convert alphanumeric string, written in camelcase regular string. input can of following strings: var strs = { input: [ "thisstringisgood", "somethinglikethis", "a123capshere345andherebutnot678here90end", "123capshere345andherebutnot678here90e", "abcacryonym", "xmlhttprequest", "thisdevicehasa3printingservice" ], expectedresult: [ "this string good", "something this", "a123 caps here345 , here not678 here90 end", "123 caps here345 , here not678 here90 e", "abc acryoynm", "xml http request", "this device has a3 printing service" ] }; after converting string expected format i'm doing this: function capsplit(str) { return str.replace(/(^[a-z]+)|[0-9]+|[a-z][a-z]+|[a-z]+(?=[a-z][a-z]|[0-9])/g, function (ma...

GIT utility to generate graph like this? -

Image
i working on assignment, need generate graph of git repository arrows is there utility generate graph this? know gitg, gitk; need utility through can generate graph in same format 1 shown in picture? an answer inside se here . links alias , creating dot file based on git repository pretty add: [alias] graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f" to .git/config. after this, can run , create diagram e.g. git graphviz head~100..head~60 | dotty /dev/stdin (also token link wiki resource). if redirect output dot-file, can manually compile graph on wishes dot or maybe neato. can adjust alias little better formatting (color, shape...) of e.g. nodes.

glib - Building Qemu(ARM emulation) for Windows64 on Linux64 -

i trying run emulation of arm vexpress in qemu. end platform windows64. , build system running linux64. using qemu version 2.3.0 , x86_64-w64-mingw32 toolchain. i faced quite lot of issues during build, solved on own. 1 of them tool chain on installation doesn't contain glib library , had import 1 got searching round internet. after adding pkg-config files , copying set of glib lib folder got whole thing start compiling. how ever facing new issue. checking librt while toolchain doesnt have librt. got version of librt , added toolchain lib folder , compilation throwing below error. @ steps appreciated. make all-recursive making in pixman make[3]: nothing done 'all'. making in demos make[3]: nothing done 'all'. making in test make[3]: nothing done 'all'. chk version_gen.h link qemu-ga.exe /home/user/downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o):(.text+0x505): undefined reference `__imp_cotaskmemfree' /home/user/down...

python - Get Data from Dict inside list inside dict -

i have output value elasticsearch in form u'hits': { u'hits': [ { u'_score': 1.0, u'_type': u'timer_data', u'_id': u'au_uj1dk4uyhlwrlflqv', u'_source': { u'std': u'0', u'upper': u'62.688', u'lower': u'62.688', u'count_90': u'1', u'tgt': u'duration', u'grp': u'request', u'sum_90': u'62.688', u'sum': u'62.688', u'median': u'62.688', u'count': u'1', u'mean_90': u'62.688', u'sum_squares': u'3929.7853440000004', u'ns': u...

python - "ERROR running Appium command: Cannot read property 'capabilities' of null" -

when trying run basic hello world kind of test appium , python following error happened: webdriverexception: message: url did not map valid jsonwp resource looking further found happened when web driver initialized: self.driver = webdriver.remote('http://localhost:4723/wd/hub', desired_caps) so typed in http://localhost:4723/wd/hub browser , got that url did not map valid jsonwp resource i googled, came across qa here on stackoverflow doesn't solve it. typed in http://localhost:4723/wd/hub/status { status: 0, value: { build: { version: "1.4.11", revision: "8cf8311f00e59a2b10fde1834fcf6d5ace6fbcd0" } } } and wd/hub/session , got { status: 13, value: "error running appium command: cannot read property 'capabilities' of null" } sadly there few google results of these errors , results don't solve problem. if know how make them go away, please ...

python - django many to many save admin -

i have model : class mymodel(models.model): name = models.charfield(max_length=100) type = models.manytomanyfield(type, blank=true) here admin adding mymodel. what want if type not provided while saving want type default teacher type teacher has not been created. if type not provided want create type , assign if type not provided according documentation 's example, can override save_model this: @admin.register(mymodel) class mymodeladmin(admin.modeladmin): def save_related(self, request, form, formsets, change): if not form.cleaned_data['type']: type, created = type.objects.get_or_create(name="teacher") form.cleaned_data['type'] = [type] form.save_m2m() formset in formsets: self.save_formset(request, form, formset, change=change)

regex - PHP Regular expression to find string enclosed in __("STRING_TO_EXTRACT") -

sorry suck @ regexp. need collect string on application enclosed in example: __("string") string may enclosed in single quote well. i tried following code: $str = "__('match1') __("match2") do_not_include __('match3')"; preg_match_all("/__\(['\"](.*)['\"]\)/", $str, $matches); var_dump($matches); but able match entire line string 1 match. example result below. please me edit regexp should able 3 matches. match1') __("match2") do_not_include __('match3 thanks in advance help. you can use: $str = "__('match1') __(\"match2\") do_not_include __('match3')"; preg_match_all('/__\(([\'"])(.*?)\1\)/', $str, $matches); print_r($matches[2]); ([\'"]) match either single or double quote , capture in group #1. .*? match 0 or more characters (non-greedy) \1 back-reference of above captured group make sure string cl...

$this->viewPath is not working with CakePHP 3.1 -

i have updated cakephp application 3.1 through composer, , i'm trying fix small or deprecated warnings. i fix $this->layout stuff don't understand how fix viewpath errors. looking @ migration guide looks should same thing: $this->viewpath = 'element'; should become $this->viewbuilder()->viewpath('element'); but not working, , thing is error: call undefined method cake\view\viewbuilder::viewpath() file /var/www/myapp/src/controller/invoicescontroller.php line: 375 what correct way fix this? from same migration guide, in view section of it: view::$viewpath deprecated. should use view::templatepath() instead. guess it's now: $this->viewbuilder()->templatepath('element');

html - Making display:inline behaves like display:inline-block -

i'm making form 2 input area, second area should content editable div somehow. i want make #topic_title_input sitting above #topic_content_input same width. achieved giving them display:inline-block , complicated reason, can't change display-inline property of second input area any idea how make #topic_title_input sitting above #topic_content_input ? html <div class="left_container"> <input id="topic_title_input" > <div id="topic_content_input" contenteditable="true" ></div> </div> <div class="right_container"> </div> <div class="clear_float"> </div> css #topic_title_input{ width:521px; } #topic_content_input{ /*do not change display:inline */ width:521px; display:inline; background-color: orange; border: solid 1px black; } /*do not change css below*/ .left_container{ position:relative; flo...

java - Detect file changes in Spring Integration -

use case: want listen file directory, , every time makes change on file, want start process. this configuration far: <int-file:inbound-channel-adapter directory="${dir}" auto-startup="${auto.startup}" prevent-duplicates="true" filter="inputfilefilter" channel=ruleschannel"> <int:poller fixed-delay="${delay}" /> </int-file:inbound-channel-adapter> where inputfilefilteris custom bean , ruleschannel processing later. the inputfilefilter takes array of files , returns list of files, sorted on file ending. seems pulling endlessly, , "prevent-duplicates"-check done after filter (i.e. file added, seems it's not sent ruleschannel). anyway, problem need whole thing pick file changes , not new files. mainly, it's configuration file being changed every , then, , need update keep in sync. yes, horrible solution over, it's not call, , seems have no choice. any ideas? edit: i've...

Google calendars API error - tooManyCalendarsRequested -

getting error, , life of me can't find documentation online how many many. have idea, or way find out? here's official documentation: https://developers.google.com/google-apps/calendar/v3/reference/freebusy/query you can use function set maximum id, read documentation: maximal number of calendars freebusy information provided. optional. i checked worked 50 items. req.setcalendarexpansionmax(50); here's link documentation.

javascript - Return object from AngularJS $scope ng-model -

i use angularjs framework, created form.html , controller.js variable retrieves ssid of box. how automatically assign value of variable in form. input field. when launching application, form should display ssid automatically without user needing so. $scope.ssid {}; return [object oject] in input form ng-model="ssid" thank kindly me. controller.js /*controller*/ 'use strict'; angular.module('djoro.controllers') .controller('wifismartconfigctrl', function($scope, $window, $ionicplatform) {a $scope.ssid = {}; $scope.getssid = function() { var onsuccess = function(ssid) { $scope.ssid = ssid; return ssid; }; var onfail = function() {}; $ionicplatform.ready(function() { $window.cordova.plugins.smartconfig.getssid(onsuccess, onfail, $scope.ssid); }); }; }); <script src="https://ajax.googleapis.com/ajax/libs/angularjs...

c# - How to save an image into a database? -

i using wpf insert image mysql database. can upload file image control don't know how save it. here i've done far. emp_image image control displays photo. private void btn_save_image_click(object sender,...) { mysqlconnection cn= new mysqlconnection(connectionstring); byte[] imagedata; imagedata=file.readallbytes(emp_img); //..here error,it says has invalid arguments..// mysqlcommand= new mysqlcommand("insert dep_table(photo)values(?data)",cn); cmd.parameters.addwithvalue("?data", imagedata); cn.open(); cmd.executenonquery(); cn.close(); } you need convert image source byte[] : public static byte[] imagetoarray(bitmapsource image) { var encoder = new jpegbitmapencoder(); encoder.frames.add(bitmapframe.create(image)); using (var stream = new memorystream()) { encoder.save(stream); return stream.toarray(); } } then, call function: imageda...

LibGDX on Raspberry Pi using JOGL - error on run -

i'm trying run libgdx desktop app (a simple app displaying image , nothing else) on raspberry pi 2 using jogl backend ( https://github.com/gouessej/libgdx/ ). in current libgdx version, joglapplicationconfiguration abstract , there 2 child classes: joglawtapplicationconfiguration , joglnewtapplicationconfiguration. when i'm trying use joglawtapplicationconfiguration run it, i'm getting error: [java] glgeterror 0x500 [java] glgeterror 0x500 [java] joglapplication: couldn't initialize audio, disabling audio [java] java.lang.exceptionininitializererror [java] @ com.badlogic.gdx.backends.jogamp.joglapplicationbase.<init>(joglapplicationbase.java:54) [java] @ com.badlogic.gdx.backends.jogamp.joglnewtapplication.<init>(joglnewtapplication.java:49) [java] @ com.mygdx.game.desktop.desktoplauncher.main(desktoplauncher.java:14) [java] caused by: com.jogamp.openal.alexception: error opening default openal device [java] @ com.jogamp.op...

swift - Cannot convert value of type '[NSObject : AnyObject]' to expected argument type '[String : AnyObject]' -

xcode7 , swift, code: func loaddefaults() { let settingbundle = nsbundle.mainbundle().pathforresource("settings", oftype: "bundle") if settingbundle == nil { return } let root = nsdictionary(contentsoffile: settingbundle!.stringbyappendingstring("root.plist")) let prefrences = root?.objectforkey("preferencespecifiers") as! array<nsdictionary> let defautlstoregister = nsmutabledictionary(capacity: root!.count) prefrence in prefrences { let key = prefrence.objectforkey("key") as! string! if key != nil { defautlstoregister.setvalue(prefrence.objectforkey("defaultvale"), forkey: key!) } } nsuserdefaults.standarduserdefaults().registerdefaults(defautlstoregister [nsobject: anyobject]) } problem code: nsuserdefaults.standarduserdefaults().registerdefaults(defautlstoregister [nsobject: anyobject]) building warnings cannot conve...

ios - viewDidLoad() method not called after simultaneous pop and push to same view -

i using code navigation view controller in start self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; splashviewcontroller *rootvc = [[splashviewcontroller alloc]initwithnibname:@"splashviewcontroller" bundle:nil]; self.navigator = [[uinavigationcontroller alloc] initwithrootviewcontroller:rootvc]; self.window.rootviewcontroller = self.navigator; [self.window makekeyandvisible]; after using simple method push next view scoreboardlistviewcontroller *slvc = [[scoreboardlistviewcontroller alloc]initwithnibname:@"scoreboardlistviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:slvc animated:yes]; and using pop out view [self.navigationcontroller popviewcontrolleranimated:yes]; but when poppet , again push same view different property values viewdidload method did not run it runs if other view , push view i not able understand abnormal behaviour. when ever push view viewdidload should executed..... ...

android - How to prepend to the url of the API root in Retrofit / Can I have two Rest Adapters? -

this how set retrofit client. restadapter.builder builder = new restadapter.builder(); builder.setendpoint(server.api_root); builder.setexecutors(executors.newfixedthreadpool(5), new scheduledthreadpoolexecutor(5)); restadapter restadapter = builder.build(); rest_client = restadapter.create(api.class); however, of api endpoints i'm using http://example.com/ , others http://test.example.com/ should do? actually, can have 2 adapters 2 different apis? you have implement endpoint sample: https://medium.com/@kevintcoughlin/dynamic-endpoints-with-retrofit-a1f4229f4a8d if using 2.0 beta+ , endpoint renamed baseurl also, take @ 2.0+ : new: @url parameter annotation allows passing complete url endpoint.

mysql update one table from another -

i have massive database on over 2.7 million rows. contains data on uk property prices. the first table called pricepaid , has column called price , loc4. now trying average each year grouped loc4 , update tabel called pricepaidbycounty. i have created sql statement : insert pricepaidbycounty (county, avg2013) select loc4, avg(price) avgprice2013 pricepaid date '%2013%' group loc4 this works fine inserting initial row want use update statement instead need run sql query each month. can show me how change insert update. i doing need display average house price each location year. , database big dont want on flu thanks you can update table using following query using insert ... on duplicate key update statement ( https://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html ): insert pricepaidbycounty (county, avg2013) select loc4, avg(price) avgprice2013 pricepaid date '%2013%' group loc4 on duplicate key update avg2013=avgprice2013 ...

php - Covert multi dimensions array into key values -

sorry wrong described got that. array ( [0] => hello[30815][183] [1] => hello[30815][291][28280] [2] => hello[30815][291][28280][custom_math] [3] => hello[30815][472][28273][comment] ) after add loop for($i=0; $i<=count($cfn);$i++) { echo $cfn[$i] ; echo '<br>'; echo $cfv[$i]; echo '<br>'; } i got type of array hello[30815][183] => 28275 hello[30815][291][28280] => hello[30815][291][28280][custom_math] => noce hello[30815][472][28273][comment] => i want convert [hello] => array ( [183] => 28275 [291] => array ( [28280] => ) [291] => array ( [28280] => array ( [custom_math] => noce ) ) ...

fonts - LIBGDX Bitmapfont does not "wrap" to next line -

Image
i have been trying draw text using bitmapfont.however, text not wrap next line.here render method: gdx.gl.glclearcolor(1f, 1f, 1f, 1); gdx.gl.glclear(gl20.gl_color_buffer_bit); statetime+=delta; batch.setprojectionmatrix(camera.combined); batch.begin(); infofont.draw(batch, "really trying hard text wrapped remaining gets printed onto next line,however doesnt happen", 100, 300, 600, align.center, true); batch.end(); this results in "garbled" text.if last parameter made "false" text gets printed in straight line. wrong? font has been generated using glyphite.could problem or else?

android - LayoutTransition disappearing and changing not happening at same time -

i have custom "bottom action bar" here: https://youtu.be/tpi5jtcs2we , appears , disappears types of webpages (e.g. article/not article). set outermost linearlayout animatelayouttransition , made different layouttransition object, want bar disappear @ same time webview adjusts height. clear, bar (relativelayout) being set view.gone , webview should expand match parent (due layout_weight) since bar gone, it's not doing both @ same time. tried changing layouttransition.setduration() , .setstartdelay() . the articleactivity xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:id="@+id/container_article" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="app.morningsignout.com.morningsignoff.articleactivity" tools:igno...

java - AppCompatActivity crashing the app in Eclipse -

i'm creating app in eclipse , want use appcompat library in project. have imported library , working fine when extends activity appcompatactivity. problem is, when run app , application launch activity extended appcompactivty. app crashes. log cat showing noclassdeffounderror: please guide me in right way. thanks noclassdeffounderror occurs when source compiled, @ runtime , required class files not found. may can happen in distribution or production of jar files. my advise : clean , rebuild project .if not works use android studio instead of eclipse . android actionbar how add supporting library v7 appcompat eclipse

optimization - Python/lxml is eating too much memory -

the program quite simple, recursively descend directories , extract element. directories 1k 200 files of 0.5m. see consumes 2.5g of memory after time, it's unacceptable, script's not alone eat everything. cannot understand why doesn't release memory. explicit del doesn't help. there techniques consider? lxml import etree import os res=set() root, dirs, files in os.walk(basedir): in files: tree = etree.parse(os.path.join(root,i), parser) in tree.xpath("//a[@class='ctitle']/@href"): res.add(i) del tree you're keeping references element tree, _elementunicoderesult . element keeps references parent. prevents whole tree being garbage collected. try converting element string , store that: from lxml import etree import os titles = set() root, dirs, files in os.walk(basedir): filename in files: tree = etree.parse(os.path.join(root, filename), parser) title in tree.xpath(...

database - Mysql : I want to create a trigger which will insert data into user access permission table based on employee table and categories table -

i have 3 tables :- category ,employee , user_access_permission . want create trigger fire when new category added , insert values in user_access_permission each employee id .default value user_access 0. category table :- create table if not exists `categories` ( `category_id` int(11) not null auto_increment, `category_name` varchar(100) not null, `section_id` int(11) not null, unique key `category_id` (`category_id`), unique key `category_name` (`category_name`) ) engine=innodb default charset=latin1 auto_increment=1 ; employee table :- create table if not exists `employee` ( `employee_id` int(11) not null auto_increment, `emp_pass` varchar(50) not null, `email` varchar(100) not null, primary key (`employee_id`), unique key `email_unique` (`email`) ) engine=innodb default charset=utf8 comment=' ' auto_increment=1; user access permission table :- create table if not exists `user_access_permission` ( `uap_id` int(10) not null auto_increme...

Django: AttributeError: class Meta has no attribute 'model' -

using django 1.7.2 , djangorestframework==3.0.2 getting error attributeerror: class meta has no attribute 'model' class notificationcountserializer(serializers.serializer): ------ ------ class meta: fields = ('drivers_count', 'vehicles_count', 'maps_count') although same code working django==1.8 , djangorestframework==3.2.3 is issue django or djangorestframework version ? the issue version of django. from 1.8 changelog: what’s new in django 1.8 model._meta api django has formalized api model._meta, providing officially supported way retrieve fields , filter fields based on attributes. the model._meta object has been part of django since days of pre-0.96 “magic removal” – wasn’t official, stable api. in recognition of this, we’ve endeavored maintain backwards-compatibility old api endpoint possible. however, api endpoints aren’t part of new official api have been depreca...

object - How do i point two fields to use the same value in javascript -

i have object below, , can see, "valid" , "pending" using same value, there way put in 1 line rather duplicating "custom-info" ? map = { 'failed': 'custom-error', 'pending': 'custom-info', 'valid': 'custom-info' }; you can assign string value constant , set property value using constant. const customer_info = 'custom-info'; map = { 'failed': 'custom-error', 'pending': customer_info, 'valid': customer_info }; this helps if setting property value many times , used somewhere else otherwise setting string value in object fine.

c# - Trying to use DataGridView together with ICustomTypeDescriptor -

Image
i'm trying use datagridview display list of objects. in class want present properties have c# properties , want create properties dynamically reasons. here have example, works fine c# property (featureid) dynamically created property (name) returns value of first instance instances. why? first class implements icustompropertydescriptor interface public abstract class propertypresentationsubbase : icustomtypedescriptor { public string getclassname() { return typedescriptor.getclassname(this, true); } public attributecollection getattributes() { return typedescriptor.getattributes(this, true); } public string getcomponentname() { return typedescriptor.getcomponentname(this, true); } public typeconverter getconverter() { return typedescriptor.getconverter(this, true); } public eventdescriptor getdefaultevent() { return typedescriptor.getdefaultevent(this, true); } public propertydescriptor getdefaultproperty() { return typedescriptor.getdefaultproperty(this...

Eclipse: what is MI command and why does it matter for running the C code? -

while trying debug c code snippet eclipse, shows out following popup. error in final launch sequence failed execute mi command: -exec-run error message debugger end: unable find mach task port process-id 4550: (os/kern) failure (0x5).\n (please check gdb codesigned - see taskgated(8)) unable find mach task port process-id 4550: (os/kern) failure (0x5).\n (please check gdb codesigned - see taskgated(8)) is there solution matter? also, want ask if bothers lot use eclipse when writing code in c. never had kinds of trouble when first started learning xcode, there seems quite lot of things should care eclipse. from community forums when cdt launches, tries set breakpoint @ main, interrupt execution when program starts. however, target running breakpoint cannot set , whole things fails. you tell launch not set breakpoint , let connect target. go to: run->debug configurations... , find launch configuration . select startup subtab , scroll down , uncheck "set break...

Visual Studio 2015 remote debugging on Windows 10 machine -

i'm trying debug windows 8.1 app on windows 10 machine, in order catch exceptions , errors. i installed visual studio remote tools on destination computer, when try connect via visual studio 2015 on computer got distribution error: unable connect microsoft visual studio remote debugging monitor computer ... remote debugger version non accettable. maybe message different in english, translated italian. i'm used connect via remote tools other computers , notebooks windows 8 , windows 8.1, that's first time got error. doing wrong? there specific version windows 10?

javascript - create dynamic dropdown menu using an map of strings -

html like <div class="col-xs-12 col-sm-3 col-md-3"> <label>status</label> </div> <div class="col-xs-12 col-sm-3 col-md-3"> <div class="input-group"> <div class="input-group-addon"> <i class="fa fa-filter"></i> </div> <select class="form-control pull-right" name="status" id="status" tabindex="2"> <option value="1">enable</option> <option value="0">disable</option> </select> <select class="form-control pull-right" name="status_reason" id="status_reason" tabindex="2"> <option value=""></option> <option value=""></option> <option value=""...

xcode - supported InterfaceOrientations iOS 8 vs. iOS 9 -

a warning has occurred after updated latest version of xcode (7.0). conflicting return type in implementation of 'supportedinterfaceorientations': 'uiinterfaceorientationmask' (aka 'enum uiinterfaceorientationmask') vs 'nsuinteger' (aka 'unsigned long') i'm guessing -(nsuinteger)supportedinterfaceorientations is no longer supported in ios 9 , tried searching documentation on couldn't find it. so best solution going forward? i think have found possible solution: #if __iphone_os_version_max_allowed >= 90000 - (uiinterfaceorientationmask)supportedinterfaceorientations #else - (nsuinteger)supportedinterfaceorientations #endif

c# - Curious about Format function with Phone Number -

Image
update (solved): https://dotnetfiddle.net/6gejyo i used following code format phone number in loop various formats: string phonenumber = "9998675309" string.format("{0:" + formatstring + "}", convert.todouble(phonenumber)) i need format phone numbers 2 different ways. 1 came out expected , other did not. so, curious, decided quick console app , see of different phone number formatting possibilities think of. here result: my question this: why of come out formatted way seem should , others not? there escape characters needed of them? the "." has special meaning in format string. determines location of decimal separator in result string. have escape "." : string formatstring = "###-###\\.####"; some examples of usage of "." in format strings: // result "3.40" (3.4).tostring("#.00", cultureinfo.getcultureinfo("en-us")) // result "3,142" (3.14159...

javascript - array is empty as soon as i loop over it using the this keyword -

i have array populated objects , , when loop on using keyword , empty array, peice of code below: for(var =0, j = this.data.length ; < j ; i++) { var cur = this.date[i]; var bubble = this.createbubble(width , this.year.min , cur.start , cur.end ); /* add data-duration once have figured out */ var line = [ '<span style="margin-left: ' + bubble.getstartoffset() + 'px; width: ' + bubble.getwidth() + 'px; " class="bubble bubble-' + (cur.type || 'default' ) + '"></span>', '<span class="label">'+ cur.text +'<span>' ].join(''); html.push('<li>'+ line +'</li>') } see secound line var cur = this.date[i]; , if add breakpoint line of code , , in console, if this.data , array of objects , when hov...

sql - MySQL Query too large, is there a way to opimize? -

is there way optimize large mysql query? have tried many things, give me results not correct, such duplicates , empty columns. select quotations.*, group_concat(distinct concat(groups.group_id, " | ", groups.group_name) separator " , ") `quotation_groups`, group_concat(distinct concat(departments.department_id, " | ", departments.department_name, " | ", departments.department_code) separator " , ") `quotation_departments`, group_concat(distinct concat(projects.project_id) separator " , ") `quotation_projects`, group_concat(distinct concat(machines.machine_id, " | ", machines.machine_name) separator " , ") `quotation_machines`, group_concat(distinct concat(parts.part_id, " | ", parts.part_name) separator " , ") `quotation_parts`, group_concat(distinct concat(options.option_id, " | ", options.option_name) separator " , ") `quotation_options`, group_concat(distin...